0

I have some questions related to OpenMP offloading in clang.

1.When clang offloads a certain code segment to a NVIDIA GPU how the data will be mapped to the GPU?

2.How it will decide which data to be mapped to the "shared memory" region in NVIDIA GPU?

3.Will the constants in the code segment be mapped to the constant memory in GPU?

I tried to find answers for these question but i couldn't find any reference. Thanks in advance.

Pasindu
  • 81
  • 8

1 Answers1

0
  1. Too general question, please clarify it.
  2. clang-ykt tries to use shared memory at first, when the compiler see that the preallocated buffer is completely used, it uses the global memory. Clang trunk currently uses only the global memory.
  3. No
Alexey Bataev
  • 428
  • 3
  • 11
  • Thank you @Alexey for the clarification. Sorry for the general question. What I really want to know is when the `#pragma omp target data map(to:A[0:size*size]) map(to:B[0:size*size]) map(tofrom:EA[0:size*size])` is used, will all these data (A ,B and EA arrays) be mapped only to the global memory? – Pasindu Jun 22 '18 at 15:46
  • Yes, all mapped variables are mapped in the global memory – Alexey Bataev Jun 26 '18 at 14:21