-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple test to verify OpenMP offload
Verify simple OpenMP loop running on device, to check OpenMP offload working
- Loading branch information
1 parent
c6bfe81
commit 6bd7275
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <omp.h> | ||
|
||
int | ||
main( | ||
int argc, | ||
char **argv) | ||
{ | ||
int is_device = 1; | ||
|
||
#pragma omp target map(from : is_device) | ||
{ | ||
is_device = omp_is_initial_device(); | ||
} | ||
|
||
// returns 0 if executed on device, 1 otherwise | ||
return is_device; | ||
} |