[Openmp-commits] [PATCH] D45326: [OpenMP] [CUDA plugin] Add support for teams reduction via scratchpad
George Rokos via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Apr 5 12:26:47 PDT 2018
grokos added a comment.
In https://reviews.llvm.org/D45326#1058740, @ABataev wrote:
> In https://reviews.llvm.org/D45326#1058730, @grokos wrote:
> > One caveat regarding Alexey's proposal: According to the CUDA programming guide <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#dynamic-global-memory-allocation-and-operations>, `malloc` on the device allocates space from a fixed-size heap. The default size of this heap is 8MB. If we run into a scenario where more than 8MB will be required for the reduction scratchpad, allocating the scratchpad from the device will fail. The heap size can be user-defined from the host, but for that to happen the host must know how large the scratchpad needs to be, which defeats the purpose of moving scratchpad allocation from the plugin to the nvptx runtime.
> But you can change the limit using `cudaThreadSetLimit`
That's what I'm saying. You can increase the limit, but how large will you set it? How will you know how many bytes are needed for the scratchpad if the compiler doesn't provide this information?
More information about the Openmp-commits