Changeset View
Changeset View
Standalone View
Standalone View
openmp/libomptarget/test/offloading/host_as_target.c
// Check that specifying device as omp_get_initial_device(): | // Check that specifying device as omp_get_initial_device(): | ||||
// - Doesn't cause the runtime to fail. | // - Doesn't cause the runtime to fail. | ||||
// - Offloads code to the host. | // - Offloads code to the host. | ||||
// - Doesn't transfer data. In this case, just check that neither host data nor | // - Doesn't transfer data. In this case, just check that neither host data nor | ||||
// default device data are affected by the specified transfers. | // default device data are affected by the specified transfers. | ||||
// - Works whether it's specified directly or as the default device. | // - Works whether it's specified directly or as the default device. | ||||
// RUN: %libomptarget-compile-run-and-check-generic | // RUN: %libomptarget-compile-run-and-check-generic | ||||
// amdgpu does not have a working printf definition | // amdgpu does not have a working printf definition | ||||
// XFAIL: amdgcn-amd-amdhsa | // XFAIL: amdgcn-amd-amdhsa | ||||
// XFAIL: amdgcn-amd-amdhsa-oldDriver | |||||
// XFAIL: amdgcn-amd-amdhsa-LTO | // XFAIL: amdgcn-amd-amdhsa-LTO | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <omp.h> | #include <omp.h> | ||||
static void check(char *X, int Dev) { | static void check(char *X, int Dev) { | ||||
printf(" host X = %c\n", *X); | printf(" host X = %c\n", *X); | ||||
#pragma omp target device(Dev) | #pragma omp target device(Dev) | ||||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |