Skip to content

Commit 65ee744

Browse files
authored
[NFC] Clang-format fixes. (#14946)
Most likely the clang-format checker was down when #14575 ran CI, so a few changes non-clang-format-compliant made it in. Applying fixes to those. --------- Signed-off-by: Marcos Maronas <[email protected]>
1 parent 2b36042 commit 65ee744

File tree

10 files changed

+32
-35
lines changed

10 files changed

+32
-35
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10705,8 +10705,7 @@ static void addArgs(ArgStringList &DstArgs, const llvm::opt::ArgList &Alloc,
1070510705

1070610706
static bool supportDynamicLinking(const llvm::opt::ArgList &TCArgs) {
1070710707
if (TCArgs.hasFlag(options::OPT_fsycl_allow_device_dependencies,
10708-
options::OPT_fno_sycl_allow_device_dependencies,
10709-
false))
10708+
options::OPT_fno_sycl_allow_device_dependencies, false))
1071010709
return true;
1071110710
return false;
1071210711
}
@@ -10787,9 +10786,9 @@ static void getTripleBasedSYCLPostLinkOpts(const ToolChain &TC,
1078710786
options::OPT_fsycl_remove_unused_external_funcs,
1078810787
false) &&
1078910788
!isSYCLNativeCPU(TC)) &&
10790-
// When supporting dynamic linking, non-kernels in a device image can be called
10791-
!supportDynamicLinking(TCArgs) &&
10792-
!Triple.isNVPTX() && !Triple.isAMDGPU())
10789+
// When supporting dynamic linking, non-kernels in a device image can be
10790+
// called.
10791+
!supportDynamicLinking(TCArgs) && !Triple.isNVPTX() && !Triple.isAMDGPU())
1079310792
addArgs(PostLinkArgs, TCArgs, {"-emit-only-kernels-as-entry-points"});
1079410793

1079510794
if (!Triple.isAMDGCN())
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#include <iostream>
21
#include "a.hpp"
32
#include "b.hpp"
3+
#include <iostream>
44

55
SYCL_EXTERNAL int levelA(int val) {
66
#ifndef __SYCL_DEVICE_ONLY__
77
std::cerr << "Host symbol used" << std::endl;
88
return 0;
99
#endif
10-
val=levelB(val);
11-
return val|=(0xA<<0);
10+
val = levelB(val);
11+
return val |= (0xA << 0);
1212
}
1313

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#include <iostream>
21
#include "b.hpp"
32
#include "c.hpp"
3+
#include <iostream>
44

55
SYCL_EXTERNAL int levelB(int val) {
66
#ifndef __SYCL_DEVICE_ONLY__
77
std::cerr << "Host symbol used" << std::endl;
88
return 0;
99
#endif
10-
val=levelC(val);
11-
return val|=(0xB<<4);
10+
val = levelC(val);
11+
return val |= (0xB << 4);
1212
}
1313

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#include <iostream>
21
#include "c.hpp"
32
#include "d.hpp"
3+
#include <iostream>
44

55
SYCL_EXTERNAL int levelC(int val) {
66
#ifndef __SYCL_DEVICE_ONLY__
77
std::cerr << "Host symbol used" << std::endl;
88
return 0;
99
#endif
10-
val=levelD(val);
11-
return val|=(0xC<<8);
10+
val = levelD(val);
11+
return val |= (0xC << 8);
1212
}
1313

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#include <iostream>
21
#include "d.hpp"
2+
#include <iostream>
33

44
SYCL_EXTERNAL int levelD(int val) {
55
#ifndef __SYCL_DEVICE_ONLY__
66
std::cerr << "Host symbol used" << std::endl;
77
return 0;
88
#endif
9-
return val|=(0xD<<12);
9+
return val |= (0xD << 12);
1010
}
1111

sycl/test-e2e/DeviceDependencies/Inputs/wrapper.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include <sycl/detail/core.hpp>
21
#include "a.hpp"
32
#include <iostream>
3+
#include <sycl/detail/core.hpp>
44
#define EXPORT
55
#include "wrapper.hpp"
66

@@ -15,12 +15,12 @@ int wrapper() {
1515
queue q;
1616
q.submit([&](handler &cgh) {
1717
auto acc = buf.get_access(cgh);
18-
cgh.single_task<ExeKernel>([=]() {acc[0] = levelA(acc[0]);});
18+
cgh.single_task<ExeKernel>([=]() { acc[0] = levelA(acc[0]); });
1919
});
2020
}
2121

2222
std::cout << "val=" << std::hex << val << "\n";
23-
if (val!=0xDCBA)
24-
return (1);
25-
return(0);
23+
if (val != 0xDCBA)
24+
return (1);
25+
return (0);
2626
}

sycl/test-e2e/DeviceDependencies/Inputs/wrapper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ __declspec(dllexport)
55
__declspec(dllimport)
66
#endif
77
#endif
8-
int wrapper();
8+
int wrapper();

sycl/test-e2e/DeviceDependencies/dynamic.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
// RUN: %{build} -fsycl-allow-device-dependencies -L%T -ldevice_a -ldevice_b -ldevice_c -ldevice_d -I %S/Inputs -o %t.out -Wl,-rpath=%T
1111
// RUN: %{run} %t.out
1212

13-
#include <sycl/detail/core.hpp>
1413
#include "a.hpp"
1514
#include <iostream>
15+
#include <sycl/detail/core.hpp>
1616

1717
using namespace sycl;
1818

@@ -25,12 +25,12 @@ int main() {
2525
queue q;
2626
q.submit([&](handler &cgh) {
2727
auto acc = buf.get_access(cgh);
28-
cgh.single_task<ExeKernel>([=]() {acc[0] = levelA(acc[0]);});
28+
cgh.single_task<ExeKernel>([=]() { acc[0] = levelA(acc[0]); });
2929
});
3030
}
3131

3232
std::cout << "val=" << std::hex << val << "\n";
33-
if (val!=0xDCBA)
34-
return (1);
35-
return(0);
33+
if (val != 0xDCBA)
34+
return (1);
35+
return (0);
3636
}

sycl/test-e2e/DeviceDependencies/objects.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// RUN: %{build} -fsycl-allow-device-dependencies %t_a.o %t_b.o %t_c.o %t_d.o -I %S/Inputs -o %t.out
1010
// RUN: %{run} %t.out
1111

12-
#include <sycl/detail/core.hpp>
1312
#include "a.hpp"
1413
#include <iostream>
14+
#include <sycl/detail/core.hpp>
1515

1616
using namespace sycl;
1717

@@ -24,12 +24,12 @@ int main() {
2424
queue q;
2525
q.submit([&](handler &cgh) {
2626
auto acc = buf.get_access(cgh);
27-
cgh.single_task<ExeKernel>([=]() {acc[0] = levelA(acc[0]);});
27+
cgh.single_task<ExeKernel>([=]() { acc[0] = levelA(acc[0]); });
2828
});
2929
}
3030

3131
std::cout << "val=" << std::hex << val << "\n";
32-
if (val!=0xDCBA)
33-
return (1);
34-
return(0);
32+
if (val != 0xDCBA)
33+
return (1);
34+
return (0);
3535
}

sycl/test-e2e/DeviceDependencies/singleDynamicLibrary.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,4 @@
2121

2222
#include "wrapper.hpp"
2323

24-
int main() {
25-
return(wrapper());
26-
}
24+
int main() { return (wrapper()); }

0 commit comments

Comments
 (0)