[libc-commits] [PATCH] D148810: [libc] Add more utility functions for the GPU

Artem Belevich via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 24 10:42:33 PDT 2023


tra added inline comments.


================
Comment at: libc/src/__support/GPU/nvptx/utils.h:77
+/// Returns the absolute id of the thread in the current CUDA block.
+LIBC_INLINE uint32_t get_thread_id() {
+  return get_thread_id_x() + get_num_threads_x() * get_thread_id_y() +
----------------
32 bits are not sufficient to represent all threads, as block dimensions alone can take up to 63 bits. (31 bits for x, 16 for y,z).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148810



More information about the libc-commits mailing list