diff --git a/test/smoke-dev/rt-memory-threshold-env/AMDGPUMemoryManager_threshold_env.c b/test/smoke-dev/rt-memory-threshold-env/AMDGPUMemoryManager_threshold_env.c new file mode 100644 index 000000000..044d8e72a --- /dev/null +++ b/test/smoke-dev/rt-memory-threshold-env/AMDGPUMemoryManager_threshold_env.c @@ -0,0 +1,38 @@ +#include +#include + +int main() { + int N = 10; + + int a[N]; + int b[N]; + + int i; + + for (i = 0; i < N; i++) + a[i] = 0; + + for (i = 0; i < N; i++) + b[i] = i; + +#pragma omp target parallel for + { + for (int j = 0; j < N; j++) + a[j] = b[j]; + } + + int rc = 0; + for (i = 0; i < N; i++) + if (a[i] != b[i]) { + rc++; + printf("Wrong value: a[%d]=%d\n", i, a[i]); + } + + if (!rc) + printf("Success\n"); + + return rc; +} + +/// CHECK: TARGET AMDGPU RTL --> AMDGPUMemoryManager threshhold was set to: +/// 1048576 B diff --git a/test/smoke-dev/rt-memory-threshold-env/Makefile b/test/smoke-dev/rt-memory-threshold-env/Makefile new file mode 100644 index 000000000..88ed2c632 --- /dev/null +++ b/test/smoke-dev/rt-memory-threshold-env/Makefile @@ -0,0 +1,18 @@ +include ../../Makefile.defs + +TESTNAME = AMDGPUMemoryManager_threshold_env +TESTSRC_MAIN = AMDGPUMemoryManager_threshold_env.c +TESTSRC_AUX = +TESTSRC_ALL = $(TESTSRC_MAIN) $(TESTSRC_AUX) +RUNENV += LIBOMPTARGET_DEBUG=1 +RUNENV += OMPX_AMD_MEMORY_MANAGER_THRESHOLD_EXP_2=20 + +RUNCMD = ./$(TESTNAME) 2>&1 | $(FILECHECK) $(TESTSRC_MAIN) + +CLANG ?= clang +OMP_BIN = $(AOMP)/bin/$(CLANG) +CC = $(OMP_BIN) $(VERBOSE) +#-ccc-print-phases +#"-\#\#\#" + +include ../Makefile.rules