Skip to content

[OpenMP] Fix two usm tests for amdgpus. #78824

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

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions openmp/libomptarget/test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,13 @@ if config.libomptarget_current_target.startswith('nvptx'):
except ValueError:
# If the architecture is invalid, assume it is supported.
supports_unified_shared_memory = True
if config.libomptarget_current_target.startswith('amdgcn'):
supports_unified_shared_memory = False
elif config.libomptarget_current_target.startswith('amdgcn'):
# amdgpu_test_arch contains a list of AMD GPUs in the system
# only check the first one assuming that we will run the test on it.
if not (config.amdgpu_test_arch.startswith("gfx90a") or
config.amdgpu_test_arch.startswith("gfx940") or
config.amdgpu_test_arch.startswith("gfx942")):
supports_unified_shared_memory = False
if supports_unified_shared_memory:
config.available_features.add('unified_shared_memory')

Expand Down
1 change: 1 addition & 0 deletions openmp/libomptarget/test/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config.test_extra_flags = "@OPENMP_TEST_FLAGS@"
config.cuda_path = "@CUDA_TOOLKIT_ROOT_DIR@"
config.cuda_libdir = "@CUDA_LIBDIR@"
config.cuda_test_arch = "@LIBOMPTARGET_DEP_CUDA_ARCH@"
config.amdgpu_test_arch = "@LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST@"
config.libomptarget_obj_root = "@CMAKE_CURRENT_BINARY_DIR@/@CURRENT_TARGET@"
config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@"
config.llvm_library_dir = "@LIBOMPTARGET_LLVM_LIBRARY_DIR@"
Expand Down
7 changes: 4 additions & 3 deletions openmp/libomptarget/test/unified_shared_memory/api.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// RUN: %libomptarget-compile-run-and-check-generic
// RUN: %libomptarget-compile-generic
// RUN: env HSA_XNACK=1 \
// RUN: %libomptarget-run-generic | %fcheck-generic
// XFAIL: nvptx64-nvidia-cuda
// XFAIL: nvptx64-nvidia-cuda-LTO

// Fails on amdgpu with error: GPU Memory Error
// UNSUPPORTED: amdgcn-amd-amdhsa
// REQUIRES: unified_shared_memory

#include <omp.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// RUN: %libomptarget-compile-run-and-check-generic
// RUN: %libomptarget-compile-generic
// RUN: env HSA_XNACK=1 \
// RUN: %libomptarget-run-generic | %fcheck-generic

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

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

Expand Down