summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarsh Aggarwal (NVIDIA) <haaggarwal@nvidia.com>2025-09-03 21:36:43 +0530
committerGitHub <noreply@github.com>2025-09-03 16:06:43 +0000
commitbf607e2f3fa183e9a2b18c7a98438a05247d6ed3 (patch)
tree1316303f0aec9e3b5b3bb26607a85059408f4f17
parentf5fae010863c0c836a5a80e659673bcd58010dba (diff)
Fix#8085: Batch-9: Enable cuda tests (#8269)
-rw-r--r--tests/compute/byte-address-buffer-array.slang1
-rw-r--r--tests/compute/func-param-legalize.slang3
-rw-r--r--tests/compute/int-generic.slang3
-rw-r--r--tests/compute/interface-qualifiers/dyn-on-type-uses.slang6
-rw-r--r--tests/compute/nonuniformres-array-of-textures.slang6
-rw-r--r--tests/compute/nonuniformres-nested-rwstructuredbuf.slang7
-rw-r--r--tests/compute/switch-stmt.slang3
7 files changed, 22 insertions, 7 deletions
diff --git a/tests/compute/byte-address-buffer-array.slang b/tests/compute/byte-address-buffer-array.slang
index d1f8d6489..90cdb2261 100644
--- a/tests/compute/byte-address-buffer-array.slang
+++ b/tests/compute/byte-address-buffer-array.slang
@@ -1,5 +1,6 @@
// byte-address-buffer-array.slang
//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -d3d12 -profile cs_6_0 -shaderobj -output-using-type
+//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -cuda -profile cs_6_0 -shaderobj -output-using-type
//DISABLED_TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-slang -compute -vk -shaderobj -output-using-type
//TEST:SIMPLE(filecheck=CHECK2):-target hlsl -entry computeMain -stage compute
diff --git a/tests/compute/func-param-legalize.slang b/tests/compute/func-param-legalize.slang
index 2d7c57e9f..4deb390bf 100644
--- a/tests/compute/func-param-legalize.slang
+++ b/tests/compute/func-param-legalize.slang
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE: -shaderobj
+//TEST(compute):COMPARE_COMPUTE: -shaderobj -cuda
struct Param
{
@@ -32,4 +33,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
outputBuffer[1] = outVal.y;
outputBuffer[2] = outVal.z;
outputBuffer[3] = outVal.w;
-} \ No newline at end of file
+}
diff --git a/tests/compute/int-generic.slang b/tests/compute/int-generic.slang
index 1c67591b7..f5839a6c5 100644
--- a/tests/compute/int-generic.slang
+++ b/tests/compute/int-generic.slang
@@ -1,4 +1,5 @@
//DISABLED_TEST(compute):COMPARE_COMPUTE: -shaderobj
+//TEST(compute):COMPARE_COMPUTE: -shaderobj -cuda
//TEST_INPUT:type Material<1,2>
@@ -39,4 +40,4 @@ void computeMain<M : IMaterial>(
M.TBRDF brdf = material.getBRDF();
int outVal = brdf.compute();
outputBuffer[dispatchThreadID.x] = outVal;
-} \ No newline at end of file
+}
diff --git a/tests/compute/interface-qualifiers/dyn-on-type-uses.slang b/tests/compute/interface-qualifiers/dyn-on-type-uses.slang
index 16e9e6efa..82f33ef8d 100644
--- a/tests/compute/interface-qualifiers/dyn-on-type-uses.slang
+++ b/tests/compute/interface-qualifiers/dyn-on-type-uses.slang
@@ -1,6 +1,6 @@
-//TEST:SIMPLE(filecheck=CHECK_2026): -target spirv -stage compute -entry computeMain -lang slang -std 2026
-//TEST:SIMPLE(filecheck=CHECK_2025_OR_EXP): -target spirv -stage compute -entry computeMain
-//TEST:SIMPLE(filecheck=CHECK_2025_OR_EXP): -target spirv -stage compute -entry computeMain -lang slang -std 2026 -enable-experimental-dynamic-dispatch
+//TEST:SIMPLE(filecheck=CHECK_2026): -stage compute -entry computeMain -lang slang -std 2026
+//TEST:SIMPLE(filecheck=CHECK_2025_OR_EXP): -stage compute -entry computeMain
+//TEST:SIMPLE(filecheck=CHECK_2025_OR_EXP): -stage compute -entry computeMain -lang slang -std 2026 -enable-experimental-dynamic-dispatch
// Validate AST side of `dyn` keyword use-cases
diff --git a/tests/compute/nonuniformres-array-of-textures.slang b/tests/compute/nonuniformres-array-of-textures.slang
index 6cab0131a..4d938ca2d 100644
--- a/tests/compute/nonuniformres-array-of-textures.slang
+++ b/tests/compute/nonuniformres-array-of-textures.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE(filecheck=CHECK1):-target hlsl -entry main -stage compute
//TEST:SIMPLE(filecheck=CHECK2):-target spirv -entry main -stage compute -emit-spirv-via-glsl
//TEST:SIMPLE(filecheck=CHECK3):-target spirv -entry main -stage compute -emit-spirv-directly
+//TEST:SIMPLE(filecheck=CHECK4):-target cuda -entry main -stage compute
Texture2D<float> textures[2];
RWTexture2D<float2> outputTexture;
@@ -32,6 +33,11 @@ void main(uint2 pixelIndex : SV_DispatchThreadID)
// CHECK3: %[[VAR3:[a-zA-Z0-9_]+]] = OpAccessChain{{.*}}NonUniform
// CHECK3: %[[VAR4:[a-zA-Z0-9_]+]] = OpLoad %{{.*}}[[VAR3]]{{.*}}NonUniform
// CHECK3: %{{.*}} = OpImageFetch %v4float %[[VAR4]] %{{.*}}
+
+ // CHECK4: FixedArray<CUtexObject, 2> [[TEXTURES:textures[_0-9]*]];
+ // CHECK4: CUsurfObject [[OUTPUTTEXTURE:outputTexture[_0-9]*]];
+ // CHECK4: tex2Dfetch_int<float>(([[GLOBALPARAMS:globalParams[_0-9]*]]->[[TEXTURES]][_S{{[0-9]+}}])
+ // CHECK4: tex2Dfetch_int<float>(([[GLOBALPARAMS]]->[[TEXTURES]][uint(float(_S{{[0-9]+}}))])
float2 tmp0 = textures[NonUniformResourceIndex(pixelIndex.x)].Load(int3(0, 0, 0));
outputTexture[0] = tmp0;
diff --git a/tests/compute/nonuniformres-nested-rwstructuredbuf.slang b/tests/compute/nonuniformres-nested-rwstructuredbuf.slang
index f935ce799..f01130240 100644
--- a/tests/compute/nonuniformres-nested-rwstructuredbuf.slang
+++ b/tests/compute/nonuniformres-nested-rwstructuredbuf.slang
@@ -2,6 +2,7 @@
//TEST:SIMPLE(filecheck=CHECK1):-target hlsl -entry main -stage compute
//TEST:SIMPLE(filecheck=CHECK2):-target spirv -entry main -stage compute -emit-spirv-via-glsl
//TEST:SIMPLE(filecheck=CHECK3):-target spirv -entry main -stage compute -emit-spirv-directly
+//TEST:SIMPLE(filecheck=CHECK4):-target cuda -entry main -stage compute -emit-spirv-directly
RWStructuredBuffer<int> buffer[];
@@ -25,9 +26,13 @@ void main(uint3 dispatchThreadID: SV_DispatchThreadID)
// CHECK3: %{{.*}} = OpAccessChain %_ptr_StorageBuffer_int %[[VAR1]]
// CHECK3: %[[VAR2:[a-zA-Z0-9_]+]] = OpAccessChain %_ptr_StorageBuffer_RWStructuredBuffer %buffer %{{.*}}NonUniform
// CHECK3: %{{.*}} = OpAccessChain %_ptr_StorageBuffer_int %[[VAR2]]
+
+ // CHECK4: Array<RWStructuredBuffer<int>> [[BUFFER:buffer[_0-9]*]];
+ // CHECK4: [[GLOBALPARAMS:globalParams[_0-9]*]]->[[BUFFER]][_S{{[0-9]+}}]
+ // CHECK4: [[GLOBALPARAMS]]->[[BUFFER]][int(_S{{[0-9]+}})]
RWStructuredBuffer<int> buffer1 = buffer[NonUniformResourceIndex(NonUniformResourceIndex(NonUniformResourceIndex(dispatchThreadID.x)))];
buffer1[0] = 1;
RWStructuredBuffer<int> buffer2 = buffer[int(NonUniformResourceIndex(uint(float(dispatchThreadID.x))))];
buffer2[0] = 1;
-} \ No newline at end of file
+}
diff --git a/tests/compute/switch-stmt.slang b/tests/compute/switch-stmt.slang
index b8411a9ad..d7c7cb446 100644
--- a/tests/compute/switch-stmt.slang
+++ b/tests/compute/switch-stmt.slang
@@ -1,4 +1,5 @@
//TEST(compute):COMPARE_COMPUTE: -shaderobj
+//TEST(compute):COMPARE_COMPUTE: -cuda -shaderobj
// Test that `swith` statement works
@@ -39,4 +40,4 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
int inVal = outputBuffer[tid];
int outVal = test(inVal);
outputBuffer[tid] = outVal;
-} \ No newline at end of file
+}