diff options
author | Shilei Tian <i@tianshilei.me> | 2022-07-22 11:45:06 -0400 |
---|---|---|
committer | Shilei Tian <i@tianshilei.me> | 2022-07-22 11:45:13 -0400 |
commit | 77cb30e3a60eabe1a79e02308675c4b6a96c4615 (patch) | |
tree | aa02be5d5c516e092bb965f815f6a0e0ffa8dc7a /openmp | |
parent | 5a445395e49acc1a812b26ed9394014962508102 (diff) | |
download | llvm-77cb30e3a60eabe1a79e02308675c4b6a96c4615.zip llvm-77cb30e3a60eabe1a79e02308675c4b6a96c4615.tar.gz llvm-77cb30e3a60eabe1a79e02308675c4b6a96c4615.tar.bz2 |
Revert "[OpenMP][DeviceRTL] Fix the issue that multiple calls to `omp_get_wtime` is optimized out by mistake"
This reverts commit ad34f1dba80efb62f5181e30b039a017fd5d164e.
Diffstat (limited to 'openmp')
-rw-r--r-- | openmp/libomptarget/DeviceRTL/src/Misc.cpp | 2 | ||||
-rw-r--r-- | openmp/libomptarget/test/lit.cfg | 54 | ||||
-rw-r--r-- | openmp/libomptarget/test/offloading/wtime.c | 24 |
3 files changed, 2 insertions, 78 deletions
diff --git a/openmp/libomptarget/DeviceRTL/src/Misc.cpp b/openmp/libomptarget/DeviceRTL/src/Misc.cpp index 7166925..554a13a 100644 --- a/openmp/libomptarget/DeviceRTL/src/Misc.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Misc.cpp @@ -52,7 +52,7 @@ double getWTick() { double getWTime() { unsigned long long nsecs; - asm volatile("mov.u64 %0, %%globaltimer;" : "=l"(nsecs)); + asm("mov.u64 %0, %%globaltimer;" : "=l"(nsecs)); return (double)nsecs * getWTick(); } diff --git a/openmp/libomptarget/test/lit.cfg b/openmp/libomptarget/test/lit.cfg index f0eadea..5436d32 100644 --- a/openmp/libomptarget/test/lit.cfg +++ b/openmp/libomptarget/test/lit.cfg @@ -128,7 +128,7 @@ for libomptarget_target in config.libomptarget_all_targets: # Is this target in the current system? If so create a compile, run and test # command. Otherwise create command that return false. if libomptarget_target == config.libomptarget_current_target: - config.substitutions.append(("%libomptarget-compilexx-run-and-check-generic", + config.substitutions.append(("%libomptarget-compilexx-run-and-check-generic", "%libomptarget-compilexx-run-and-check-" + libomptarget_target)) config.substitutions.append(("%libomptarget-compile-run-and-check-generic", "%libomptarget-compile-run-and-check-" + libomptarget_target)) @@ -140,18 +140,6 @@ for libomptarget_target in config.libomptarget_all_targets: "%libomptarget-compilexx-" + libomptarget_target)) config.substitutions.append(("%libomptarget-compile-generic", "%libomptarget-compile-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileoptxx-run-and-check-generic", - "%libomptarget-compileoptxx-run-and-check-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileopt-run-and-check-generic", - "%libomptarget-compileopt-run-and-check-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileoptxx-and-run-generic", - "%libomptarget-compileoptxx-and-run-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileopt-and-run-generic", - "%libomptarget-compileopt-and-run-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileoptxx-generic", - "%libomptarget-compileoptxx-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileopt-generic", - "%libomptarget-compileopt-" + libomptarget_target)) config.substitutions.append(("%libomptarget-run-generic", "%libomptarget-run-" + libomptarget_target)) config.substitutions.append(("%libomptarget-run-fail-generic", @@ -186,28 +174,6 @@ for libomptarget_target in config.libomptarget_all_targets: config.substitutions.append(("%libomptarget-compile-" + \ libomptarget_target, \ "%clang-" + libomptarget_target + " %s -o %t")) - config.substitutions.append(("%libomptarget-compileoptxx-run-and-check-" + \ - libomptarget_target, \ - "%libomptarget-compileoptxx-and-run-" + libomptarget_target + \ - " | " + config.libomptarget_filecheck + " %s")) - config.substitutions.append(("%libomptarget-compileopt-run-and-check-" + \ - libomptarget_target, \ - "%libomptarget-compileopt-and-run-" + libomptarget_target + \ - " | " + config.libomptarget_filecheck + " %s")) - config.substitutions.append(("%libomptarget-compileoptxx-and-run-" + \ - libomptarget_target, \ - "%libomptarget-compileoptxx-" + libomptarget_target + " && " + \ - "%libomptarget-run-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileopt-and-run-" + \ - libomptarget_target, \ - "%libomptarget-compileopt-" + libomptarget_target + " && " + \ - "%libomptarget-run-" + libomptarget_target)) - config.substitutions.append(("%libomptarget-compileoptxx-" + \ - libomptarget_target, \ - "%clangxx-" + libomptarget_target + " -O3 %s -o %t")) - config.substitutions.append(("%libomptarget-compileopt-" + \ - libomptarget_target, \ - "%clang-" + libomptarget_target + " -O3 %s -o %t")) config.substitutions.append(("%libomptarget-run-" + \ libomptarget_target, \ "%t")) @@ -241,24 +207,6 @@ for libomptarget_target in config.libomptarget_all_targets: config.substitutions.append(("%libomptarget-compile-" + \ libomptarget_target, \ "echo ignored-command")) - config.substitutions.append(("%libomptarget-compileopt-run-and-check-" + \ - libomptarget_target, \ - "echo ignored-command")) - config.substitutions.append(("%libomptarget-compileoptxx-run-and-check-" + \ - libomptarget_target, \ - "echo ignored-command")) - config.substitutions.append(("%libomptarget-compileopt-and-run-" + \ - libomptarget_target, \ - "echo ignored-command")) - config.substitutions.append(("%libomptarget-compileoptxx-and-run-" + \ - libomptarget_target, \ - "echo ignored-command")) - config.substitutions.append(("%libomptarget-compileoptxx-" + \ - libomptarget_target, \ - "echo ignored-command")) - config.substitutions.append(("%libomptarget-compileopt-" + \ - libomptarget_target, \ - "echo ignored-command")) config.substitutions.append(("%libomptarget-run-" + \ libomptarget_target, \ "echo ignored-command")) diff --git a/openmp/libomptarget/test/offloading/wtime.c b/openmp/libomptarget/test/offloading/wtime.c deleted file mode 100644 index bc2e1f7..0000000 --- a/openmp/libomptarget/test/offloading/wtime.c +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: %libomptarget-compileopt-run-and-check-generic - -// UNSUPPORTED: amdgcn-amd-amdhsa -// UNSUPPORTED: amdgcn-amd-amdhsa-oldDriver -// UNSUPPORTED: amdgcn-amd-amdhsa-LTO - -#include <omp.h> -#include <stdio.h> - -int main(int argc, char *argv[]) { - int data[1024]; -#pragma omp target - { - double start = omp_get_wtime(); - for (int i = 0; i < 1024; ++i) - data[i] = i; - double end = omp_get_wtime(); - double duration = end - start; - printf("duration: %lfs\n", duration); - } - return 0; -} - -// CHECK: duration: [1-9]+ |