Skip to content

numthreads(X,Y,Z) does not support static const constants. #4032

Closed

Description

Attribute [numthreads(X,Y,Z)] does not support static const constant that can be deduced in compile time.

Also SPIRV generation of specialized constants as X, Y, Z, is not supported.

Compiler emits error message and rejects input.

Activity

  1. shangjiaxuan commented on Oct 23, 2021

    @shangjiaxuan
    Author

    Shaders capable of [numthreads(1,1,1)] (no data sharing between threads) may benefit from runtime decision of number of jobs in workgroup (tune concurency), with typical case where X*dispatchX>=totalX, and totalX is fixed.

  2. pow2clk commented on Nov 8, 2021

    @pow2clk
    Collaborator

    Hi shangjiaxuan (@shangjiaxuan)!

    This has been reported before in #2191. We will continue to work the issue from there, but it would be considered a new language feature.

    In the meantime, you can use a #define constant to get similar named behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions