You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realize the conversion from cuda file to spv file.
I first use LLVM to generate the .bc file corresponding to cuda file, and then use llvm-spirv to convert the .bc file into the .spv file.
get an error:
InvalidTargetTriple: Expects spir-unknown-unknown or spir64-unknown-unknown. Actual target triple is x86_64-pc-linux-gnu
how to solve it?
The text was updated successfully, but these errors were encountered:
Per https://github.com/KhronosGroup/SPIRV-LLVM-Translator/blob/main/docs/SPIRVRepresentationInLLVM.rst#target-triple-and-datalayout-string triple must be spir. I'm not sure if clang has support to compile cuda to spir target. I can only suggest a non-official workaround, which is definitely must not be used in a product code, but might help with the research: modify triple manually and try to translate. It's not guarantied it would work out of the box, as per triple rules clang would restrict supported types, vector sizes, add address space generation rules etc which are mandatory for SPIR environment and that the translator expects, but it still might work.
TBH I would try out SPIR-V Backend, which is a part of LLVM project, you can just feed .bc to llc targeting SPIR-V and see how it goes. While it's a work in progress project, it should be more promising for your flow.
I realize the conversion from cuda file to spv file.
I first use LLVM to generate the .bc file corresponding to cuda file, and then use llvm-spirv to convert the .bc file into the .spv file.
get an error:
InvalidTargetTriple: Expects spir-unknown-unknown or spir64-unknown-unknown. Actual target triple is x86_64-pc-linux-gnu
how to solve it?
The text was updated successfully, but these errors were encountered: