diff --git a/test/Feature/HLSLLib/isinf.16.test b/test/Feature/HLSLLib/isinf.16.test new file mode 100644 index 000000000..4640a9dc0 --- /dev/null +++ b/test/Feature/HLSLLib/isinf.16.test @@ -0,0 +1,66 @@ +#--- source.hlsl + +StructuredBuffer In : register(t0); +RWStructuredBuffer Out : register(u1); + +[numthreads(1,1,1)] +void main() { + Out[0] = isinf(In[0]); + bool4 Tmp = {isinf(In[0].xyz), isinf(In[0].w)}; + Out[1] = Tmp; + Out[2].xy = isinf(In[0].xy); +} + +//--- pipeline.yaml + +--- +Shaders: + - Stage: Compute + Entry: main + DispatchSize: [1, 1, 1] +Buffers: + - Name: In + Format: Float16 + Stride: 8 + Data: [0x7c00, 0xfc00, 0x3c00, 0x7e00] # Inf, -Inf, 1, Nan + - Name: Out + Format: Bool + Stride: 16 + ZeroInitSize: 48 + - Name: ExpectedOut # The result we expect + Format: Bool + Stride: 16 + Data: [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0] +Results: + - Result: Test1 + Rule: BufferExact + Actual: Out + Expected: ExpectedOut +DescriptorSets: + - Resources: + - Name: In + Kind: StructuredBuffer + DirectXBinding: + Register: 0 + Space: 0 + VulkanBinding: + Binding: 0 + - Name: Out + Kind: RWStructuredBuffer + DirectXBinding: + Register: 1 + Space: 0 + VulkanBinding: + Binding: 1 +... +#--- end + +# llvm/llvm-project#141089 +# XFAIL: Clang-Vulkan +# issue with 16 bit ops; no hlk tests +# XFAIL: Clang-Metal + +# REQUIRES: Half +# RUN: split-file %s %t +# RUN: %dxc_target -enable-16bit-types -T cs_6_5 -Fo %t.o %t/source.hlsl +# RUN: %offloader %t/pipeline.yaml %t.o diff --git a/test/Feature/HLSLLib/isinf.32.test b/test/Feature/HLSLLib/isinf.32.test new file mode 100644 index 000000000..acef3f8bb --- /dev/null +++ b/test/Feature/HLSLLib/isinf.32.test @@ -0,0 +1,63 @@ +#--- source.hlsl + +StructuredBuffer In : register(t0); +RWStructuredBuffer Out : register(u1); + +[numthreads(1,1,1)] +void main() { + Out[0] = isinf(In[0]); + bool4 Tmp = {isinf(In[0].xyz), isinf(In[0].w)}; + Out[1] = Tmp; + Out[2].xy = isinf(In[0].xy); +} + +//--- pipeline.yaml + +--- +Shaders: + - Stage: Compute + Entry: main + DispatchSize: [1, 1, 1] +Buffers: + - Name: In + Format: Float32 + Stride: 16 + Data: [inf, -inf, 1.0, nan] # Inf, -Inf, 1, Nan + - Name: Out + Format: Bool + Stride: 16 + ZeroInitSize: 48 + - Name: ExpectedOut # The result we expect + Format: Bool + Stride: 16 + Data: [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0] +Results: + - Result: Test1 + Rule: BufferExact + Actual: Out + Expected: ExpectedOut +DescriptorSets: + - Resources: + - Name: In + Kind: StructuredBuffer + DirectXBinding: + Register: 0 + Space: 0 + VulkanBinding: + Binding: 0 + - Name: Out + Kind: RWStructuredBuffer + DirectXBinding: + Register: 1 + Space: 0 + VulkanBinding: + Binding: 1 +... +#--- end + +# llvm/llvm-project#141089 +# XFAIL: Clang-Vulkan + +# RUN: split-file %s %t +# RUN: %dxc_target -T cs_6_5 -Fo %t.o %t/source.hlsl +# RUN: %offloader %t/pipeline.yaml %t.o