Skip to content

Commit 16088b9

Browse files
committed
Reduce device_capabilities_traits_jit.h instructions & use std::ostringstream for generated line, make it build with Clang(CL) 19.1.1
1 parent c1cc48b commit 16088b9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/nbl/device/DeviceGen.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def buildTraitsHeader(**params):
562562
res.append(emptyline)
563563

564564
if 'enable_jit' in params and params['enable_jit']:
565-
res.append("std::string jit_traits = R\"===(")
565+
res.append("std::ostringstream oss;")
566566

567567
buildTraitsHeaderHelper(
568568
res,
@@ -582,7 +582,7 @@ def buildTraitsHeader(**params):
582582
)
583583

584584
if 'enable_jit' in params and params['enable_jit']:
585-
res.append(")===\";")
585+
res.append("std::string jit_traits = oss.str();")
586586

587587
return res
588588

src/nbl/device/gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
args.jit_traits_output_path,
121121
buildTraitsHeader,
122122
type="JIT Members",
123-
template="NBL_CONSTEXPR_STATIC_INLINE {} {} = )===\" + std::string(\"({})\") + CJITIncludeLoader::to_string({}.{}) + R\"===(;",
123+
template="oss << \"NBL_CONSTEXPR_STATIC_INLINE {} {} = ({})\" + CJITIncludeLoader::to_string({}.{});",
124124
limits_json=limits,
125125
features_json=features,
126126
format_params=["type", "name", "type", "json_type", "cpp_name"],

src/nbl/video/CJITIncludeLoader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ std::string CJITIncludeLoader::collectDeviceCaps(const SPhysicalDeviceLimits& li
4949

5050
return start + jit_traits + end;
5151
}
52-
}
52+
}

0 commit comments

Comments
 (0)