summaryrefslogtreecommitdiff
path: root/prelude
diff options
context:
space:
mode:
Diffstat (limited to 'prelude')
-rw-r--r--prelude/slang-cuda-prelude.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h
new file mode 100644
index 000000000..ac299eac0
--- /dev/null
+++ b/prelude/slang-cuda-prelude.h
@@ -0,0 +1,12 @@
+#line 1 "slang-cuda-prelude.h"
+
+#define SLANG_PRELUDE_ASSERT(x)
+
+template <typename T, size_t SIZE>
+struct FixedArray
+{
+ __device__ const T& operator[](size_t index) const { SLANG_PRELUDE_ASSERT(index < SIZE); return m_data[index]; }
+ __device__ T& operator[](size_t index) { SLANG_PRELUDE_ASSERT(index < SIZE); return m_data[index]; }
+
+ T m_data[SIZE];
+}; \ No newline at end of file