summaryrefslogtreecommitdiff
path: root/tests/cooperative-vector/glsl
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2025-04-02 13:06:45 -0700
committerGitHub <noreply@github.com>2025-04-02 20:06:45 +0000
commitb4a1d618b8d850a579af2840db2df6bee312172c (patch)
tree572a5a46eea1956e9e2ccc54c9117ccd78287a54 /tests/cooperative-vector/glsl
parentc1f69ca1e29811919dbd2f08a6e2dd498b80aab2 (diff)
Enable coopvec tests with dxc backend (#6726)
This PR enables existing CoopVec tests with DX12 backend. In order to use the CoopVec feature with DX12 backend, we have to use an option, "-dx12-experimental", because the current implementation of CoopVec feature in dxcompiler.dll requires "experimental feature". Note that when the "experimental feature" is enabled, slang-test becomes less stable. For that reason, we should use the option "-dx12-experimental" only when it is needed. All tests for GLSL are deleted because CoopVec support for GLSL in Slang is deprecated and no longer supported. Some of CoopVec tests are still disabled for DX12 backend because: DXC doesn't support 8bit integer types and Some of CoopVec features are not implemented in DXC backend.
Diffstat (limited to 'tests/cooperative-vector/glsl')
-rw-r--r--tests/cooperative-vector/glsl/cast.slang30
-rw-r--r--tests/cooperative-vector/glsl/cast.slang.glsl23
-rw-r--r--tests/cooperative-vector/glsl/groupshared-sized.slang37
-rw-r--r--tests/cooperative-vector/glsl/groupshared-sized.slang.glsl38
-rw-r--r--tests/cooperative-vector/glsl/load-store.slang13
-rw-r--r--tests/cooperative-vector/glsl/load-store.slang.glsl20
-rw-r--r--tests/cooperative-vector/glsl/only-arith.slang18
-rw-r--r--tests/cooperative-vector/glsl/only-arith.slang.glsl16
-rw-r--r--tests/cooperative-vector/glsl/outer-product-accumulate.slang19
-rw-r--r--tests/cooperative-vector/glsl/outer-product-accumulate.slang.glsl17
-rw-r--r--tests/cooperative-vector/glsl/simple.slang35
-rw-r--r--tests/cooperative-vector/glsl/simple.slang.glsl20
12 files changed, 0 insertions, 286 deletions
diff --git a/tests/cooperative-vector/glsl/cast.slang b/tests/cooperative-vector/glsl/cast.slang
deleted file mode 100644
index 263ad5026..000000000
--- a/tests/cooperative-vector/glsl/cast.slang
+++ /dev/null
@@ -1,30 +0,0 @@
-//DISABLE_TEST:CROSS_COMPILE: -profile glsl_450+spirv_1_4 -stage compute -entry computeMain -target spirv-assembly
-
-RWStructuredBuffer<float> outputBuffer;
-
-StructuredBuffer<float> buf;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- coopvecNV<int, 8> r_int;
- coopvecNV<float, 8> r = coopvecNV<float, 8>(r_int);
- coopvecNV<int, 16> v = coopvecNV<int, 16>(1);
- int offset = 0;
- int layout = gl_CooperativeVectorMatrixLayoutRowMajorNV;
- bool transpose = false;
- int matrixStride = 4;
- coopVecMatMulNV(
- r,
- v,
- gl_ComponentTypeFloat32NV,
- buf,
- offset,
- gl_ComponentTypeFloat32NV,
- 8,
- 16,
- layout,
- transpose,
- matrixStride);
- outputBuffer[dispatchThreadID.x] = r[0];
-}
diff --git a/tests/cooperative-vector/glsl/cast.slang.glsl b/tests/cooperative-vector/glsl/cast.slang.glsl
deleted file mode 100644
index 7194c02fc..000000000
--- a/tests/cooperative-vector/glsl/cast.slang.glsl
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 450
-#extension GL_NV_cooperative_vector : require
-layout(row_major) uniform;
-layout(row_major) buffer;
-layout(std430, binding = 1) readonly buffer StructuredBuffer_float_t_0 {
- float _data[];
-} buf_0;
-layout(std430, binding = 0) buffer StructuredBuffer_float_t_1 {
- float _data[];
-} outputBuffer_0;
-layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
-void main()
-{
- coopvecNV<int, 8 > r_int_0;
- coopvecNV<float, 8 > _S1 = (coopvecNV<float, 8>((r_int_0)));
- coopvecNV<float, 8 > r_0 = _S1;
- coopvecNV<int, 16 > _S2 = (coopvecNV<int, 16>((1)));
- coopVecMatMulNV((r_0), (_S2), (1), (buf_0)._data, (0U), (1), (8U), (16U), (0), (false), (4U));
- float _S3 = r_0[0U];
- outputBuffer_0._data[gl_GlobalInvocationID.x] = _S3;
- return;
-}
-
diff --git a/tests/cooperative-vector/glsl/groupshared-sized.slang b/tests/cooperative-vector/glsl/groupshared-sized.slang
deleted file mode 100644
index 74ccac6a2..000000000
--- a/tests/cooperative-vector/glsl/groupshared-sized.slang
+++ /dev/null
@@ -1,37 +0,0 @@
-//DISABLE_TEST:CROSS_COMPILE: -profile glsl_450+spirv_1_4 -stage compute -entry computeMain -target spirv-assembly
-
-RWStructuredBuffer<float> outputBuffer;
-
-groupshared float buf[100];
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- coopvecNV<float, 8> r;
- coopvecNV<int, 16> v;
- if(dispatchThreadID.x == 0)
- {
- for(int i = 0; i < 100; ++i)
- {
- buf[i] = float(i);
- }
- }
- coopVecLoadNV(v, buf, 0);
- int offset = 0;
- int layout = gl_CooperativeVectorMatrixLayoutRowMajorNV;
- bool transpose = false;
- int matrixStride = 4;
- coopVecMatMulNV(
- r,
- v,
- gl_ComponentTypeFloat32NV,
- buf,
- offset,
- gl_ComponentTypeFloat32NV,
- 8,
- 16,
- layout,
- transpose,
- matrixStride);
- outputBuffer[dispatchThreadID.x] = r[0];
-}
diff --git a/tests/cooperative-vector/glsl/groupshared-sized.slang.glsl b/tests/cooperative-vector/glsl/groupshared-sized.slang.glsl
deleted file mode 100644
index f1f4b5a27..000000000
--- a/tests/cooperative-vector/glsl/groupshared-sized.slang.glsl
+++ /dev/null
@@ -1,38 +0,0 @@
-#version 450
-#extension GL_NV_cooperative_vector : require
-layout(row_major) uniform;
-layout(row_major) buffer;
-layout(std430, binding = 0) buffer StructuredBuffer_float_t_0 {
- float _data[];
-} outputBuffer_0;
-shared float buf_0[100];
-
-layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
-void main()
-{
- coopvecNV<float, 8 > r_0;
- coopvecNV<int, 16 > v_0;
- uint _S1 = gl_GlobalInvocationID.x;
- if(_S1 == 0U)
- {
- int i_0 = 0;
- for(;;)
- {
- if(i_0 < 100)
- {
- }
- else
- {
- break;
- }
- buf_0[i_0] = float(i_0);
- i_0 = i_0 + 1;
- }
- }
- coopVecLoadNV((v_0), (buf_0), (0U));
- coopvecNV<int, 16 > _S2 = v_0;
- coopVecMatMulNV((r_0), (_S2), (1), (buf_0), (0U), (1), (8U), (16U), (0), (false), (4U));
- float _S3 = r_0[0U];
- outputBuffer_0._data[uint(_S1)] = _S3;
- return;
-}
diff --git a/tests/cooperative-vector/glsl/load-store.slang b/tests/cooperative-vector/glsl/load-store.slang
deleted file mode 100644
index 04a0cd585..000000000
--- a/tests/cooperative-vector/glsl/load-store.slang
+++ /dev/null
@@ -1,13 +0,0 @@
-//DISABLE_TEST:CROSS_COMPILE: -profile glsl_450+spirv_1_4 -stage compute -entry computeMain -target spirv-assembly
-
-RWStructuredBuffer<float> rwBuf;
-StructuredBuffer<float> buf;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- coopvecNV<float, 8> r;
- coopVecLoadNV(r, rwBuf, 0);
- coopVecLoadNV(r, buf, 1);
- coopVecStoreNV(r, rwBuf, 2);
-}
diff --git a/tests/cooperative-vector/glsl/load-store.slang.glsl b/tests/cooperative-vector/glsl/load-store.slang.glsl
deleted file mode 100644
index 3844e2ff0..000000000
--- a/tests/cooperative-vector/glsl/load-store.slang.glsl
+++ /dev/null
@@ -1,20 +0,0 @@
-#version 450
-#extension GL_NV_cooperative_vector : require
-layout(row_major) uniform;
-layout(row_major) buffer;
-layout(std430, binding = 0) buffer StructuredBuffer_float_t_0 {
- float _data[];
-} rwBuf_0;
-layout(std430, binding = 1) readonly buffer StructuredBuffer_float_t_1 {
- float _data[];
-} buf_0;
-layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
-void main()
-{
- coopvecNV<float, 8 > r_0;
- coopVecLoadNV((r_0), (rwBuf_0)._data, (0U));
- coopVecLoadNV((r_0), (buf_0)._data, (1U));
- coopVecStoreNV((r_0), (rwBuf_0)._data, (2U));
- return;
-}
-
diff --git a/tests/cooperative-vector/glsl/only-arith.slang b/tests/cooperative-vector/glsl/only-arith.slang
deleted file mode 100644
index 8a6d3d0d9..000000000
--- a/tests/cooperative-vector/glsl/only-arith.slang
+++ /dev/null
@@ -1,18 +0,0 @@
-//DISABLE_TEST:CROSS_COMPILE: -profile glsl_450+spirv_1_4 -stage compute -entry computeMain -target spirv-assembly
-
-// Disabled because we don't output the extension because although the
-// coopvecNV type is used, it isn't *declared* here (and we don't attach
-// requirements to the add operations);
-
-RWStructuredBuffer<float> outputBuffer;
-
-StructuredBuffer<float> buf;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- coopvecNV<float, 8> r;
- coopvecNV<float, 8> v = coopvecNV<float, 8>(1);
- r = v + v;
- outputBuffer[dispatchThreadID.x] = r[0];
-}
diff --git a/tests/cooperative-vector/glsl/only-arith.slang.glsl b/tests/cooperative-vector/glsl/only-arith.slang.glsl
deleted file mode 100644
index db3372d70..000000000
--- a/tests/cooperative-vector/glsl/only-arith.slang.glsl
+++ /dev/null
@@ -1,16 +0,0 @@
-#version 450
-#extension GL_NV_cooperative_vector : require
-layout(row_major) uniform;
-layout(row_major) buffer;
-layout(std430, binding = 0) buffer _S1 {
- float _data[];
-} outputBuffer_0;
-layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
-void main()
-{
- const coopvecNV<float, 8 > v_0 = coopvecNV<float, 8 >(1.0);
- const coopvecNV<float, 8 > r_0 = v_0 + v_0;
- float _S2 = r_0[0U];
- ((outputBuffer_0)._data[(gl_GlobalInvocationID.x)]) = _S2;
- return;
-}
diff --git a/tests/cooperative-vector/glsl/outer-product-accumulate.slang b/tests/cooperative-vector/glsl/outer-product-accumulate.slang
deleted file mode 100644
index 1db30cb0d..000000000
--- a/tests/cooperative-vector/glsl/outer-product-accumulate.slang
+++ /dev/null
@@ -1,19 +0,0 @@
-//DISABLE_TEST:CROSS_COMPILE: -profile glsl_450+spirv_1_4 -stage compute -entry computeMain -target spirv-assembly -emit-spirv-via-glsl
-
-RWByteAddressBuffer buf;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- coopvecNV<float, 8> op0 = coopvecNV<float, 8>(1);
- coopvecNV<float, 16> op1 = coopvecNV<float, 16>(2);
-
- coopVecOuterProductAccumulateNV(
- op0,
- op1,
- buf,
- 0, // firstElement
- 4, // matrixStride
- gl_CooperativeVectorMatrixLayoutRowMajorNV,
- gl_ComponentTypeFloat32NV);
-}
diff --git a/tests/cooperative-vector/glsl/outer-product-accumulate.slang.glsl b/tests/cooperative-vector/glsl/outer-product-accumulate.slang.glsl
deleted file mode 100644
index 09d781824..000000000
--- a/tests/cooperative-vector/glsl/outer-product-accumulate.slang.glsl
+++ /dev/null
@@ -1,17 +0,0 @@
-#version 450
-#extension GL_NV_cooperative_vector : require
-layout(row_major) uniform;
-layout(row_major) buffer;
-layout(std430, binding = 0) buffer _S1
-{
- uint _data[];
-} buf_0;
-layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
-void main()
-{
- coopvecNV<float, 8 > _S2 = (coopvecNV<float, 8>((1.0)));
- coopvecNV<float, 16 > _S3 = (coopvecNV<float, 16>((2.0)));
- coopVecOuterProductAccumulateNV((_S2), (_S3), (buf_0)._data, (0U), (4U), (0), (1));
- return;
-}
-
diff --git a/tests/cooperative-vector/glsl/simple.slang b/tests/cooperative-vector/glsl/simple.slang
deleted file mode 100644
index 4128f6827..000000000
--- a/tests/cooperative-vector/glsl/simple.slang
+++ /dev/null
@@ -1,35 +0,0 @@
-//DISABLE_TEST:CROSS_COMPILE(filecheck=CHECK): -profile glsl_450+spirv_1_4 -stage compute -entry computeMain -target spirv-assembly -emit-spirv-via-glsl
-
-RWStructuredBuffer<float> outputBuffer;
-
-StructuredBuffer<float> buf;
-
-[numthreads(4, 1, 1)]
-void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
-{
- // CHECK: %[[VAR1:[a-zA-Z0-9_]+]] = OpTypeCooperativeVectorNV %int %uint_16
- // CHECK: OpConstantCompositeReplicateEXT %9 %int_1
- coopvecNV<int, 16> v = coopvecNV<int, 16>(1);
-
- // CHECK: %[[VAR2:[a-zA-Z0-9_]+]] = OpTypeCooperativeVectorNV %int %uint_8
- coopvecNV<int, 8> r;
- int offset = 0;
- int layout = gl_CooperativeVectorMatrixLayoutRowMajorNV;
- bool transpose = false;
- int matrixStride = 4;
-
- // CHECK: OpCooperativeVectorMatrixMulNV %[[VAR2]] %{{.*}} %int_1 %{{.*}} %uint_0 %int_1 %uint_8 %uint_16 %int_0 %false %uint_4 MatrixBSignedComponentsKHR|MatrixResultSignedComponentsKHR
- coopVecMatMulNV(
- r,
- v,
- gl_ComponentTypeFloat32NV,
- buf,
- offset,
- gl_ComponentTypeFloat32NV,
- 8,
- 16,
- layout,
- transpose,
- matrixStride);
- outputBuffer[dispatchThreadID.x] = r[0];
-}
diff --git a/tests/cooperative-vector/glsl/simple.slang.glsl b/tests/cooperative-vector/glsl/simple.slang.glsl
deleted file mode 100644
index cf5f0566e..000000000
--- a/tests/cooperative-vector/glsl/simple.slang.glsl
+++ /dev/null
@@ -1,20 +0,0 @@
-#version 450
-#extension GL_NV_cooperative_vector : require
-layout(row_major) uniform;
-layout(row_major) buffer;
-layout(std430, binding = 1) readonly buffer StructuredBuffer_float_t_0 {
- float _data[];
-} buf_0;
-layout(std430, binding = 0) buffer StructuredBuffer_float_t_1 {
- float _data[];
-} outputBuffer_0;
-layout(local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
-void main()
-{
- coopvecNV<int, 16 > _S1 = (coopvecNV<int, 16>((1)));
- coopvecNV<int, 8 > r_0;
- coopVecMatMulNV((r_0), (_S1), (1), (buf_0)._data, (0U), (1), (8U), (16U), (0), (false), (4U));
- float _S2 = r_0[0U];
- outputBuffer_0._data[gl_GlobalInvocationID.x] = _S2;
- return;
-}