@@ -1179,14 +1179,11 @@ build_from_source(kernel_bundle<bundle_state::ext_oneapi_source> &SourceKB,
1179
1179
const std::vector<std::string> &BuildOptions,
1180
1180
std::string *LogPtr,
1181
1181
const std::vector<std::string> &RegisteredKernelNames) {
1182
- std::vector<sycl::detail::string_view> Options;
1183
- Options.reserve (BuildOptions.size ());
1184
- for (const std::string &opt : BuildOptions)
1185
- Options.push_back (sycl::detail::string_view{opt});
1182
+ std::vector<sycl::detail::string_view> Options{BuildOptions.begin (),
1183
+ BuildOptions.end ()};
1186
1184
1187
- std::vector<sycl::detail::string_view> KernelNames;
1188
- for (const std::string &name : RegisteredKernelNames)
1189
- KernelNames.push_back (sycl::detail::string_view{name});
1185
+ std::vector<sycl::detail::string_view> KernelNames{
1186
+ RegisteredKernelNames.begin (), RegisteredKernelNames.end ()};
1190
1187
1191
1188
if (LogPtr) {
1192
1189
sycl::detail::string Log;
@@ -1211,15 +1208,11 @@ compile_from_source(kernel_bundle<bundle_state::ext_oneapi_source> &SourceKB,
1211
1208
const std::vector<std::string> &CompileOptions,
1212
1209
std::string *LogPtr,
1213
1210
const std::vector<std::string> &RegisteredKernelNames) {
1214
- std::vector<sycl::detail::string_view> Options;
1215
- Options.reserve (CompileOptions.size ());
1216
- for (const std::string &opt : CompileOptions)
1217
- Options.push_back (sycl::detail::string_view{opt});
1218
-
1219
- std::vector<sycl::detail::string_view> KernelNames;
1220
- KernelNames.reserve (RegisteredKernelNames.size ());
1221
- for (const std::string &name : RegisteredKernelNames)
1222
- KernelNames.push_back (sycl::detail::string_view{name});
1211
+ std::vector<sycl::detail::string_view> Options{CompileOptions.begin (),
1212
+ CompileOptions.end ()};
1213
+
1214
+ std::vector<sycl::detail::string_view> KernelNames{
1215
+ RegisteredKernelNames.begin (), RegisteredKernelNames.end ()};
1223
1216
1224
1217
sycl::detail::string Log;
1225
1218
auto result = compile_from_source (SourceKB, Devices, Options,
0 commit comments