Summary: This patch changes the libomptarget runtime to always emit debug messages that occur before offloading failure. The goal is to provide users with information about why their application failed in the target region rather than a single failure message. This is only done in regions that precede offloading failure so this should not impact runtime performance. if the debug environment variable is set then the message is forwarded to the debug output as usual. A new environment variable was added for future use but does nothing in this current patch. LIBOMPTARGET_INFO will be used to report runtime information to the user if requrested, such as grid size, SPMD usage, or data mapping. It will take an integer indicating the level of information verbosity and a value of 0 will disable it. Reviewers: jdoerfort Subscribers: guansong sstefan1 yaxunl ye-luo Tags: #OpenMP Differential Revision: https://reviews.llvm.org/D86483
32 lines
1.3 KiB
C
32 lines
1.3 KiB
C
// RUN: %libomptarget-compile-aarch64-unknown-linux-gnu
|
|
// RUN: %libomptarget-run-fail-aarch64-unknown-linux-gnu 2>&1 \
|
|
// RUN: | %fcheck-aarch64-unknown-linux-gnu
|
|
|
|
// RUN: %libomptarget-compile-powerpc64-ibm-linux-gnu
|
|
// RUN: %libomptarget-run-fail-powerpc64-ibm-linux-gnu 2>&1 \
|
|
// RUN: | %fcheck-powerpc64-ibm-linux-gnu
|
|
|
|
// RUN: %libomptarget-compile-powerpc64le-ibm-linux-gnu
|
|
// RUN: %libomptarget-run-fail-powerpc64le-ibm-linux-gnu 2>&1 \
|
|
// RUN: | %fcheck-powerpc64le-ibm-linux-gnu
|
|
|
|
// RUN: %libomptarget-compile-x86_64-pc-linux-gnu
|
|
// RUN: %libomptarget-run-fail-x86_64-pc-linux-gnu 2>&1 \
|
|
// RUN: | %fcheck-x86_64-pc-linux-gnu
|
|
|
|
// RUN: %libomptarget-compile-nvptx64-nvidia-cuda
|
|
// RUN: %libomptarget-run-fail-nvptx64-nvidia-cuda 2>&1 \
|
|
// RUN: | %fcheck-nvptx64-nvidia-cuda
|
|
|
|
// CHECK: Libomptarget message: explicit extension not allowed: host address specified is 0x{{.*}} (8 bytes), but device allocation maps to host at 0x{{.*}} (8 bytes)
|
|
// CHECK: Libomptarget error: Call to getOrAllocTgtPtr returned null pointer (device failure or illegal mapping).
|
|
// CHECK: Libomptarget fatal error 1: failure of target construct while offloading is mandatory
|
|
|
|
int main() {
|
|
int arr[4] = {0, 1, 2, 3};
|
|
#pragma omp target data map(alloc: arr[0:2])
|
|
#pragma omp target data map(alloc: arr[1:2])
|
|
;
|
|
return 0;
|
|
}
|