saiislam marked an inline comment as done.
saiislam added inline comments.

================
Comment at: clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp:654
+  unsigned LaneIDBits =
+      CGF.getTarget().getGridValue(llvm::omp::GV_Warp_Size_Log2);
   return Bld.CreateAShr(getNVPTXThreadID(CGF), LaneIDBits, "nvptx_warp_id");
----------------
jdoerfert wrote:
> Why do we keep the enum value with this name then?
Enums in OMPGridValues.h has been named like this because many of the values 
are dependent on a different value in the same enum. For example, hardcoded 
value of number of bits required to represent the max number of threads in a 
warp (LaneIDBits here), is computed as log of WarpSize. Similarly, mask of this 
value (LaneIDMask below) is based on WarpSize. A future change in WarpSize thus 
will require update in all the enums based on (and prefixed as) WarpSize, so 
less chances of a manual error.

See this: 
https://github.com/llvm/llvm-project/blob/8b6821a5843bb321b3738e2519beae7142e62928/llvm/include/llvm/Frontend/OpenMP/OMPGridValues.h#L120


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83492/new/

https://reviews.llvm.org/D83492



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to