[Matrix] Add comparison operator tests - #1447
Conversation
|
So I don't have to come back and remove a bunch of xfails lets wait on this PR until llvm/llvm-project#216791 merges |
|
the tests that have 64/16 bit requires are not as exhaustive with operator testing as the 32bit tests. |
|
Failures to investigate: DXC MetalClang DXC MetalThe issue in Metal seems to be offloader specific. We don't have a uint32 Format. |
69504ae to
61d2f34
Compare
resolves llvm#1446 cover cmp operators across matrix sizes and base types
61d2f34 to
b054c3a
Compare
…are doing elementwise compares
Icohedron
left a comment
There was a problem hiding this comment.
I don't see why the 32-bit tests have to be the only comprehensive ones.
The 32-bit tests aren't even that much bigger than the other tests in line count either.
e.g. the fp16 test is 72 lines while the fp32 test is 105 lines
|
|
||
| [numthreads(1, 1, 1)] | ||
| void main() { | ||
| half4x3 HalfEQLHS = HalfIn[0], HalfEQRHS = HalfIn[1]; |
There was a problem hiding this comment.
[SUGGESTION] You should do the same as commit 8ebdcbd and make all the tests use unique matrix elements to confirm that the compares are actually done elementwise. Otherwise the comparisons collapse to single fcmp instructions.
| ... | ||
| #--- end | ||
|
|
||
| # Unimplemented https://github.com/microsoft/DirectXShaderCompiler/issues/8796 |
There was a problem hiding this comment.
[QUESTION] I'm wondering why these tests don't carry the same platform exclusion as the bool-matrix tests.
matrix_bool_and_operator.test, matrix_bool_and_operator_thread_group.test and
matrix_bool_or_operator.test all end with:
# Note: Metal does not support boolean matrix types. For
# Vulkan KosmicKrisp and MoltenVK the output is always False.
# UNSUPPORTED: Metal || KosmicKrisp || MoltenVK
Every test in this PR produces boolNxM values from the comparison and indexes them.
There was a problem hiding this comment.
The failures don't happen when you produce a boolean matrix only when you try and do an operation on them. At least for metal. I have not tested the mac vulkan runtimes.
| @@ -0,0 +1,71 @@ | |||
| #--- source.hlsl | |||
|
|
|||
| RWBuffer<int64_t> Int64In : register(u0); | |||
There was a problem hiding this comment.
[ISSUE] RWBuffer<int64_t> has a known issue in Lavapipe.
The existing typed 64-bit test, test/Feature/TypedBuffer/64bit-scalar.test has this XFAIL:
# Driver bug https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15866
# XFAIL: Lavapipe
So either switch to a RWStructuredBuffer<uint64_t> or add the same XFAIL.
| Buffers: | ||
| - Name: UintIn | ||
| Format: UInt32 | ||
| Data: [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ] |
There was a problem hiding this comment.
[SUGGESTION] The int and uint tests should exercise values where the sign bit is actually set. As-is, there is no observable difference if the compiler used signed/unsigned operations where it should have been unsigned/signed.
resolves #1446
cover cmp operators across matrix sizes and base types
assisted by co-pilot MAI model