summaryrefslogtreecommitdiffstats
path: root/prelude
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-07-12 14:07:10 -0700
committerGitHub <noreply@github.com>2023-07-12 14:07:10 -0700
commit4ed3aafa20b667329f2f9dea94d7c65dc2e80db4 (patch)
treef7f972d320a5cc24221ca8b2e775b7dbfeafb1fe /prelude
parent39b7df94b287b2115f41ca038d560102246d0696 (diff)
Fix native string emit for CUDA/Cpp backend. (#2980)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'prelude')
-rw-r--r--prelude/slang-cuda-prelude.h1
-rw-r--r--prelude/slang-torch-prelude.h30
2 files changed, 16 insertions, 15 deletions
diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h
index 0362a3a67..0b56b8a71 100644
--- a/prelude/slang-cuda-prelude.h
+++ b/prelude/slang-cuda-prelude.h
@@ -11,6 +11,7 @@
#else
#include <cstdint>
+#include <stdio.h>
#endif
diff --git a/prelude/slang-torch-prelude.h b/prelude/slang-torch-prelude.h
index 0a69b8305..0de06750c 100644
--- a/prelude/slang-torch-prelude.h
+++ b/prelude/slang-torch-prelude.h
@@ -7,20 +7,6 @@
#include <stdexcept>
#include <string>
-#ifndef SLANG_NO_THROW
-# define SLANG_NO_THROW
-#endif
-
-#ifndef SLANG_STDCALL
-# define SLANG_STDCALL
-#endif
-#ifndef SLANG_MCALL
-# define SLANG_MCALL SLANG_STDCALL
-#endif
-#ifndef SLANG_FORCE_INLINE
-# define SLANG_FORCE_INLINE inline
-#endif
-
#ifdef SLANG_LLVM
#include "slang-llvm.h"
#else // SLANG_LLVM
@@ -38,6 +24,8 @@
# include <stdint.h>
#endif // SLANG_LLVM
+#include "../source/core/slang-string.h"
+
#if defined(_MSC_VER)
# define SLANG_PRELUDE_SHARED_LIB_EXPORT __declspec(dllexport)
#else
@@ -55,12 +43,24 @@
# define SLANG_PRELUDE_EXTERN_C_END
#endif
-
#define SLANG_PRELUDE_NAMESPACE
+#ifndef SLANG_NO_THROW
+# define SLANG_NO_THROW
+#endif
+#ifndef SLANG_STDCALL
+# define SLANG_STDCALL
+#endif
+#ifndef SLANG_MCALL
+# define SLANG_MCALL SLANG_STDCALL
+#endif
+#ifndef SLANG_FORCE_INLINE
+# define SLANG_FORCE_INLINE inline
+#endif
#include "slang-cpp-types-core.h"
#include "slang-cpp-scalar-intrinsics.h"
+
static const int kSlangTorchTensorMaxDim = 5;
struct TensorView