[Openmp-commits] [openmp] [OpenMP] Support 'omp_get_num_procs' on the device (PR #65501)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 6 11:20:22 PDT 2023


================
@@ -373,16 +374,21 @@ struct CUDADeviceTy : public GenericDeviceTy {
     return Plugin::check(Res, "Error in cuCtxSetCurrent: %s");
   }
 
+  /// NVIDIA returns the product of the SM count and the number of warps that
+  /// fit if the maximum number of threads were scheduled on each SM.
+  uint64_t getHardwareParallelism() const override {
+    return HardwareParallelism;
----------------
jhuber6 wrote:

This is borrowing it from a previous patch that was added for the RPC support. It's currently set at line 309.

https://github.com/llvm/llvm-project/pull/65501


More information about the Openmp-commits mailing list