Skip to content

Update test_metadirective_target_device.c #872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//===--------------------- test_metadirective_target_device.c ---------------------===//
//===--------------------- test_metadirective_device.c ---------------------===//
//
// OpenMP API Version 5.1 Nov 2020
//
// Tests that target_device is recognized & will work properly when matching an nvidia
// Tests that device is recognized & will work properly when matching an nvidia
// GPU.
//
////===---------------------------------------------------------------------===//
Expand All @@ -14,7 +14,7 @@

#define N 1024

int test_metadirective_target_device() {
int test_metadirective_device() {
int errors = 0;
int A[N];

Expand All @@ -28,10 +28,10 @@ int test_metadirective_target_device() {
{
// Except that one of these are true, so the array should be set to masked thread num (0)
#pragma omp metadirective \
when( target_device={arch("nvptx")}: masked ) \
when( device={arch("nvptx")}: masked ) \
when( implementation={vendor(amd)}: masked ) \
when (implementation={vendor(nvidia)}: masked) \
when( target_device={kind(nohost)}: masked ) \
when( device={kind(nohost)}: masked ) \
default( for)
for (int i = 0; i < N; i++) {
A[i] = omp_get_thread_num();
Expand All @@ -53,7 +53,7 @@ int main () {
OMPVV_TEST_OFFLOADING;

if (omp_get_num_devices() > 0) {
errors = test_metadirective_target_device();
errors = test_metadirective_device();
} else {
OMPVV_INFOMSG("Cannot test target_device without a target device!")
}
Expand Down