[Openmp-commits] [openmp] [OpenMP] Fix or disable NVPTX tests failing currently (PR #77844)
Joseph Huber via Openmp-commits
openmp-commits at lists.llvm.org
Thu Jan 11 14:35:56 PST 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/77844
Summary:
This patch is an attempt to get a clean run of `check-openmp` running on
an NVPTX machine. I simply took the lists of tests that failed on my
`sm_89` machine and disabled them or fixed them. A lot of these tests
are disabled on AMDGPU already, so it makes sense that NVPTX fails. The
others are simply problems with NVPTX optimized debugging which will
need to be fixed. I opened an issue on one of them.
>From 83f9583616ef8f341ceca9a8568cf90181312b4b Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Thu, 11 Jan 2024 16:33:08 -0600
Subject: [PATCH] [OpenMP] Fix or disable NVPTX tests failing currently
Summary:
This patch is an attempt to get a clean run of `check-openmp` running on
an NVPTX machine. I simply took the lists of tests that failed on my
`sm_89` machine and disabled them or fixed them. A lot of these tests
are disabled on AMDGPU already, so it makes sense that NVPTX fails. The
others are simply problems with NVPTX optimized debugging which will
need to be fixed. I opened an issue on one of them.
---
openmp/libomptarget/test/libc/assert.c | 2 ++
.../test/mapping/target_derefence_array_pointrs.cpp | 3 +++
openmp/libomptarget/test/mapping/target_uses_allocator.c | 3 +++
.../test/mapping/target_wrong_use_device_addr.c | 3 +++
openmp/libomptarget/test/offloading/bug64959.c | 7 +++++--
openmp/libomptarget/test/offloading/cuda_no_devices.c | 4 ++--
openmp/libomptarget/test/offloading/info.c | 3 +++
.../test/offloading/std_complex_arithmetic.cpp | 1 +
.../test/unified_shared_memory/close_enter_exit.c | 2 ++
.../test/unified_shared_memory/close_modifier.c | 2 ++
.../test/unified_shared_memory/shared_update.c | 2 ++
11 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/openmp/libomptarget/test/libc/assert.c b/openmp/libomptarget/test/libc/assert.c
index 9a10032f481893..803a8207e10a45 100644
--- a/openmp/libomptarget/test/libc/assert.c
+++ b/openmp/libomptarget/test/libc/assert.c
@@ -3,6 +3,8 @@
// REQUIRES: libc
+// NVPTX without LTO uses the implementation in OpenMP currently.
+// UNSUPPORTED: nvptx64-nvidia-cuda
// UNSUPPORTED: powerpc64-ibm-linux-gnu
// UNSUPPORTED: powerpc64-ibm-linux-gnu-LTO
// UNSUPPORTED: aarch64-unknown-linux-gnu
diff --git a/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp b/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
index 7d4bc9ea224789..a6dd4069a8f588 100644
--- a/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
+++ b/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
@@ -2,7 +2,10 @@
// RUN: %libomptarget-run-generic 2>&1 \
// RUN: | %fcheck-generic
+// FIXME: This is currently broken on all GPU targets
// UNSUPPORTED: amdgcn-amd-amdhsa
+// UNSUPPORTED: nvptx64-nvidia-cuda
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
#include <stdio.h>
#include <stdlib.h>
diff --git a/openmp/libomptarget/test/mapping/target_uses_allocator.c b/openmp/libomptarget/test/mapping/target_uses_allocator.c
index 87b940650b998f..eb20e965c30bc9 100755
--- a/openmp/libomptarget/test/mapping/target_uses_allocator.c
+++ b/openmp/libomptarget/test/mapping/target_uses_allocator.c
@@ -1,6 +1,9 @@
// RUN: %libomptarget-compile-run-and-check-generic
+// FIXME: https://github.com/llvm/llvm-project/issues/77841
// UNSUPPORTED: amdgcn-amd-amdhsa
+// UNSUPPORTED: nvptx64-nvidia-cuda
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
#include <omp.h>
#include <stdio.h>
diff --git a/openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c b/openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c
index 6c7939ea196ad5..7a5babd692530b 100644
--- a/openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c
+++ b/openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c
@@ -2,6 +2,9 @@
// RUN: env LIBOMPTARGET_INFO=64 %libomptarget-run-fail-generic 2>&1 \
// RUN: | %fcheck-generic
+// FIXME: Fails due to optimized debugging in 'ptxas'
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+
#include <stdio.h>
int main() {
diff --git a/openmp/libomptarget/test/offloading/bug64959.c b/openmp/libomptarget/test/offloading/bug64959.c
index 500911fa3f3163..0c5a99ac8875c2 100644
--- a/openmp/libomptarget/test/offloading/bug64959.c
+++ b/openmp/libomptarget/test/offloading/bug64959.c
@@ -1,8 +1,11 @@
-// RUN: %libomptarget-compilexx-run-and-check-generic
-// RUN: %libomptarget-compileoptxx-run-and-check-generic
+// RUN: %libomptarget-compile-run-and-check-generic
+// RUN: %libomptarget-compileopt-run-and-check-generic
// TODO: This requires malloc support for the threads states.
+// FIXME: Flaxy on all GPU targets.
// UNSUPPORTED: amdgcn-amd-amdhsa
+// UNSUPPORTED: nvptx64-nvidia-cuda
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
#include <omp.h>
#include <stdio.h>
diff --git a/openmp/libomptarget/test/offloading/cuda_no_devices.c b/openmp/libomptarget/test/offloading/cuda_no_devices.c
index bbcbf6b9f07e2b..6f6c91cda438e2 100644
--- a/openmp/libomptarget/test/offloading/cuda_no_devices.c
+++ b/openmp/libomptarget/test/offloading/cuda_no_devices.c
@@ -3,7 +3,7 @@
// complaint anymore, especially when the user isn't targeting CUDA.
// RUN: %libomptarget-compile-generic
-// RUN: env CUDA_VISIBLE_DEVICES= \
+// RUN: env CUDA_VISIBLE_DEVICES="" ROCR_VISIBLE_DEVICES="" \
// RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic
#include <stdio.h>
@@ -14,7 +14,7 @@
int main() {
int x = 0;
#pragma omp target teams num_teams(2) reduction(+ : x)
- x += 2;
+ { x += 2; }
printf("Hello World: %d\n", x);
return 0;
}
diff --git a/openmp/libomptarget/test/offloading/info.c b/openmp/libomptarget/test/offloading/info.c
index 81300cc92ec56d..da8e4c44c5accb 100644
--- a/openmp/libomptarget/test/offloading/info.c
+++ b/openmp/libomptarget/test/offloading/info.c
@@ -5,6 +5,9 @@
// RUN: env LIBOMPTARGET_INFO=63 %libomptarget-run-amdgcn-amd-amdhsa 2>&1 | \
// RUN: %fcheck-amdgcn-amd-amdhsa -allow-empty -check-prefixes=INFO,AMDGPU
+// FIXME: Fails due to optimized debugging in 'ptxas'.
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+
#include <omp.h>
#include <stdio.h>
diff --git a/openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp b/openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp
index 44f87ad732bfbf..641b849bbc3e67 100644
--- a/openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp
+++ b/openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp
@@ -6,6 +6,7 @@
// FIXME: This fails to link due to missing math symbols. We should provide the
// needed math functions in the GPU `libm` and require the GPU C library.
// UNSUPPORTED: amdgcn-amd-amdhsa
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
#include <cassert>
#include <complex>
diff --git a/openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c b/openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c
index ec292c857f9c78..be44f8e7c53fb6 100644
--- a/openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c
+++ b/openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c
@@ -5,6 +5,8 @@
// Fails on amdgpu with error: GPU Memory Error
// XFAIL: amdgcn-amd-amdhsa
+// XFAIL: nvptx64-nvidia-cuda
+// XFAIL: nvptx64-nvidia-cuda-LTO
#include <omp.h>
#include <stdio.h>
diff --git a/openmp/libomptarget/test/unified_shared_memory/close_modifier.c b/openmp/libomptarget/test/unified_shared_memory/close_modifier.c
index 47902a9a298dd8..bc3a0b771710c2 100644
--- a/openmp/libomptarget/test/unified_shared_memory/close_modifier.c
+++ b/openmp/libomptarget/test/unified_shared_memory/close_modifier.c
@@ -5,6 +5,8 @@
// amdgpu runtime crash
// UNSUPPORTED: amdgcn-amd-amdhsa
+// UNSUPPORTED: nvptx64-nvidia-cuda
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
#include <omp.h>
#include <stdio.h>
diff --git a/openmp/libomptarget/test/unified_shared_memory/shared_update.c b/openmp/libomptarget/test/unified_shared_memory/shared_update.c
index 3923b89bba4f69..7930466e297cb4 100644
--- a/openmp/libomptarget/test/unified_shared_memory/shared_update.c
+++ b/openmp/libomptarget/test/unified_shared_memory/shared_update.c
@@ -4,6 +4,8 @@
// amdgpu runtime crash
// UNSUPPORTED: amdgcn-amd-amdhsa
+// UNSUPPORTED: nvptx64-nvidia-cuda
+// UNSUPPORTED: nvptx64-nvidia-cuda-LTO
#include <omp.h>
#include <stdio.h>
More information about the Openmp-commits
mailing list