CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
125 lines
4.7 KiB
HLSL
125 lines
4.7 KiB
HLSL
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-mesh -x hlsl -ast-dump -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-amplification -x hlsl -ast-dump -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-pixel -x hlsl -ast-dump -o - %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-vertex -x hlsl -ast-dump -o - %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-hull -x hlsl -ast-dump -o - %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-domain -x hlsl -ast-dump -o - %s -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o - %s -DFAIL -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel5.0-compute -x hlsl -ast-dump -o - %s -DFAIL -verify
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel4.0-compute -x hlsl -ast-dump -o - %s -DFAIL -verify
|
|
|
|
// RUN: %clang_cc1 -triple spirv-pc-vulkan1.3-compute -x hlsl -ast-dump -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV
|
|
|
|
#if __SHADER_TARGET_STAGE == __SHADER_STAGE_COMPUTE || __SHADER_TARGET_STAGE == __SHADER_STAGE_MESH || __SHADER_TARGET_STAGE == __SHADER_STAGE_AMPLIFICATION || __SHADER_TARGET_STAGE == __SHADER_STAGE_LIBRARY
|
|
#ifdef FAIL
|
|
|
|
// expected-warning@+1 {{'numthreads' attribute only applies to global functions}}
|
|
[numthreads(1,1,1)]
|
|
struct Fido {
|
|
// expected-warning@+1 {{'numthreads' attribute only applies to global functions}}
|
|
[numthreads(1,1,1)]
|
|
void wag() {}
|
|
|
|
// expected-warning@+1 {{'numthreads' attribute only applies to global functions}}
|
|
[numthreads(1,1,1)]
|
|
static void oops() {}
|
|
};
|
|
|
|
// expected-warning@+1 {{'numthreads' attribute only applies to global functions}}
|
|
[numthreads(1,1,1)]
|
|
static void oops() {}
|
|
|
|
namespace spec {
|
|
// expected-warning@+1 {{'numthreads' attribute only applies to global functions}}
|
|
[numthreads(1,1,1)]
|
|
static void oops() {}
|
|
}
|
|
|
|
// expected-error@+1 {{'numthreads' attribute parameters do not match the previous declaration}}
|
|
[numthreads(1,1,1)]
|
|
// expected-note@+1 {{conflicting attribute is here}}
|
|
[numthreads(2,2,1)]
|
|
int doubledUp() {
|
|
return 1;
|
|
}
|
|
|
|
// expected-note@+1 {{conflicting attribute is here}}
|
|
[numthreads(1,1,1)]
|
|
int forwardDecl();
|
|
|
|
// expected-error@+1 {{'numthreads' attribute parameters do not match the previous declaration}}
|
|
[numthreads(2,2,1)]
|
|
int forwardDecl() {
|
|
return 1;
|
|
}
|
|
|
|
#if __SHADER_TARGET_MAJOR == 6
|
|
// expected-error@+1 {{'numthreads' attribute requires exactly 3 arguments}}
|
|
[numthreads]
|
|
// expected-error@+1 {{'numthreads' attribute requires exactly 3 arguments}}
|
|
[numthreads()]
|
|
// expected-error@+1 {{'numthreads' attribute requires exactly 3 arguments}}
|
|
[numthreads(1,2,3,4)]
|
|
// expected-error@+1 {{'numthreads' attribute requires an integer constant}}
|
|
[numthreads("1",2,3)]
|
|
// expected-error@+1 {{argument 'X' to numthreads attribute cannot exceed 1024}}
|
|
[numthreads(-1,2,3)]
|
|
// expected-error@+1 {{argument 'Y' to numthreads attribute cannot exceed 1024}}
|
|
[numthreads(1,-2,3)]
|
|
// expected-error@+1 {{argument 'Z' to numthreads attribute cannot exceed 1024}}
|
|
[numthreads(1,2,-3)]
|
|
// expected-error@+1 {{total number of threads cannot exceed 1024}}
|
|
[numthreads(1024,1024,1024)]
|
|
#elif __SHADER_TARGET_MAJOR == 5
|
|
// expected-error@+1 {{argument 'Z' to numthreads attribute cannot exceed 64}}
|
|
[numthreads(1,2,68)]
|
|
#else
|
|
// expected-error@+1 {{argument 'Z' to numthreads attribute cannot exceed 1}}
|
|
[numthreads(1,2,2)]
|
|
// expected-error@+1 {{total number of threads cannot exceed 768}}
|
|
[numthreads(1024,1,1)]
|
|
#endif // __SHADER_TARGET_MAJOR
|
|
#endif // FAIL
|
|
// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 1 2 1
|
|
[numthreads(1,2,1)]
|
|
int entry() {
|
|
return 1;
|
|
}
|
|
|
|
// Because these two attributes match, they should both appear in the AST
|
|
[numthreads(2,2,1)]
|
|
// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 2 2 1
|
|
int secondFn();
|
|
|
|
[numthreads(2,2,1)]
|
|
// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 2 2 1
|
|
int secondFn() {
|
|
return 1;
|
|
}
|
|
|
|
[numthreads(4,2,1)]
|
|
// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> 4 2 1
|
|
int onlyOnForwardDecl();
|
|
|
|
// CHECK: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:18> Inherited 4 2 1
|
|
int onlyOnForwardDecl() {
|
|
return 1;
|
|
}
|
|
|
|
#ifdef __spirv__
|
|
[numthreads(4,2,128)]
|
|
// CHECK-SPIRV: HLSLNumThreadsAttr 0x{{[0-9a-fA-F]+}} <line:{{[0-9]+}}:2, col:20> 4 2 128
|
|
int largeZ();
|
|
#endif
|
|
|
|
#else // Vertex and Pixel only beyond here
|
|
// expected-error-re@+1 {{attribute 'numthreads' is unsupported in '{{[A-Za-z]+}}' shaders, requires one of the following: compute, amplification, mesh}}
|
|
[numthreads(1,1,1)]
|
|
int main() : A {
|
|
return 1;
|
|
}
|
|
|
|
#endif
|