Created
October 21, 2017 03:36
-
-
Save iwatake2222/ef5d2b146a9e0d88a931400cef60a337 to your computer and use it in GitHub Desktop.
OpenMP sample for Visual Studio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdafx.h" | |
#include "omp.h" | |
/* | |
* DO NOT FORGET TO ENABLE OPEN MP | |
* right click on project -> Properties -> C/C++ -> Language | |
* Open MP Support = Yes | |
*/ | |
int main() | |
{ | |
#pragma omp parallel for | |
for (int y = 0; y < 10; y++) { | |
for (int x = 0; x < 10; x++) { | |
printf("%d %d %d\n", omp_get_thread_num(), x, y); | |
} | |
} | |
while (1); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment