[Openmp-commits] [PATCH] D71580: [libomptarget][nfc] Wrap cuda min() in target_impl

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Dec 16 16:44:21 PST 2019


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

LGTM. I proposed an alternative spelling for the one special case but I don't care much which you choose.



================
Comment at: openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu:483
   // Check if this is the very last team.
-  unsigned NumRecs = min(NumTeams, num_of_records);
+  unsigned NumRecs = __kmpc_impl_min<uint32_t>(NumTeams, num_of_records);
   if (ChunkTeamCount == NumTeams - Bound - 1) {
----------------
JonChesterfield wrote:
> Here, NumTeams is a uint32_t and num_of_records is an int32_t. I quite like the `<>` sigil calling attention to this, but am open to alternatives.
This is fine, `__kmpc_impl_min(NumTeams, uint32_t(num_of_records));` would be an alternative to make clear what is casted.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71580





More information about the Openmp-commits mailing list