[Openmp-commits] [PATCH] D45326: [OpenMP] [CUDA plugin] Add support for teams reduction via scratchpad

Alexey Bataev via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 5 09:09:40 PDT 2018


ABataev added inline comments.


================
Comment at: libomptarget/plugins/cuda/src/rtl.cpp:75-76
+  int8_t ExecutionMode;
+  int32_t NumReductionVars;
+  int32_t ReductionVarsSize;
+
----------------
Why do you need all that data before starting the outlined function? Can we allocate the memory during execution of the outlined function by some runtime function call?
Like this:
```
__omp_offloading....
<master>
%Scratchpad = call i8 *__kmpc_allocate_scratchpad(<Size_of_the_reductions>);
....
__kmpc_deallocate_scratchpad(i8 *%Scratchpad);
<end_master>
```



Repository:
  rOMP OpenMP

https://reviews.llvm.org/D45326





More information about the Openmp-commits mailing list