Skip to content
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

Double precision matrix support #47

Open
CUSkidmore opened this issue Feb 7, 2021 · 4 comments
Open

Double precision matrix support #47

CUSkidmore opened this issue Feb 7, 2021 · 4 comments
Assignees
Labels

Comments

@CUSkidmore
Copy link

Would you consider adding support for double precision matrix such as double4x4?

@redorav
Copy link
Owner

redorav commented Feb 7, 2021

Hi @CUSkidmore it is always my plan to expand hlsl++ beyond its capabilities and make it as useful as possible. It isn't a priority right now as it's a big chunk of work, and there are several considerations such as SSE/AVX implementation. I'll leave it here in case there is more demand or even if you want to tackle it. As a matter of curiosity, what application would you use them for?

@redorav redorav added the feature label Feb 7, 2021
@redorav redorav self-assigned this Jan 31, 2022
@devshgraphicsprogramming

Hi @CUSkidmore it is always my plan to expand hlsl++ beyond its capabilities and make it as useful as possible. It isn't a priority right now as it's a big chunk of work, and there are several considerations such as SSE/AVX implementation. I'll leave it here in case there is more demand or even if you want to tackle it. As a matter of curiosity, what application would you use them for?

I can only talk for myself, but I'm doing CAD rendering with HLSL.

If I want to use the same functions to work with view matrices and similar in shaders and on CPU, then it would be important.

I myself don't really care about SSE vs AVX implementation, you could give me a simple transpose and FMA matrix-vector done in terms of double8 and leave optimization as a TODO.

I guess we as the users of something whose goal is to be compatible with HLSL syntax are not looking for ultimate performance but maintainability offerred by code-sharing between C++ and HLSL

@redorav
Copy link
Owner

redorav commented Mar 22, 2023

Hi @devshgraphicsprogramming,

I can only talk for myself, but I'm doing CAD rendering with HLSL.

I can see there can be a use case for this, so thanks for commenting.

I myself don't really care about SSE vs AVX implementation,
I guess we as the users of something whose goal is to be compatible with HLSL syntax are not looking for ultimate performance but maintainability offerred by code-sharing between C++ and HLSL

This library's main target is SIMD-style computation, such as SSE and AVX, which I think is clear from the repository decription. Scalar implementations are there for compatibility. Were I to implement this I would go the fully featured route, not a halfway solution. I understand that as a user you may not need it but I personally use this library in my own projects and have to maintain it.

you could give me a simple transpose and FMA matrix-vector.

I should be able to implement the beginnings of a double matrix with this in mind and prioritize your needs, which as you said are multiplying by vectors and transposing. That might not be a lot of work considering that double vectors already exist in the codebase. Also bear in mind I do this outside work, if you need this urgently you could consider submitting a patch or something that would speed it up.

@devshgraphicsprogramming

which as you said are multiplying by vectors and transposing

I was refering to "turn row major into columns and do matrix-vector mult as FMA" as a particular strategy.

My main use case is just matrix<4,4,double> and double<4> usage (adding, multiplying with each other and themselves) followed by a bit of double<3>.

Also bear in mind I do this outside work, if you need this urgently you could consider submitting a patch or something that would speed it up.

We will try and use it in our engine https://github.com/devshgraphicsprogramming/Nabla and if we feel like we can get 90% of the functionality then we'll submit patches for the remaining 10%.

We've already done this to SPIRV-Cross, shaderc/glslang, and DXC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants