summaryrefslogtreecommitdiffstats
path: root/prelude/slang-cpp-prelude.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-06-08 19:51:49 -0400
committerGitHub <noreply@github.com>2022-06-08 19:51:49 -0400
commit4db6bd3cd6da1871fdac520c280bd9f933e48489 (patch)
treee4e1bf347a1ceac708ce598af7d4ca4bab71e013 /prelude/slang-cpp-prelude.h
parent1146920bc9ed9bef2b5bb91b3cdec4700eb09881 (diff)
Improved bounds checking for C++/CUDA (#2263)
* #include an absolute path didn't work - because paths were taken to always be relative. * Use TerminatedUnownedStringSlice for literals in output C++. * Remove Escape/Unescape functions used in slang-token-reader.cpp Add target type of 'host-cpp' etc to map to the target types. * Fix some corner cases around string encoding. * Added unit test for string escaping. Fixed some assorted escaping bugs. * Updated test output. * Added decode test. * Stop using hex output, to get around 'greedy' aspect. Use octal instead. * Added HostHostCallable Small changes to use ArtifactDesc/Info instead of large switches. * Fix C++ emit to handle arbitrary function export. * Add options handling for callable without an output being specified. * Can compile with COM interface. Added example using com interface. * Use the IR Ptr type instead of hack in C++ emit for interfaces. * Fix issue with outputting the COM call when ptr is used. * Fix crash issue on compilation failure. * Add support for __global. * Added `ActualGlobalRate` Added special handling around globals and COM interfaces. Tested out in cpu-com-example. * Fix typo in NodeBase. * Support for accessing globals by name working. * Bounds checking for C++ Improved bounds checks for CUDA. * Check that actual global initialization is working. * Fix typo. * Refactor the com replacement such that it doesn't need a cache or do anything special with GlobalVar. * Fix typo in CUDA prelude. * Remove context. Only create replacement if needed. * Split out COM host-callable into a unit-test. * host-callable com testing on C++and llvm. * Comment around the COM ptr replacement. * WIP Zero bound test. * Disable com test on vs 32 bit. Fix C++ prelude * Disable 32 bit targets testing com host-callable. * For now disable zero index test. * Enable bounds checking for CPU/CUDA. * Small fixes. Disable CUDA zero index bound fix. * Add test result for bound check. * Work around for index wrapping issue. * Added Fixed array test. * Only enable prelude asserts via SLANG_PRELUDE_ENABLE_ASSERT (unless defined by the user)
Diffstat (limited to 'prelude/slang-cpp-prelude.h')
-rw-r--r--prelude/slang-cpp-prelude.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/prelude/slang-cpp-prelude.h b/prelude/slang-cpp-prelude.h
index ff6bb8f6f..0381a7bb6 100644
--- a/prelude/slang-cpp-prelude.h
+++ b/prelude/slang-cpp-prelude.h
@@ -194,7 +194,6 @@ Any platforms not detected by the above logic are now now explicitly zeroed out.
# endif
#endif /* SLANG_PLATFORM */
-
/* Shorthands for "families" of compilers/platforms */
#define SLANG_GCC_FAMILY (SLANG_CLANG || SLANG_SNC || SLANG_GHS || SLANG_GCC)
#define SLANG_WINDOWS_FAMILY (SLANG_WINRT || SLANG_WIN32 || SLANG_WIN64)
@@ -249,8 +248,12 @@ convention for interface methods.
# define SLANG_MCALL SLANG_STDCALL
#endif
+#ifndef SLANG_FORCE_INLINE
+# define SLANG_FORCE_INLINE inline
+#endif
-
+// TODO(JS): Should these be in slang-cpp-types.h?
+// They are more likely to clash with slang.h
struct SlangUUID
{
@@ -271,6 +274,8 @@ struct ISlangUnknown
#endif // SLANG_H
+// Includes
+
#include "slang-cpp-types.h"
#include "slang-cpp-scalar-intrinsics.h"