Skip to content

Commit

Permalink
[OpenMP][NFC] Enable more runtime tests and also run them with O3
Browse files Browse the repository at this point in the history
The test run fine on my AMD GPU machine, we should verify them on others
too and put them into our regular testing. Not testing O1/2/3 is really
bad and not testing all architecturs is similarly problematic.

Differential Revision: https://reviews.llvm.org/D148576
  • Loading branch information
jdoerfert committed Jul 31, 2023
1 parent 6368455 commit e5a3d5b
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda
// REQUIRES: nvptx64-nvidia-cuda
// RUN: %libomptarget-compile-run-and-check-generic
// RUN: %libomptarget-compileopt-run-and-check-generic

#include <omp.h>
#include <stdio.h>
Expand Down
12 changes: 9 additions & 3 deletions openmp/libomptarget/test/api/omp_dynamic_shared_memory.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
// RUN: %libomptarget-compile-nvptx64-nvidia-cuda
// RUN: %libomptarget-compile-generic
// RUN: env LIBOMPTARGET_SHARED_MEMORY_SIZE=256 \
// RUN: %libomptarget-run-nvptx64-nvidia-cuda | %fcheck-nvptx64-nvidia-cuda
// REQUIRES: nvptx64-nvidia-cuda
// RUN: %libomptarget-run-generic | %fcheck-generic

// RUN: %libomptarget-compileopt-generic
// RUN: env LIBOMPTARGET_SHARED_MEMORY_SIZE=256 \
// RUN: %libomptarget-run-generic | %fcheck-generic

// UNSUPPORTED: x86_64-pc-linux-gnu
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO

#include <omp.h>
#include <stdio.h>
Expand Down
9 changes: 5 additions & 4 deletions openmp/libomptarget/test/mapping/lambda_mapping.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// RUN: %libomptarget-compilexx-run-and-check-generic

// Error on the gpu that crashes the host
// UNSUPPORTED: amdgcn-amd-amdhsa
// On AMDGPU we don't have malloc support yet. We need optimizations
// to avoid a thread state which requires malloc.
//
// XUN: %libomptarget-compilexx-run-and-check-generic
// RUN: %libomptarget-compileoptxx-run-and-check-generic

#include <iostream>

Expand Down
4 changes: 2 additions & 2 deletions openmp/libomptarget/test/offloading/assert.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %libomptarget-compilexx-nvptx64-nvidia-cuda && %libomptarget-run-fail-nvptx64-nvidia-cuda
// REQUIRES: nvptx64-nvidia-cuda
// RUN: %libomptarget-compilexx-generic && %libomptarget-run-fail-generic
// RUN: %libomptarget-compileoptxx-generic && %libomptarget-run-fail-generic

