yaksa icon indicating copy to clipboard operation
yaksa copied to clipboard

feature: Support building CUDA backend kernels with `clang++`

Open raffenet opened this issue 10 months ago • 2 comments

A user reported being unable to build MPICH using clang++ as the CUDA compiler used to build Yaksa pmodels/mpich#6954. Noting down the issues encountered trying to build like this:

  1. NVCC_FLAGS is ignored when supplying an alternative NVCC in the configuration environment. Addressed in #250.
  2. CUDA_SM code generation flags from configure are not compatible with clang++. Need to use the right flags based on the compiler used.
  3. Building .cu files with clang/clang++ puts the compiler in C++ mode. CUDA kernels with the C _Bool type cannot be compiled since that type is not in C++. C++ has a bool type, but it is not guaranteed to be compatible, so we need some special handling to do the right thing.
  4. clang++ warns that the -Xcompiler option used by cudalt.sh is unrecognized. We should omit it when using clang++.

raffenet avatar Apr 03 '24 15:04 raffenet

Does clang work or does it have to be clang++?

We should standardize it between MPL and yaksa, maybe as a Autoconf macro in a .m4 file. We can manually copy to yaksa for now.

hzhou avatar Apr 03 '24 17:04 hzhou

Does clang work or does it have to be clang++?

We should standardize it between MPL and yaksa, maybe as a Autoconf macro in a .m4 file. We can manually copy to yaksa for now.

I tried NVCC=clang and it produced the same error about _Bool not defined.

raffenet avatar Apr 03 '24 17:04 raffenet