Skip to content

Commit 66efc56

Browse files
committed
clang format hotfix
1 parent 5fe124c commit 66efc56

File tree

2 files changed

+38
-28
lines changed

2 files changed

+38
-28
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -367,26 +367,26 @@ RT::PiProgram ProgramManager::createPIProgram(const RTDeviceBinaryImage &Img,
367367
}
368368

369369
static void addEsimdImageCompileOptions(std::string &CompileOpts) {
370-
if (!CompileOpts.empty())
371-
CompileOpts += " ";
372-
CompileOpts += "-vc-codegen";
370+
if (!CompileOpts.empty())
371+
CompileOpts += " ";
372+
CompileOpts += "-vc-codegen";
373373
}
374374

375375
static void applyLinkOptionsFromImage(std::string &LinkOpts,
376376
const RTDeviceBinaryImage &Img) {
377377
if (!LinkOpts.empty())
378-
LinkOpts += " ";
379-
const char* TemporaryStr = Img.getLinkOptions();
378+
LinkOpts += " ";
379+
const char *TemporaryStr = Img.getLinkOptions();
380380
if (TemporaryStr != nullptr)
381381
LinkOpts += std::string(TemporaryStr);
382382
}
383383

384-
static void applyCompileOptionsFromImage(std::string &CompileOpts,
385-
const RTDeviceBinaryImage &Img,
386-
const pi_device_binary_property &isEsimdImage = nullptr) {
384+
static void applyCompileOptionsFromImage(
385+
std::string &CompileOpts, const RTDeviceBinaryImage &Img,
386+
const pi_device_binary_property &isEsimdImage = nullptr) {
387387
if (!CompileOpts.empty())
388388
CompileOpts += " ";
389-
const char* TemporaryStr = Img.getCompileOptions();
389+
const char *TemporaryStr = Img.getCompileOptions();
390390
if (TemporaryStr != nullptr)
391391
CompileOpts += TemporaryStr;
392392
if (isEsimdImage) {
@@ -410,7 +410,8 @@ static void applyOptionsFromImage(std::string &CompileOpts,
410410
pi_device_binary_property isEsimdImage = Img.getProperty("isEsimdImage");
411411
if (!CompileOptsEnv) {
412412
applyCompileOptionsFromImage(CompileOpts, Img, isEsimdImage);
413-
} else if (isEsimdImage && pi::DeviceBinaryProperty(isEsimdImage).asUint32()) {
413+
} else if (isEsimdImage &&
414+
pi::DeviceBinaryProperty(isEsimdImage).asUint32()) {
414415
addEsimdImageCompileOptions(CompileOpts);
415416
}
416417

@@ -1008,8 +1009,8 @@ ProgramManager::ProgramPtr ProgramManager::build(
10081009
Options += " " + LinkOptions;
10091010
}
10101011
RT::PiResult Error = Plugin.call_nocheck<PiApiKind::piProgramBuild>(
1011-
Program.get(), /*num devices =*/1, &Device, Options.c_str(),
1012-
nullptr, nullptr);
1012+
Program.get(), /*num devices =*/1, &Device, Options.c_str(), nullptr,
1013+
nullptr);
10131014
if (Error != PI_SUCCESS)
10141015
throw compile_program_error(getProgramBuildLog(Program.get(), Context),
10151016
Error);
@@ -1730,7 +1731,8 @@ ProgramManager::link(const std::vector<device_image_plain> &DeviceImages,
17301731
for (const device_image_plain &DeviceImage : DeviceImages) {
17311732
const std::shared_ptr<device_image_impl> &InputImpl =
17321733
getSyclObjImpl(DeviceImage);
1733-
applyLinkOptionsFromImage(LinkOptionsStr, *(InputImpl->get_bin_image_ref()));
1734+
applyLinkOptionsFromImage(LinkOptionsStr,
1735+
*(InputImpl->get_bin_image_ref()));
17341736
}
17351737
const context &Context = getSyclObjImpl(DeviceImages[0])->get_context();
17361738
const ContextImplPtr ContextImpl = getSyclObjImpl(Context);

sycl/unittests/program_manager/passing_link_and_compile_options.cpp

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ inline pi_result redefinedProgramCompile(pi_program, pi_uint32,
140140
inline pi_result redefinedProgramBuild(
141141
pi_program prog, pi_uint32, const pi_device *, const char *options,
142142
void (*pfn_notify)(pi_program program, void *user_data), void *user_data) {
143-
assert(options != nullptr);
144-
current_build_opts = std::string(options);
143+
assert(options != nullptr);
144+
current_build_opts = std::string(options);
145145
return PI_SUCCESS;
146146
}
147147

@@ -186,7 +186,6 @@ TEST(Link_Compile_Options, compile_link_Options_Test_empty_options) {
186186
EXPECT_EQ(expected_options, current_compile_options);
187187
}
188188

189-
190189
TEST(Link_Compile_Options, compile_link_Options_Test_filled_options) {
191190
sycl::platform Plt{sycl::default_selector()};
192191
if (Plt.is_host()) {
@@ -211,12 +210,14 @@ TEST(Link_Compile_Options, compile_link_Options_Test_filled_options) {
211210
const sycl::device Dev = Plt.get_devices()[0];
212211
current_link_options.clear();
213212
current_compile_options.clear();
214-
std::string expected_compile_options_1 = "-cl-opt-disable -cl-fp32-correctly-rounded-divide-sqrt",
215-
expected_link_options_1 = "-cl-denorms-are-zero -cl-no-signed-zeros";
213+
std::string expected_compile_options_1 =
214+
"-cl-opt-disable -cl-fp32-correctly-rounded-divide-sqrt",
215+
expected_link_options_1 =
216+
"-cl-denorms-are-zero -cl-no-signed-zeros";
216217
static sycl::unittest::PiImage DevImage_1 =
217218
generateEAMTestKernel1Image<EAMTestKernel1>(expected_compile_options_1,
218219
expected_link_options_1);
219-
220+
220221
static sycl::unittest::PiImageArray<1> DevImageArray = {&DevImage_1};
221222
auto KernelID_1 = sycl::get_kernel_id<EAMTestKernel1>();
222223
sycl::queue Queue{Dev};
@@ -230,7 +231,8 @@ TEST(Link_Compile_Options, compile_link_Options_Test_filled_options) {
230231
EXPECT_EQ(expected_compile_options_1, current_compile_options);
231232
}
232233

233-
TEST(Link_Compile_Options, compile_link_Options_Test_two_devices_filled_options) {
234+
TEST(Link_Compile_Options,
235+
compile_link_Options_Test_two_devices_filled_options) {
234236
sycl::platform Plt{sycl::default_selector()};
235237
if (Plt.is_host()) {
236238
std::cerr << "Test is not supported on host, skipping\n";
@@ -255,7 +257,8 @@ TEST(Link_Compile_Options, compile_link_Options_Test_two_devices_filled_options)
255257
current_link_options.clear();
256258
current_compile_options.clear();
257259
std::string expected_compile_options_1 = "-cl-opt-disable",
258-
expected_compile_options_2 = "-cl-fp32-correctly-rounded-divide-sqrt",
260+
expected_compile_options_2 =
261+
"-cl-fp32-correctly-rounded-divide-sqrt",
259262
expected_link_options_1 = "-cl-denorms-are-zero",
260263
expected_link_options_2 = "-cl-no-signed-zeros";
261264
static sycl::unittest::PiImage DevImage_1 =
@@ -265,22 +268,26 @@ TEST(Link_Compile_Options, compile_link_Options_Test_two_devices_filled_options)
265268
generateEAMTestKernel2Image<EAMTestKernel2>(expected_compile_options_2,
266269
expected_link_options_2);
267270
static sycl::unittest::PiImage Images[] = {DevImage_1, DevImage_2};
268-
static sycl::unittest::PiImageArray<2> DevImageArray {Images};
269-
271+
static sycl::unittest::PiImageArray<2> DevImageArray{Images};
272+
270273
auto KernelID_1 = sycl::get_kernel_id<EAMTestKernel1>();
271274
auto KernelID_2 = sycl::get_kernel_id<EAMTestKernel2>();
272275
sycl::queue Queue{Dev_1};
273276
const sycl::context Ctx = Queue.get_context();
274277
sycl::kernel_bundle KernelBundle1 =
275-
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {Dev_1}, {KernelID_1});
278+
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {Dev_1},
279+
{KernelID_1});
276280
sycl::kernel_bundle KernelBundle2 =
277-
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {Dev_1}, {KernelID_2});
281+
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {Dev_1},
282+
{KernelID_2});
278283
auto BundleObj1 = sycl::compile(KernelBundle1);
279284
auto BundleObj2 = sycl::compile(KernelBundle2);
280285
sycl::link(BundleObj1);
281286
sycl::link(BundleObj2);
282-
EXPECT_EQ(expected_link_options_1 + " " + expected_link_options_2, current_link_options);
283-
EXPECT_EQ(expected_compile_options_1 + " " + expected_compile_options_2, current_compile_options);
287+
EXPECT_EQ(expected_link_options_1 + " " + expected_link_options_2,
288+
current_link_options);
289+
EXPECT_EQ(expected_compile_options_1 + " " + expected_compile_options_2,
290+
current_compile_options);
284291
}
285292

286293
TEST(Link_Compile_Options, check_sycl_build) {
@@ -321,5 +328,6 @@ TEST(Link_Compile_Options, check_sycl_build) {
321328
sycl::get_kernel_bundle<sycl::bundle_state::input>(Ctx, {Dev},
322329
{KernelID});
323330
sycl::build(KernelBundle);
324-
EXPECT_EQ(expected_compile_options + " " + expected_link_options, current_build_opts);
331+
EXPECT_EQ(expected_compile_options + " " + expected_link_options,
332+
current_build_opts);
325333
}

0 commit comments

Comments
 (0)