diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-01-21 09:38:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-21 09:38:10 -0500 |
| commit | 47392bc72b826b4ad427b703391a77e697735a65 (patch) | |
| tree | 7c541c4295742b765124f42bab9f713276c83580 /prelude/slang-cpp-types.h | |
| parent | a8669ade5cb3add8b9ce08e2c3bd96e93190bca8 (diff) | |
CUDA support improvements (#1168)
* Add test result for compile-to-cuda
* Add RAII for some CUDA types to simplify usage.
* First pass handling of some instrinsics on CUDA (for example transcendentals)
* CUDA working with built in intrinsics.
* Add missing CUDA prelude intrinsics.
* CUDA matches CPU output on simple-cross-compile.slang
* First pass at hlsl-scalar-float-intrinsic.slang test.
* Fix smoothstep impl on CUDA and CPU.
* Fixed step intrinsic on CUDA/CPU.
* Added operator[] to Matrix for C++, to allow row access.
Needs a fix for CUDA.
* Fixed warning on clang build.
Diffstat (limited to 'prelude/slang-cpp-types.h')
| -rw-r--r-- | prelude/slang-cpp-types.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/prelude/slang-cpp-types.h b/prelude/slang-cpp-types.h index 67db607f6..a7ecf5991 100644 --- a/prelude/slang-cpp-types.h +++ b/prelude/slang-cpp-types.h @@ -82,6 +82,9 @@ typedef Vector<uint32_t, 4> uint4; template <typename T, int ROWS, int COLS> struct Matrix { + Vector<T, COLS>& operator[](int i) { SLANG_PRELUDE_ASSERT(i >= 0 && i < ROWS); return rows[i]; } + const Vector<T, COLS>& operator[](int i) const { SLANG_PRELUDE_ASSERT(i >= 0 && i < ROWS); return rows[i]; } + Vector<T, COLS> rows[ROWS]; }; |
