-
Notifications
You must be signed in to change notification settings - Fork 25
Adds tests for isnan(). #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #--- source.hlsl | ||
|
|
||
| StructuredBuffer<half4> In : register(t0); | ||
| RWStructuredBuffer<bool4> Out : register(u1); | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| Out[0] = isnan(In[0]); | ||
| bool4 Tmp = {isnan(In[0].xyz), isnan(In[0].w)}; | ||
| Out[1] = Tmp; | ||
| Out[2].xy = isnan(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: [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1] | ||
| 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 | ||
|
|
||
| # https://github.com/llvm/llvm-project/issues/145571 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We added the isnan emulation see https://github.com/llvm/llvm-project/pull/157505/files this should work for clang.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have an nVidia GPU, so I suppose I can't test for DirectX-NV?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't run the nvidia gpu runner yet on the PR runs. and the only way to manually invoke it would be if you had a branch on this repository. There doesn't apear to be anyway to do that with a fork. That said I feel confident that if you are seeing the emulation passing on amd\intel for sm 6.8 and lower then it should pass for nvidia too since we won't be emitting the opcode that would blow things up.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you add a https://github.com/llvm/offload-test-suite/blob/main/docs/CI.md If this doesn't work for PRs from forks we should update these docs! |
||
| # XFAIL: Clang && DirectX-NV | ||
|
|
||
| # A bug in the Metal Shader Converter caused it to mis-translate this operation. | ||
| # Version 3 fixes this issue. | ||
| # UNSUPPORTED: Clang-Metal && !metal-shaderconverter-3.0.0-or-later | ||
|
|
||
| # 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #--- source.hlsl | ||
|
|
||
| StructuredBuffer<float4> In : register(t0); | ||
| RWStructuredBuffer<bool4> Out : register(u1); | ||
|
|
||
| [numthreads(1,1,1)] | ||
| void main() { | ||
| Out[0] = isnan(In[0]); | ||
| bool4 Tmp = {isnan(In[0].xyz), isnan(In[0].w)}; | ||
| Out[1] = Tmp; | ||
| Out[2].xy = isnan(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: [0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1] | ||
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the issue you linked is closed llvm/llvm-project#141089 are you sure this should still xfail for clang-vulkan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang-Vulkan XFAIL removed.