[PATCH] D14254: [OpenMP] Initial implementation of OpenMP offloading library - libomptarget device RTLs.

George Rokos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 11:29:00 PST 2018


grokos updated this revision to Diff 131110.
grokos marked 10 inline comments as done.
grokos added a comment.

Made corrections according to the feedback I got. Regarding the general comments:

1. I found only one more instance of `threadID & (WARPSIZE-1)` and replaced it with `threadID % WARPSIZE`. There are a few more bitwise operations in the code of the form `threadID & ~(WARPSIZE-1)` (note the bitwise NOT) which do something else - they round `threadID` down to the nearest multiple of `WARPSIZE`. Doing this with arithmetic operators would require something like `threadID - threadID%WARPSIZE` which I doubt the compiler could optimize (not to mention that the bitwise version is actually more easily recognizable as a round-to-a-multiple-of-2^x operation than the arithmetic version).
2. I replaced all references to the built-in `warpSize` with the macro `WARPSIZE`. `warpSize` would have the advantage that it makes the code forward-compatible (if the warp size ever changes, the change will be reflected on this variable); however, it is not a compile-time constant and that would prevent the compiler from making certain optimizations (especially since the warp size is used in modulo operations for which we have assumed that the compiler can transform the modulo operation into bitwise operations). `DS_Max_Worker_Warp_Size` was also replaced with `WARPSIZE`.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D14254

Files:
  README.rst
  libomptarget/CMakeLists.txt
  libomptarget/deviceRTLs/CMakeLists.txt
  libomptarget/deviceRTLs/nvptx/CMakeLists.txt
  libomptarget/deviceRTLs/nvptx/docs/ReductionDesign.txt
  libomptarget/deviceRTLs/nvptx/src/cancel.cu
  libomptarget/deviceRTLs/nvptx/src/counter_group.h
  libomptarget/deviceRTLs/nvptx/src/counter_groupi.h
  libomptarget/deviceRTLs/nvptx/src/critical.cu
  libomptarget/deviceRTLs/nvptx/src/data_sharing.cu
  libomptarget/deviceRTLs/nvptx/src/debug.h
  libomptarget/deviceRTLs/nvptx/src/interface.h
  libomptarget/deviceRTLs/nvptx/src/libcall.cu
  libomptarget/deviceRTLs/nvptx/src/loop.cu
  libomptarget/deviceRTLs/nvptx/src/omp_data.cu
  libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
  libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.h
  libomptarget/deviceRTLs/nvptx/src/omptarget-nvptxi.h
  libomptarget/deviceRTLs/nvptx/src/option.h
  libomptarget/deviceRTLs/nvptx/src/parallel.cu
  libomptarget/deviceRTLs/nvptx/src/reduction.cu
  libomptarget/deviceRTLs/nvptx/src/state-queue.h
  libomptarget/deviceRTLs/nvptx/src/state-queuei.h
  libomptarget/deviceRTLs/nvptx/src/support.h
  libomptarget/deviceRTLs/nvptx/src/supporti.h
  libomptarget/deviceRTLs/nvptx/src/sync.cu
  libomptarget/deviceRTLs/nvptx/src/task.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14254.131110.patch
Type: text/x-patch
Size: 242190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180123/32a0e338/attachment-0001.bin>


More information about the llvm-commits mailing list