Fix test case which is not working for AMDGPU.
authorJennifer Yu <jennifer.yu@intel.com>
Tue, 20 Sep 2022 00:04:09 +0000 (17:04 -0700)
committerJennifer Yu <jennifer.yu@intel.com>
Tue, 20 Sep 2022 00:07:01 +0000 (17:07 -0700)
This is for the change of
Differential Revision: https://reviews.llvm.org/D134186

openmp/libomptarget/test/mapping/target_has_device_addr.c

index 8d20616..dcb8f26 100644 (file)
@@ -11,8 +11,9 @@
 #define LENGTH 128
 
 void foo() {
+  const int device_id = omp_get_default_device();
   float *A;
-#pragma omp allocate(A) allocator(llvm_omp_target_shared_mem_alloc)
+  A = (float *)omp_target_alloc(sizeof(float), device_id);
 
   float *A_dev = NULL;
 #pragma omp target has_device_addr(A [FROM:LENGTH]) map(A_dev)