[flang-commits] [PATCH] D150161: [flang] CUDA Fortran - part 2/5: symbols & scopes
Zhen Wang via Phabricator via flang-commits
flang-commits at lists.llvm.org
Fri May 12 09:29:16 PDT 2023
wangzpgi added inline comments.
================
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()
----------------
klausler wrote:
> wangzpgi wrote:
> > klausler wrote:
> > > wangzpgi wrote:
> > > > klausler wrote:
> > > > > 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.
> > > > It mentioned at the end of 3.1.2: "Also, as part of the Hopper support, the launch_bounds syntax has been extended to accept a third argument, an upper bound on the cluster size."
> > > That's for LAUNCH_BOUNDS(), not CLUSTER_DIMS().
> > Yes, allowing third argument was for launch_bounds, not cluster_dims, I commented at the wrong place. Not quite sure how this Phabricator review works.
> >
> > For cluster_dims as well as launch_bounds, Brent has requested to take maybe const expressions. He would like to use module parameters, for global routines that are in that module. Neither Michael nor I implemented that in nvfortran.
> That's what I implemented -- any expression that can be folded to a constant value at compilation time will work. They don't have to integer literals.
Great. Thanks.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150161/new/
https://reviews.llvm.org/D150161
More information about the flang-commits
mailing list