[llvm] [Offload][OpenMP] Enable more tests on AMDGPU (PR #156626)
Jan Patrick Lehr via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 02:06:06 PDT 2025
https://github.com/jplehr updated https://github.com/llvm/llvm-project/pull/156626
>From d9422ef48fed0b0311de9f73593b567b003300ab Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Wed, 3 Sep 2025 03:55:02 -0500
Subject: [PATCH 1/2] [Offload][OpenMP] Enable more tests on AMDGPU
(Re)enables a couple of tests that were disabled on AMDGPU for some
reason. Pass for me locally.
---
.../offloading/mandatory_but_no_devices.c | 42 ++++++++++++++++++-
offload/test/offloading/memory_manager.cpp | 1 -
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/offload/test/offloading/mandatory_but_no_devices.c b/offload/test/offloading/mandatory_but_no_devices.c
index ecdee72acad04..3ec582a54a8ac 100644
--- a/offload/test/offloading/mandatory_but_no_devices.c
+++ b/offload/test/offloading/mandatory_but_no_devices.c
@@ -3,6 +3,47 @@
// device. This behavior is proposed for OpenMP 5.2 in OpenMP spec github
// issue 2669.
+// AMD Tests
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa -DDIR=target
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa -DDIR='target teams'
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa -DDIR='target data map(X)'
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa \
+// RUN: -DDIR='target enter data map(to:X)'
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa \
+// RUN: -DDIR='target exit data map(from:X)'
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa \
+// RUN: -DDIR='target update to(X)'
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa \
+// RUN: -DDIR='target update from(X)'
+// RUN: env OMP_TARGET_OFFLOAD=mandatory ROCR_VISIBLE_DEVICES= \
+// RUN: %libomptarget-run-fail-amdgcn-amd-amdhsa 2>&1 | \
+// RUN: %fcheck-amdgcn-amd-amdhsa
+
+// Nvidia Tests
// RUN: %libomptarget-compile-nvptx64-nvidia-cuda -DDIR=target
// RUN: env OMP_TARGET_OFFLOAD=mandatory CUDA_VISIBLE_DEVICES= \
// RUN: %libomptarget-run-fail-nvptx64-nvidia-cuda 2>&1 | \
@@ -42,7 +83,6 @@
// RUN: %libomptarget-run-fail-nvptx64-nvidia-cuda 2>&1 | \
// RUN: %fcheck-nvptx64-nvidia-cuda
-// REQUIRES: nvptx64-nvidia-cuda
#include <omp.h>
#include <stdio.h>
diff --git a/offload/test/offloading/memory_manager.cpp b/offload/test/offloading/memory_manager.cpp
index fba1e4a540126..bba22b22c4bfc 100644
--- a/offload/test/offloading/memory_manager.cpp
+++ b/offload/test/offloading/memory_manager.cpp
@@ -1,6 +1,5 @@
// RUN: %libomptarget-compilexx-run-and-check-generic
-// REQUIRES: nvidiagpu
#include <omp.h>
>From ca04fff60e5141a48bd0697b4c26dc9ee317d305 Mon Sep 17 00:00:00 2001
From: Jan Patrick Lehr <jp.lehr at gmail.com>
Date: Wed, 3 Sep 2025 11:05:59 +0200
Subject: [PATCH 2/2] Update offload/test/offloading/mandatory_but_no_devices.c
---
offload/test/offloading/mandatory_but_no_devices.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/offload/test/offloading/mandatory_but_no_devices.c b/offload/test/offloading/mandatory_but_no_devices.c
index 3ec582a54a8ac..df8a5f3b9278c 100644
--- a/offload/test/offloading/mandatory_but_no_devices.c
+++ b/offload/test/offloading/mandatory_but_no_devices.c
@@ -83,7 +83,6 @@
// RUN: %libomptarget-run-fail-nvptx64-nvidia-cuda 2>&1 | \
// RUN: %fcheck-nvptx64-nvidia-cuda
-
#include <omp.h>
#include <stdio.h>
More information about the llvm-commits
mailing list