From 7f11f883d0781952f002b3aa3222a3aa0040f18a Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 17 Mar 2023 15:57:22 -0700 Subject: Add support for emitting cuda kernel and host functions. (#2712) * Add support for emitting cuda kernel and host functions. * Update test. * Fix cuda preamble emit. --------- Co-authored-by: Yong He --- source/slang/slang-options.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index f6932b9e0..714e2c99d 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -2189,10 +2189,12 @@ struct OptionsParser } // If we don't have any raw outputs but do have a raw target, - // and output type is callable, add an empty' rawOutput. + // add an empty' rawOutput for certain targets where the expected behavior is obvious. if (rawOutputs.getCount() == 0 && rawTargets.getCount() == 1 && - ArtifactDescUtil::makeDescForCompileTarget(asExternal(rawTargets[0].format)).kind == ArtifactKind::HostCallable) + (rawTargets[0].format == CodeGenTarget::HostCPPSource || + rawTargets[0].format == CodeGenTarget::CUDASource || + ArtifactDescUtil::makeDescForCompileTarget(asExternal(rawTargets[0].format)).kind == ArtifactKind::HostCallable)) { RawOutput rawOutput; rawOutput.impliedFormat = rawTargets[0].format; -- cgit v1.2.3