Comments (7)
I wonder if it would be worth it to have float8 (for avx256) and float16 (for avx512) section. Would be a superset of actual hlsl, but could be handy. Maybe even add some calls to query their availability at runtime.
Just wondering if it would be possible and if there are negative implications going down this path. Asking because hlslpp is a very accessible, and readable way to write simd code in general. Probably the easiest I've used so far, tbh, and I'm getting great results. Could be a good way to extend it to the future, assuming it's possible.
from hlslpp.
@diogovtx Sure, I've always thought of extending hlsl++ to things that technically aren't in hlsl but easily derive from it. To some extent I already have, take for example the quaternion class. I would like to do float8 and float16, although I'd need to see how to add support to it on platforms that don't have such wide registers.
I'm not quite sure how to do that last part. I started doing double vectors and got it relatively far using AVX, but I don't have a solution on how I might make it work on NEON. Should it even be supported? Should I be able to mix and match scalar versions of the library?
from hlslpp.
I guess you'd have to rely on compiler preprocessor to conditionally enable float8 and float16. They could simply be unavailable, or emulated using float4.
When enabled by the preprocessor, responsibility would fall on the programmer using hlslpp to ensure the supported path is taken at runtime. Some hlslpp runtime query calls could help with that, using API calls outside of hlsl spec ofc.
from hlslpp.
I'm not sure I understand what you mean by runtime query calls, do you mean to inform the user that there is hardware support for the feature they're trying to use?
from hlslpp.
Yes. That's what I meant. Sorry if I wasn't clear.
from hlslpp.
@diogovtx I have recently introduced the float8 type. Unfortunately the nice swizzles that were possible with smaller types end up in a combinatorial explosion (8^8) so instead there's a templated swizzle function that serves that purpose. I took a look at OpenCL and it's not clear what they provide in the docs, I think short of language support this can't be done. Anyhow, the functionality is there, give it a spin if you want :)
from hlslpp.
Closing due to inactivity (and AVX has been implemented in many parts of the codebase such as matrices and float8)
from hlslpp.
Related Issues (20)
- GCC build error and MSVC warning on invalid cast of an rvalue HOT 4
- Fast affine inverse support HOT 3
- Rename vecN in the natvis to rowN HOT 1
- Move constructors are not auto-generated for matrix types anymore HOT 6
- type size and alignment HOT 2
- compatiblity with opengl? HOT 6
- Better inclusion manual for usage in existing project HOT 15
- uint1/2/3/4 store/load HOT 3
- Cast between types HOT 4
- Memory packing difference C++ <-> HLSL HOT 16
- Integer vector division is working incorrectly on Macs with Apple M1 (ARM) HOT 7
- Integer vector comparison is working incorrectly on Intel based Macs with MacOS >= 11 HOT 3
- Improve HLSL++ unit tests by using full-featured testing framework HOT 2
- Matrix accessor operator HOT 6
- operator / (float1, float3) looks inverted HOT 8
- How well does this cover HLSL202x? HOT 11
- * operator brake mult function in quaternion HOT 7
- Quaternion slerp returning nan values HOT 2
- Clang error: unused variable 't4' in hlsl++_quaternion.h HOT 6
- Upgrade warnings to errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hlslpp.