Comments (5)
Is there a reason not to use clvk?
If you want to continue with your own vulkan code to iteract with code generated by clspv
, I would advise to start by parsing the non semantic reflections that are inside the SPIR-V code.
When you disassemble z_generated.cl.spv
with spirv-dis
, you will find that information at the end (note that you can get that information using spirv-tools without having to disassemble):
%176 = OpExtInst %void %172 Kernel %22 %173 %uint_6 %uint_0 %174
%177 = OpExtInst %void %172 PropertyRequiredWorkgroupSize %176 %uint_1 %uint_1 %uint_1
%179 = OpExtInst %void %172 ArgumentInfo %178
%180 = OpExtInst %void %172 ArgumentStorageBuffer %176 %uint_1 %uint_0 %uint_0 %179
%183 = OpExtInst %void %172 Kernel %37 %181 %uint_6 %uint_0 %182
%184 = OpExtInst %void %172 PropertyRequiredWorkgroupSize %183 %uint_256 %uint_1 %uint_1
%186 = OpExtInst %void %172 ArgumentInfo %185
%187 = OpExtInst %void %172 ArgumentStorageBuffer %183 %uint_0 %uint_0 %uint_1 %186
%189 = OpExtInst %void %172 ArgumentInfo %188
%190 = OpExtInst %void %172 ArgumentStorageBuffer %183 %uint_1 %uint_0 %uint_0 %189
%192 = OpExtInst %void %172 ArgumentInfo %191
%193 = OpExtInst %void %172 ArgumentPodPushConstant %183 %uint_2 %uint_0 %uint_4 %192
%195 = OpExtInst %void %172 ArgumentInfo %194
%197 = OpExtInst %void %172 ArgumentPodPushConstant %183 %uint_3 %uint_4 %uint_4 %195
%199 = OpExtInst %void %172 ArgumentInfo %198
%200 = OpExtInst %void %172 ArgumentPodPushConstant %183 %uint_4 %uint_8 %uint_4 %199
%202 = OpExtInst %void %172 ArgumentInfo %201
%205 = OpExtInst %void %172 ArgumentPodPushConstant %183 %uint_5 %uint_12 %uint_4 %202
from clspv.
Unfortunately yes, i need Vulkan itself. In general i need graphics features like ray tracing, dynamic descriptor indexing, BC compression and other. Therefore some kernels are unfortunately must be created with GLSL and bind with Vulkan directly. So, what basically i want from clspv is to have some kernels in OpenCL C and others in GLSL anyway.
Thank you very much for the advice. Could you please clarify what I need to pay attention to this disasm? I'm not very familiar with SPIR-V understanding )
from clspv.
You can find more information about each OpExtInst
in the spirv-headers.
Basically, for the ArgumentPodPushConstant
you want to make sure that you are using the correct offset. And for the ArgumentStorageBuffer
you want to make sure you are using the same descriptorset
and binding
.
from clspv.
if you look at those 2 lines:
%187 = OpExtInst %void %172 ArgumentStorageBuffer %183 %uint_0 %uint_0 %uint_1 %186
%190 = OpExtInst %void %172 ArgumentStorageBuffer %183 %uint_1 %uint_0 %uint_0 %189
<spirv-id> = OpExtInst %void %172 ArgumentStorageBuffer <decl_id> <ordinal> <ds> <binding> <arginfo>
You can see that the first argument of the kernel (ordinal 0) is set to the descriptorset 0 with binding 1, while the second arg (ordinal 1) is set to descriptor 0 with binding 0.
It can feel weird to have exchanged those 2, I don't know why clspv did that, there might be multiple reasons. But in the end, you need to stick to that mapping.
from clspv.
Thank you very much, understood!
from clspv.
Related Issues (20)
- SimplifyPointerBitcast performs wrong simplification HOT 1
- math functions issue since instcombine transform "and" pattern to call to fabs HOT 1
- Invalid word count when emitting OpConstant HOT 3
- Segmentation fault HOT 1
- OpAtomicUMax may have the wrong pointer type after cast + offset HOT 1
- Temporary Bugfix: SimplifyPointerBitcastPass emits faulty IR that loses OpLoads of 16 bit fields HOT 2
- ReplacePointerBitcastPass introduces invalid IR with struct field of a struct HOT 3
- migrate from deprecated Type::isOpaquePointerTy() to Type::isPointerTy() HOT 1
- Ternary operator on AMD vk drivers. HOT 3
- Segmentation fault with conditional pointer assignment from different address spaces HOT 4
- Canonicalization of GEPs to i8 HOT 10
- Constant initialized global variable rewrites produce invalid IR
- Handle LLVM intrinsic llvm.is_fpclass
- Loads of i32s are fragmented into 4 bytes HOT 3
- how can I cross compile clspv in x86 for risc-v HOT 1
- Loads and Stores of i32s from offset addresses are fragmented HOT 1
- Loads and Stores from offset addresses are fragmented HOT 5
- Implement compatibility for external LLVM-IL HOT 15
- Clspv Fragments access to global memory by the Smallest access size
- Improve `-cl-mad-enable` support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clspv.