Git Product home page Git Product logo

Comments (2)

sheredom avatar sheredom commented on April 28, 2024

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.

alan-baker avatar alan-baker commented on April 28, 2024

Closing in favour of the https://github.com/google/clspv/milestone/1 milestone.

from clspv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.