[flang-commits] [PATCH] D150161: [flang] CUDA Fortran - part 2/5: symbols & scopes

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue May 9 14:37:37 PDT 2023


klausler added inline comments.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:3526
+    Say(currStmtSource().value(),
+        "Operands of LAUNCH_BOUNDS() must be two integer constants"_err_en_US);
+  } else if (auto *subp{currScope().symbol()
----------------
wangzpgi wrote:
> Can launch_bounds take third argument of max cluster rank for Hopper?
Not according to https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html#cfref-new-subs-func-attr which has "The form used in CUDA Fortran is:

attributes(global) launch_bounds(maxTPB, minBPM) subroutine sub(...)

where maxTPB is the maxThreadsPerBlock, the maximum number of threads per block with which the application will ever launch, and minBPM is the desired minimum number of resident blocks per multiprocessor. Both values must be numeric constants."  in 3.1.2.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:3551
+    Say(currStmtSource().value(),
+        "Operands of CLUSTER_DIMS() must be three integer constants"_err_en_US);
+  } else if (auto *subp{currScope().symbol()
----------------
wangzpgi wrote:
> Can cluster_dim take variable argument such as "cluster_dim(x,y,z)", where x, y, and z are integer variables?
No, not according to https://docs.nvidia.com/hpc-sdk/compilers/cuda-fortran-prog-guide/index.html#cfref-new-subs-func-attr , which has "Beginning with the 23.3 release, support for thread block clusters is enabled for Hopper (cc90) and later targets. To specify the dimensions of the cluster, use the cluster_dims syntax and specify each x, y, and z dimension. Values must be numeric constants." in 3.1.3.


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

https://reviews.llvm.org/D150161



More information about the flang-commits mailing list