Skip to content

Commit 71963ab

Browse files
committed
[OpenMP] Fix two usm tests for amdgpus.
Some are missing setting of HSA_XNACK=1 environment variable, used to enable unified memory support on amdgpu's when it's not been set at kernel boot time. Some others needed to be marked as supporting unified_shared_memory in the lit test harness.
1 parent 1048b59 commit 71963ab

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

openmp/libomptarget/test/lit.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ if config.libomptarget_current_target.startswith('nvptx'):
117117
# If the architecture is invalid, assume it is supported.
118118
supports_unified_shared_memory = True
119119
if config.libomptarget_current_target.startswith('amdgcn'):
120-
supports_unified_shared_memory = False
120+
if not (config.amdgpu_test_arch == "gfx908" or
121+
config.amdgpu_test_arch == "gfx90a" or
122+
config.amdgpu_test_arch == "gfx942") :
123+
supports_unified_shared_memory = False
121124
if supports_unified_shared_memory:
122125
config.available_features.add('unified_shared_memory')
123126

openmp/libomptarget/test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config.test_extra_flags = "@OPENMP_TEST_FLAGS@"
1010
config.cuda_path = "@CUDA_TOOLKIT_ROOT_DIR@"
1111
config.cuda_libdir = "@CUDA_LIBDIR@"
1212
config.cuda_test_arch = "@LIBOMPTARGET_DEP_CUDA_ARCH@"
13+
config.amdgpu_test_arch = "@LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST@"
1314
config.libomptarget_obj_root = "@CMAKE_CURRENT_BINARY_DIR@/@CURRENT_TARGET@"
1415
config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@"
1516
config.llvm_library_dir = "@LIBOMPTARGET_LLVM_LIBRARY_DIR@"

openmp/libomptarget/test/unified_shared_memory/api.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// RUN: %libomptarget-compile-run-and-check-generic
1+
// RUN: %libomptarget-compile-generic
2+
// RUN: env HSA_XNACK=1 \
3+
// RUN: %libomptarget-run-generic | %fcheck-generic
24
// XFAIL: nvptx64-nvidia-cuda
35
// XFAIL: nvptx64-nvidia-cuda-LTO
46

5-
// Fails on amdgpu with error: GPU Memory Error
6-
// UNSUPPORTED: amdgcn-amd-amdhsa
7-
87
#include <omp.h>
98
#include <stdio.h>
109

openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// RUN: %libomptarget-compile-run-and-check-generic
1+
// RUN: %libomptarget-compile-generic
2+
// RUN: env HSA_XNACK=1 \
3+
// RUN: %libomptarget-run-generic | %fcheck-generic
24

35
// REQUIRES: unified_shared_memory
46
// UNSUPPORTED: clang-6, clang-7, clang-8, clang-9
57

6-
// Fails on amdgpu with error: GPU Memory Error
78
// Fails on nvptx with error: an illegal memory access was encountered
8-
// XFAIL: amdgcn-amd-amdhsa
99
// XFAIL: nvptx64-nvidia-cuda
1010
// XFAIL: nvptx64-nvidia-cuda-LTO
1111

0 commit comments

Comments
 (0)