[0035] Adding conversion primitives - #819
Conversation
This provides a different approach to addressing some of the issues around types and conversions. Instead of allowing the arithmetic operations to convert data during the operations it implements a conversion operation that converts data before the operation. Fixes microsoft#786, Fixes microsoft#568
|
Tagging Anupama Chandrasekhar (@anupamachandra), Gregory Roth (@pow2clk), Jeff Bolz (@jeffbolznv), Michael Bedy (@mbedy-amd), & Nicolai Hähnle (@nhaehnle) for visibility. |
Nicolai Hähnle (nhaehnle)
left a comment
There was a problem hiding this comment.
Having an explicit Convert like this makes sense to me, but I'm struggling to understand how a conversion to, say, F8_E4M3 is actually supposed to work given that I don't believe we can have a plain vector of that type.
Gregory Roth (pow2clk)
left a comment
There was a problem hiding this comment.
I think it would be less confusing to use uint for packed 8-bit floats than the existing uint8_t4_packed native types as the example code uses.
I'd be interested to know what is expected if these native packed types are used for native vectors used in matvec multiplies.
Co-authored-by: Nicolai Hähnle <nhaehnle@gmail.com>
|
Will there be a runtime feature check couterpart to check what conversions an implementation supports? |
I don't see a change to how the PSV0 data structure as part of this, but yes we can make a corresponding change in the caps reporting. |
Mostly changes the inlined header to be consistent with itself, other parts of the spec and other corrections for compilability Finish update to SIZE_TYPE in header. Remove unused IsNativeScalar boolean. These finish the cleanups that microsoft#712 started to fix microsoft#570 Finish update to align mat/vec multiplies with coopvec spec. Finishes Update mat/vec multiply operations to not take a scope parameter, limiting them to thread scope Fixes microsoft#797 Remove unused template type for accumulate() methods fixes microsoft#795 Renumbered componenttype enum to be consistent with internal numbers fixes microsoft#798 Removed latent `p` prefix to overload names of groupshared dxil ops for consistency. Corrects omission in microsoft#769 fixing microsoft#756 Corrected latent mention of linAlgMatrixMulOp
This responds to API feedback provided offline. I've also fixed some formatting and other errors introduced in `main`.
Co-authored-by: Ashley Coleman <ascoleman@microsoft.com>
microsoft/hlsl-specs#819 Adds a signed output bool to the VecMul and VecMulAdd ops. This PR reflects that change to the spec.
Adds `Convert` function to `linalg.h`. This function converts a vector to an `InterpretedVector` of a different component type. It has been added to the spec in microsoft/hlsl-specs#819. It is implemented by calling a built-in function that was added in #8308.
This provides a different approach to addressing some of the issues around types and conversions. Instead of allowing the arithmetic operations to convert data during the operations it implements a conversion operation that converts data before the operation.
Fixes #786, Fixes #568