circle icon indicating copy to clipboard operation
circle copied to clipboard

Consider adding a "cu" option to the -x language flag

Open jaredhoberock opened this issue 4 years ago • 9 comments

nvcc recognizes cu as an option for the -x command line language flag to indicate that the source file should be treated as CUDA code. It would be helpful if circle recognized this option as well to aid in porting old code bases.

jaredhoberock avatar Sep 27 '21 20:09 jaredhoberock

Do you know of a guide for finding the most recent cuda toolkit on the system? that would allow me to bypass the --cuda-path and just specify a .cu or -x cu.

seanbaxter avatar Sep 28 '21 03:09 seanbaxter

Do you know of a guide for finding the most recent cuda toolkit on the system?

which nvcc?

Also this advice from Robert.

Does the --cuda-path option put circle in CUDA C++ mode?

jaredhoberock avatar Sep 28 '21 03:09 jaredhoberock

That advice is impractical to do something at compiler startup. I just timed it and it was 6 seconds.

Ya, --cuda-path puts it into CUDA mode. Same as clang.

seanbaxter avatar Sep 28 '21 03:09 seanbaxter

If nvidia shipped circle with the toolkit then you wouldn't need that option!

seanbaxter avatar Sep 28 '21 03:09 seanbaxter

If it were me, I'd default to checking /usr/local/cuda/bin and then failing that, try which nvcc. Can always improve the search later when someone reports a weird case.

jaredhoberock avatar Sep 28 '21 03:09 jaredhoberock

Also, I remembered this: https://github.com/jaredhoberock/nvcc-scons/blob/master/nvcc.py#L47

jaredhoberock avatar Sep 28 '21 03:09 jaredhoberock

If it were me, I'd default to checking /usr/local/cuda/bin and then failing that, try which nvcc. Can always improve the search later when someone reports a weird case.

On my system it's /opt/local/hpc_sdk/Linux_x86_64/21.3/cuda/. It's in a different spot if you get it from the "HPC" SDK than in the older CUDA Toolkit. I have no idea why there are two separate distributions with what looks like 100% the same content.

seanbaxter avatar Sep 28 '21 03:09 seanbaxter

Is CUDA_BIN_PATH defined in your environment?

Nevermind, that's something I manually defined at one point

jaredhoberock avatar Sep 28 '21 04:09 jaredhoberock

An environment variable isn't a bad idea. Could just check for CUDA_PATH if the extension is .cu or -x cu, and if the env variable isn't defined, then prompt for --cuda-path.

seanbaxter avatar Sep 28 '21 04:09 seanbaxter