summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-06-13 17:30:16 -0400
committerGitHub <noreply@github.com>2024-06-13 17:30:16 -0400
commitfba316f0e7dacc7f93bee3a95fb93b2ab02bdd80 (patch)
tree4687141e1581193de2d6990122c3190d3c2fcc9f /source/slang/slang-lower-to-ir.cpp
parentf0d40ad5e1d0a0dec39fe8a141d3f81d88fc576a (diff)
Remove `IRHLSLExportDecoration` and `IRKeepAliveDecoration` for non-CUDA/Torch targets (#4364)
* Remove `IRHLSLExportDecoration` and `IRKeepAliveDecoration` for non-CUDA/Torch targets * Update hlsl-torch-cross-compile.slang
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index f8faf7c07..cc4704fe9 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -1385,21 +1385,27 @@ static void addLinkageDecoration(
{
builder->addCudaKernelDecoration(inst);
builder->addExternCppDecoration(inst, decl->getName()->text.getUnownedSlice());
- builder->addHLSLExportDecoration(inst);
+
+ // Temp decorations to get this function through the linker.
builder->addKeepAliveDecoration(inst);
+ builder->addHLSLExportDecoration(inst);
}
else if (as<TorchEntryPointAttribute>(modifier))
{
builder->addTorchEntryPointDecoration(inst, decl->getName()->text.getUnownedSlice());
builder->addCudaHostDecoration(inst);
- builder->addHLSLExportDecoration(inst);
- builder->addKeepAliveDecoration(inst);
builder->addExternCppDecoration(inst, decl->getName()->text.getUnownedSlice());
+
+ // Temp decorations to get this function through the linker.
+ builder->addKeepAliveDecoration(inst);
+ builder->addHLSLExportDecoration(inst);
}
else if (as<AutoPyBindCudaAttribute>(modifier))
{
builder->addAutoPyBindCudaDecoration(inst, decl->getName()->text.getUnownedSlice());
builder->addAutoPyBindExportInfoDecoration(inst);
+
+ // Temp decorations to get this function through the linker.
builder->addKeepAliveDecoration(inst);
builder->addHLSLExportDecoration(inst);
}