Skip to content

Commit 84497b0

Browse files
author
Martin Wehking
committed
Refactor with clang-format
1 parent 39ac1d6 commit 84497b0

File tree

13 files changed

+28
-19
lines changed

13 files changed

+28
-19
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5533,7 +5533,7 @@ class OffloadingActionBuilder final {
55335533
// AOT compilation.
55345534
bool SYCLDeviceLibLinked = false;
55355535
Action *NativeCPULib = nullptr;
5536-
if (IsSPIR || IsNVPTX || IsAMDGCN|| IsSYCLNativeCPU) {
5536+
if (IsSPIR || IsNVPTX || IsAMDGCN || IsSYCLNativeCPU) {
55375537
bool UseJitLink =
55385538
IsSPIR &&
55395539
Args.hasFlag(options::OPT_fsycl_device_lib_jit_link,
@@ -5849,8 +5849,8 @@ class OffloadingActionBuilder final {
58495849
Arg *InputArg = MakeInputArg(Args, C.getDriver().getOpts(),
58505850
Args.MakeArgString(LibName));
58515851
if (TC->getTriple().isSPIR() &&
5852-
TC->getTriple().getSubArch() ==
5853-
llvm::Triple::SPIRSubArch_fpga) {
5852+
TC->getTriple().getSubArch() ==
5853+
llvm::Triple::SPIRSubArch_fpga) {
58545854
auto *SYCLDeviceLibsInputAction =
58555855
C.MakeAction<InputAction>(*InputArg, types::TY_Object);
58565856
auto *SYCLDeviceLibsUnbundleAction =

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@ static bool selectBfloatLibs(const llvm::Triple &Triple, const Compilation &C,
166166
// spir64 target is actually JIT compilation, so we defer selection of
167167
// bfloat16 libraries to runtime. For AOT we need libraries, but skip
168168
// for Nvidia and AMD.
169-
NeedLibs =
170-
Triple.getSubArch() != llvm::Triple::NoSubArch && !Triple.isNVPTX()
171-
&& !Triple.isAMDGCN();
169+
NeedLibs = Triple.getSubArch() != llvm::Triple::NoSubArch &&
170+
!Triple.isNVPTX() && !Triple.isAMDGCN();
172171
UseNative = false;
173172
if (NeedLibs && Triple.getSubArch() == llvm::Triple::SPIRSubArch_gen &&
174173
C.hasOffloadToolChain<Action::OFK_SYCL>()) {
@@ -242,7 +241,8 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
242241
for (StringRef Val : A->getValues()) {
243242
if (Val == "all") {
244243
for (const auto &K : DeviceLibLinkInfo.keys())
245-
DeviceLibLinkInfo[K] = (!ignore_single_libs && !NoDeviceLibs) || (K == "internal" && NoDeviceLibs) ;
244+
DeviceLibLinkInfo[K] = (!ignore_single_libs && !NoDeviceLibs) ||
245+
(K == "internal" && NoDeviceLibs);
246246
printUnusedLibWarning = false;
247247
break;
248248
}
@@ -259,7 +259,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
259259
}
260260
if (printUnusedLibWarning)
261261
C.getDriver().Diag(diag::warn_ignored_clang_option)
262-
<< A->getSpelling() << A->getAsString(Args);
262+
<< A->getSpelling() << A->getAsString(Args);
263263
}
264264
}
265265

libdevice/cmath_wrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
#include "device_math.h"
1010

11-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
11+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
12+
defined(__AMDGCN__)
1213

1314
DEVICE_EXTERN_C_INLINE
1415
int abs(int x) { return __devicelib_abs(x); }

libdevice/cmath_wrapper_fp64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#include "device_math.h"
1111

12-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
12+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
13+
defined(__AMDGCN__)
1314

1415
// All exported functions in math and complex device libraries are weak
1516
// reference. If users provide their own math or complex functions(with

libdevice/crt_wrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
DeviceGlobal<uint64_t[RAND_NEXT_LEN]> RandNext;
1818
#endif
1919

20-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
20+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
21+
defined(__AMDGCN__)
2122
DEVICE_EXTERN_C_INLINE
2223
void *memcpy(void *dest, const void *src, size_t n) {
2324
return __devicelib_memcpy(dest, src, n);

libdevice/device.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#define EXTERN_C
1616
#endif // __cplusplus
1717

18-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
18+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
19+
defined(__AMDGCN__)
1920
#ifdef __SYCL_DEVICE_ONLY__
2021
#define DEVICE_EXTERNAL SYCL_EXTERNAL __attribute__((weak))
2122
#else // __SYCL_DEVICE_ONLY__

libdevice/device_math.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#define __LIBDEVICE_DEVICE_MATH_H__
1111

1212
#include "device.h"
13-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
13+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
14+
defined(__AMDGCN__)
1415
#include <cstdint>
1516

1617
typedef struct {

libdevice/fallback-cassert.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ DEVICE_EXTERN_C void __devicelib_assert_fail(const char *expr, const char *file,
100100
}
101101
#endif // __SPIR__ || __SPIRV__
102102

103-
104103
#if defined(__NVPTX__) || defined(__AMDGCN__)
105104

106105
DEVICE_EXTERN_C void __assertfail(const char *__message, const char *__file,

libdevice/fallback-cmath-fp64.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#include "device_math.h"
1111

12-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
12+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
13+
defined(__AMDGCN__)
1314

1415
// To support fallback device libraries on-demand loading, please update the
1516
// DeviceLibFuncMap in llvm/tools/sycl-post-link/sycl-post-link.cpp if you add

libdevice/fallback-cmath.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
#include "device_math.h"
1010

11-
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || defined(__AMDGCN__)
11+
#if defined(__SPIR__) || defined(__SPIRV__) || defined(__NVPTX__) || \
12+
defined(__AMDGCN__)
1213

1314
// To support fallback device libraries on-demand loading, please update the
1415
// DeviceLibFuncMap in llvm/tools/sycl-post-link/sycl-post-link.cpp if you add

0 commit comments

Comments
 (0)