conversion from cuda(.cu) to spirv(.spv) with chipshar #755
Replies: 9 comments 1 reply
-
chipStar can be used only for .cu (sources) to a fat binary which includes .spv as the device program format, not for PTX to SPV (at least so far). |
Beta Was this translation helpful? Give feedback.
-
yes,I want to implement the conversion from .cu (sources) to a fat binary which includes .spv, how to achieve it? What is the compile command? |
Beta Was this translation helpful? Give feedback.
-
There is
|
Beta Was this translation helpful? Give feedback.
-
the output foo is a binary or a spirv file? if foo is a binary, how to obtain the corresponding spirv file? |
Beta Was this translation helpful? Give feedback.
-
Binary. To obtain only the device code, use:
|
Beta Was this translation helpful? Give feedback.
-
Thanks |
Beta Was this translation helpful? Give feedback.
-
I mostly learned them by studying Clang’s internal tests plus trial and error. Clang’s documentation may be helpful too. |
Beta Was this translation helpful? Give feedback.
-
Thanks. |
Beta Was this translation helpful? Give feedback.
-
I don't see cuspvc in my docker installation. Is there a replacement or I made an mistake? |
Beta Was this translation helpful? Give feedback.
-
I want to implement the conversion from cuda(.cu) to spirv(.spv) with chipstar.
The following are the conversion methods provided in the documentation:
Compiling CUDA applications directly with chipStar
Compilation of CUDA sources without changing the sources, can be done in two ways: The first way is to replace calls of the nvcc compiler with calls of the wrapper script /bin/cuspv in Makefiles. The wrapper script will call clang with the correct flags. The other way is by using CMake: use and then use . However, the project must be compiled with a Clang version supported by HIP. Note that it's not necessary to have Nvidia's CUDA installed.find_package(HIP REQUIRED CONFIG)target_link_libraries(<YOUR_TARGET> hip::device)
The description in the document is too brief and does not provide specific steps, can you describe in detail how to implement these two methods?
Beta Was this translation helpful? Give feedback.
All reactions