|
| 1 | +#--- source.hlsl |
| 2 | + |
| 3 | +StructuredBuffer<double4> A : register(t0); |
| 4 | +StructuredBuffer<double4> B : register(t1); |
| 5 | +StructuredBuffer<double4> C : register(t2); |
| 6 | + |
| 7 | +RWStructuredBuffer<double4> Out : register(u3); |
| 8 | + |
| 9 | +[numthreads(1,1,1)] |
| 10 | +void main() { |
| 11 | + Out[0] = fma(A[0], B[0], C[0]); |
| 12 | + Out[1] = double4(fma(A[1].xyz, B[1].xyz, C[1].xyz), fma(A[1].w, B[1].w, C[1].w)); |
| 13 | + Out[2] = double4(fma(A[2].xy, B[2].xy, C[2].xy), fma(A[2].zw, B[2].zw, C[2].zw)); |
| 14 | + Out[3] = fma(double4(1.0000000149011612l, -1.0000000149011612l, 1.0000000000000002l, 0.5l), double4(67108865.0l, 67108865.0l, -0.9999999999999998l, -8.0l), double4(-67108866.0l, 67108866.0l, 1.0l, 1.0l)); |
| 15 | +} |
| 16 | + |
| 17 | +//--- pipeline.yaml |
| 18 | + |
| 19 | +--- |
| 20 | +Shaders: |
| 21 | + - Stage: Compute |
| 22 | + Entry: main |
| 23 | + DispatchSize: [1, 1, 1] |
| 24 | +Buffers: |
| 25 | + - Name: A |
| 26 | + Format: Float64 |
| 27 | + Stride: 32 |
| 28 | + Data: [ 1.5, -2.0, 0.75, -3.25, |
| 29 | + 2.5, -4.0, 1.25, 3.5, |
| 30 | + 1.0000000149011612, -1.0000000149011612, 1.0000000000000002, 0.5 ] |
| 31 | + # last row: (1 + 2^-26), -(1 + 2^-26), (1 + 2^-52), 0.5 |
| 32 | + - Name: B |
| 33 | + Format: Float64 |
| 34 | + Stride: 32 |
| 35 | + Data: [ 2.25, 4.5, -8.0, -2.0, |
| 36 | + -1.5, -2.0, 8.0, -2.0, |
| 37 | + 67108865.0, 67108865.0, -0.9999999999999998, -8.0 ] |
| 38 | + # last row: (2^26 + 1), (2^26 + 1), -(1 - 2^-52), -8 |
| 39 | + - Name: C |
| 40 | + Format: Float64 |
| 41 | + Stride: 32 |
| 42 | + Data: [ 0.125, 1.25, 2.5, -0.5, |
| 43 | + 0.25, -1.5, -0.75, 0.5, |
| 44 | + -67108866.0, 67108866.0, 1.0, 1.0 ] |
| 45 | + # last row: -(2^26 + 2), (2^26 + 2), 1, 1 |
| 46 | + - Name: Out |
| 47 | + Format: Float64 |
| 48 | + Stride: 32 |
| 49 | + FillSize: 128 |
| 50 | + - Name: Expected |
| 51 | + Format: Float64 |
| 52 | + Stride: 32 |
| 53 | + Data: [ 3.5, -7.75, -3.5, 6.0, |
| 54 | + -3.5, 6.5, 9.25, -6.5, |
| 55 | + 0x1.0000000000000p-26, -0x1.0000000000000p-26, 0x1.0000000000000p-104, -3.0, |
| 56 | + 0x1.0000000000000p-26, -0x1.0000000000000p-26, 0x1.0000000000000p-104, -3.0 ] |
| 57 | + # last two rows: 2^-26, -(2^-26), 2^-104, -3 |
| 58 | +Results: |
| 59 | + - Result: Result |
| 60 | + Rule: BufferFloatULP |
| 61 | + ULPT: 1 |
| 62 | + Actual: Out |
| 63 | + Expected: Expected |
| 64 | +DescriptorSets: |
| 65 | + - Resources: |
| 66 | + - Name: A |
| 67 | + Kind: StructuredBuffer |
| 68 | + DirectXBinding: |
| 69 | + Register: 0 |
| 70 | + Space: 0 |
| 71 | + VulkanBinding: |
| 72 | + Binding: 0 |
| 73 | + - Name: B |
| 74 | + Kind: StructuredBuffer |
| 75 | + DirectXBinding: |
| 76 | + Register: 1 |
| 77 | + Space: 0 |
| 78 | + VulkanBinding: |
| 79 | + Binding: 1 |
| 80 | + - Name: C |
| 81 | + Kind: StructuredBuffer |
| 82 | + DirectXBinding: |
| 83 | + Register: 2 |
| 84 | + Space: 0 |
| 85 | + VulkanBinding: |
| 86 | + Binding: 2 |
| 87 | + - Name: Out |
| 88 | + Kind: RWStructuredBuffer |
| 89 | + DirectXBinding: |
| 90 | + Register: 3 |
| 91 | + Space: 0 |
| 92 | + VulkanBinding: |
| 93 | + Binding: 3 |
| 94 | +#--- end |
| 95 | + |
| 96 | +# Bug https://github.com/microsoft/DirectXShaderCompiler/issues/8330 |
| 97 | +# XFAIL: arm64 && WARP |
| 98 | + |
| 99 | +# Bug https://github.com/llvm/offload-test-suite/issues/1026 |
| 100 | +# XFAIL: Intel && Vulkan && DXC |
| 101 | + |
| 102 | +# REQUIRES: Double |
| 103 | +# RUN: split-file %s %t |
| 104 | +# RUN: %dxc_target -Gis -HV 202x -T cs_6_5 -Fo %t.o %t/source.hlsl |
| 105 | +# RUN: %offloader %t/pipeline.yaml %t.o |
0 commit comments