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
Why use the target instead of the existing SPIR-V/LLVM translator? Because when you use the latter, there is no target that exists in LLVM to support it. You can hack around this, but it breaks all sorts of code paths that Terra normally assumes to work. @lizdulac heroically put effort into this in #469 but I've never been entirely comfortable merging it because it rips up a bunch of Terra's target code.
In order to get LLVM to actually build the SPIR-V backend (as of LLVM 15), you need to build with -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV. Otherwise the Clang flag above doesn't work. (I found in my local build that I also needed -DLLVM_ENABLE_DUMP=ON, but this was not the case in the corresponding CI build, so I'm not sure if this is fundamental or not.)
Next step is to test the Clang support and check (after rebuilding LLVM) whether I can access the target from Terra. I'm optimistic, given my experience with the AMDGPU target, that this should mostly just work (at least on our end). Of course I have no idea what the quality of the backend itself is right now.
The text was updated successfully, but these errors were encountered:
This is a tracking / note taking issue for ongoing work on support for SPIR-V.
An experimental SPIR-V target landed in LLVM 15. Rather unhelpfully documented at: https://llvm.org/docs/SPIRVUsage.html
Why use the target instead of the existing SPIR-V/LLVM translator? Because when you use the latter, there is no target that exists in LLVM to support it. You can hack around this, but it breaks all sorts of code paths that Terra normally assumes to work. @lizdulac heroically put effort into this in #469 but I've never been entirely comfortable merging it because it rips up a bunch of Terra's target code.
Clang supports the new target via a flag: https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#spir-v-support-in-clang
In order to get LLVM to actually build the SPIR-V backend (as of LLVM 15), you need to build with
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=SPIRV
. Otherwise the Clang flag above doesn't work. (I found in my local build that I also needed-DLLVM_ENABLE_DUMP=ON
, but this was not the case in the corresponding CI build, so I'm not sure if this is fundamental or not.)Next step is to test the Clang support and check (after rebuilding LLVM) whether I can access the target from Terra. I'm optimistic, given my experience with the AMDGPU target, that this should mostly just work (at least on our end). Of course I have no idea what the quality of the backend itself is right now.
The text was updated successfully, but these errors were encountered: