brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 3d70fb7 Raw
34 lines · c
1// clang-format off2// RUN: %libomptarget-compileopt-generic3// RUN: %not --crash env -u LLVM_DISABLE_SYMBOLIZATION OFFLOAD_TRACK_ALLOCATION_TRACES=1 %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK4// clang-format on5 6// FIXME: https://github.com/llvm/llvm-project/issues/1612657// UNSUPPORTED: nvidiagpu8//9// REQUIRES: gpu10 11// If offload memory pooling is enabled for a large allocation, reuse error is12// not detected. UNSUPPORTED: large_allocation_memory_pool13 14#include <omp.h>15 16int main() {17  int N = (1 << 30);18  char *A = (char *)malloc(N);19  char *P;20#pragma omp target map(A[ : N]) map(from : P)21  {22    P = &A[N / 2];23    *P = 3;24  }25  // clang-format off26// CHECK: OFFLOAD ERROR: memory access fault by GPU {{.*}} (agent 0x{{.*}}) at virtual address [[PTR:0x[0-9a-z]*]]. Reasons: {{.*}}27// CHECK: Device pointer [[PTR]] points into prior host-issued allocation:28// CHECK: Last deallocation:29// CHECK: Last allocation of size 107374182430// clang-format on31#pragma omp target32  { *P = 5; }33}34