Comments (3)
well with master the generated spirv looks like this:
; SPIR-V
; Version: 1.0
; Generator: Khronos LLVM/SPIR-V Translator; 14
; Bound: 18
; Schema: 0
OpCapability Addresses
OpCapability Kernel
OpCapability Int64
%1 = OpExtInstImport "OpenCL.std"
OpMemoryModel Physical64 OpenCL
OpEntryPoint Kernel %8 "test_fn"
OpSource OpenCL_C 200000
OpName %res "res"
OpName %v "v"
OpName %entry "entry"
OpName %arrayidx "arrayidx"
OpDecorate %17 FuncParamAttr NoCapture
%17 = OpDecorationGroup
OpGroupDecorate %17 %res %v
%uint = OpTypeInt 32 0
%ulong = OpTypeInt 64 0
%ulong_0 = OpConstant %ulong 0
%ulong_1 = OpConstant %ulong 1
%void = OpTypeVoid
%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
%v2uint = OpTypeVector %uint 2
%_ptr_CrossWorkgroup_v2uint = OpTypePointer CrossWorkgroup %v2uint
%7 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_v2uint
%8 = OpFunction %void None %7
%res = OpFunctionParameter %_ptr_CrossWorkgroup_uint
%v = OpFunctionParameter %_ptr_CrossWorkgroup_v2uint
%entry = OpLabel
%arrayidx = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %v %ulong_0 %ulong_1
%16 = OpLoad %uint %arrayidx Aligned 4
OpStore %res %16 Aligned 4
OpReturn
OpFunctionEnd
same issue still though
from spirv-llvm-translator.
hmm, I may be thinking about this a bit incorrectly.. Possibly:
%15 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %10 %uint_0 %uint_1
is correct.. it seems a bit funny to think about accessing the (for ex) 15'th element of a vec2 (ie. if you had ((__global int *)v)[15]
) but I guess the math should work out.
from spirv-llvm-translator.
@robclark yeah, I think our mistake was, that OpInBoundsPtrAccessChain isn't derefing anything, it simply does some pointer maths + casts to pointer to member type.
so the Base use used to do array indexing for example, because the pointer type stays the same and then you index and just add the offset to your last pointer value.
from spirv-llvm-translator.
Related Issues (20)
- Is there no 18.0.0 HOT 2
- Missing SPIR-V 1.4 features/changes HOT 3
- llvm-as does not verify LLVM output from SPIR-V to LLVM translation (Overlapping tbaa.struct regions) HOT 2
- Indicies in SpecConstantOp PtrAccessChain of global variales are not adjusted for their actual type.
- Both GetElementPtrConstantExpr and GetElementPtrInst may represent access to a buildin variable HOT 1
- `ID '19' decorated with NoSignedWrap multiple times is not allowed.` HOT 1
- Translator incapable to generate TypeStruct EntryPoint parameters
- User defined/declared functions are wrongly identified as OpenCL builtins HOT 1
- Invalid OpenCL version and non-cpp source language lead to crash while generating device-dependent OpenCL binaries from a valid SPIR-V input HOT 9
- InvalidInstruction: Can't translate llvm instruction with LLVM 18 (working with 17) HOT 8
- spt file containing GlobalVariableHostAccessINTEL changes after -to-binary and then -to-text
- Drop llvm.compiler.used GV? HOT 1
- Add SPIR-V backend - SPIR-V Translator cross validation HOT 4
- SPV_EXT_relaxed_printf_string_address_space allows format from too many address spaces
- How to build LLVMSPIRVLib as a shared library on Windows? HOT 2
- Image validation in unit test
- Two days tyring to figure this out. HOT 2
- Ability to use system version of SPIRV-Headers without specifying source directory.
- Missing dimidx checks when translating get_global_offset HOT 2
- InvalidFunctionCall: Unexpected llvm intrinsic: `llvm.fabs.bf16` HOT 2
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 spirv-llvm-translator.