int main(int argc, char *argv[]) {
#pragma omp target
Expand Down
2 changes: 2 additions & 0 deletions openmp/libomptarget/test/offloading/barrier_fence.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %libomptarget-compile-generic -fopenmp-offload-mandatory -O3
// RUN: %libomptarget-run-generic
// RUN: %libomptarget-compileopt-generic -fopenmp-offload-mandatory -O3
// RUN: %libomptarget-run-generic

// UNSUPPORTED: aarch64-unknown-linux-gnu
// UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
Expand Down
1 change: 1 addition & 0 deletions openmp/libomptarget/test/offloading/bug47654.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %libomptarget-compilexx-run-and-check-generic
// RUN: %libomptarget-compileoptxx-run-and-check-generic

#include <cassert>
#include <iostream>
Expand Down
2 changes: 2 additions & 0 deletions openmp/libomptarget/test/offloading/bug49021.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %libomptarget-compilexx-generic -O3 && %libomptarget-run-generic
// RUN: %libomptarget-compilexx-generic -O3 -ffast-math && %libomptarget-run-generic
// RUN: %libomptarget-compileoptxx-generic -O3 && %libomptarget-run-generic
// RUN: %libomptarget-compileoptxx-generic -O3 -ffast-math && %libomptarget-run-generic

#include <iostream>

Expand Down
14 changes: 9 additions & 5 deletions openmp/libomptarget/test/offloading/bug49334.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// The test is disabled for now because of the flaky failure which can cause
// Buildbot gives false negative results.

// RUN: nothing
// REQUIRES: testToBeFixed
// RUN: %libomptarget-compilexx-generic -O3 && %libomptarget-run-generic
// RUN: %libomptarget-compilexx-generic -O3 -ffast-math && \
// RUN: %libomptarget-run-generic
// RUN: %libomptarget-compileoptxx-generic -O3 && %libomptarget-run-generic
// RUN: %libomptarget-compileoptxx-generic -O3 -ffast-math && \
// RUN: %libomptarget-run-generic

// UNSUPPORTED: x86_64-pc-linux-gnu
// UNSUPPORTED: x86_64-pc-linux-gnu-LTO

#include <cassert>
#include <cmath>
Expand Down
3 changes: 3 additions & 0 deletions openmp/libomptarget/test/offloading/bug49779.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// RUN: %libomptarget-compilexx-generic && \
// RUN: env LIBOMPTARGET_STACK_SIZE=2048 %libomptarget-run-generic
// RUN: %libomptarget-compileoptxx-generic && \
// RUN: env LIBOMPTARGET_STACK_SIZE=2048 %libomptarget-run-generic

// We need malloc/global_alloc support
// UNSUPPORTED: amdgcn-amd-amdhsa

#include <cassert>
Expand Down
1 change: 1 addition & 0 deletions openmp/libomptarget/test/offloading/bug50022.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %libomptarget-compilexx-and-run-generic
// RUN: %libomptarget-compileoptxx-and-run-generic

#include <cassert>
#include <iostream>
Expand Down
1 change: 1 addition & 0 deletions openmp/libomptarget/test/offloading/bug51982.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %libomptarget-compile-generic -O1 && %libomptarget-run-generic
// -O1 to run openmp-opt
// RUN: %libomptarget-compileopt-generic -O1 && %libomptarget-run-generic

int main(void) {
long int aa = 0;
Expand Down
1 change: 1 addition & 0 deletions openmp/libomptarget/test/offloading/bug53727.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %libomptarget-compilexx-and-run-generic
// RUN: %libomptarget-compileoptxx-and-run-generic

#include <cassert>
#include <iostream>
Expand Down
7 changes: 6 additions & 1 deletion openmp/libomptarget/test/offloading/d2d_memcpy.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// RUN: %libomptarget-compile-generic && env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-generic | %fcheck-generic -allow-empty
// RUN: %libomptarget-compile-generic && \
// RUN: env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-generic | \
// RUN: %fcheck-generic -allow-empty
// RUN: %libomptarget-compileopt-generic && \
// RUN: env OMP_MAX_ACTIVE_LEVELS=2 %libomptarget-run-generic | \
// RUN: %fcheck-generic -allow-empty

#include <assert.h>
#include <omp.h>
Expand Down
5 changes: 4 additions & 1 deletion openmp/libomptarget/test/offloading/dynamic_module.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// RUN: %libomptarget-compile-generic -DSHARED -fPIC -shared -o %t.so && %libomptarget-compile-generic %t.so && %libomptarget-run-generic 2>&1 | %fcheck-generic
// RUN: %libomptarget-compile-generic -DSHARED -fPIC -shared -o %t.so && \
// RUN: %libomptarget-compile-generic %t.so && %libomptarget-run-generic 2>&1 | %fcheck-generic
// RUN: %libomptarget-compileopt-generic -DSHARED -fPIC -shared -o %t.so && \
// RUN: %libomptarget-compileopt-generic %t.so && %libomptarget-run-generic 2>&1 | %fcheck-generic

#ifdef SHARED
void foo() {}
Expand Down
3 changes: 1 addition & 2 deletions openmp/libomptarget/test/offloading/target_nowait_target.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %libomptarget-compilexx-and-run-generic

// UNSUPPORTED: amdgcn-amd-amdhsa
// RUN: %libomptarget-compileoptxx-and-run-generic

#include <cassert>

Expand Down

0 comments on commit e5a3d5b

Please sign in to comment.