summaryrefslogtreecommitdiff
path: root/prelude
diff options
context:
space:
mode:
authorArielG-NV <159081215+ArielG-NV@users.noreply.github.com>2024-07-19 02:04:26 -0400
committerGitHub <noreply@github.com>2024-07-18 23:04:26 -0700
commit59dd133f1c52fb0a7a388f4a8f42234f4556a28a (patch)
tree02556f1660713ebc1272dec9e0e9766ee0999286 /prelude
parent6e7c726658c775e97578e7a9dd99d23b819870bd (diff)
Allow CPP/CUDA/Metal to lower/legalize buffer-elements to support column_major/row_major. (#4653)
* Allow CPP/CUDA/Metal to legalize their buffer-elements. Fixes: #4537 Changes: 1. Matrix inputs require legalization (pack/unpack) to ensure consistent row_major/column_major throughout entire shader, the following enabled legalization pass fixes this. 2. Added missing CUDA intrinsic so CUDA can run more tests. 3. Added a memory packing test since this still fails for cpp/cuda/metal (due to having no memory packing enforcement). * change memory packing tests to run for targets without packing --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'prelude')
-rw-r--r--prelude/slang-cuda-prelude.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h
index 74a9d0cec..89f33e24b 100644
--- a/prelude/slang-cuda-prelude.h
+++ b/prelude/slang-cuda-prelude.h
@@ -207,6 +207,12 @@ union Union64
double d;
};
+template<typename T>
+SLANG_FORCE_INLINE SLANG_CUDA_CALL float make_float(T val)
+{
+ return (float)val;
+}
+
SLANG_FORCE_INLINE SLANG_CUDA_CALL float _slang_fmod(float x, float y)
{
return ::fmodf(x, y);