Comments (2)
Hey @oscarbg:
VK_KHR_16bit_storage is also required in addition to shaderInt16 for kernels with int16 arguments?
We don't need VK_KHR_16bit_storage
as long as shaderInt16
is supported.
can shaderInt16 restriction be avoided by requiring only VK_KHR_16bit_storage for kernels with int16 variables/arguments by "treating it" internally as int32 for operations using it but storing as 16bits using VK_KHR_16bit_storage?
In theory this could work - but it fails on something important that we see in a lot of OpenCL C kernels. A ton of OpenCL C kernels use pointer bitcasts to reinterpret a buffer as another type - something which fundamentally Vulkan SPIR-V does not support. To work around this a huge amount of the effort in this porting effort was in transforming any pointer bitcasts we see in the code into a load/store and a value bitcast instead.
If we could not use the shaderInt16
capability we would be unable to transform code like:
global int* a;
short b = ((global short*)a)[10];
So yes - the compiler could be made to work without the shaderInt16
capability, but we'd be unable to support some of the usecases we have for this code.
from clspv.
Closing in favour of the https://github.com/google/clspv/milestone/1 milestone.
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.