Skip to content

Commit 30313e2

Browse files
author
Alexander Batashev
committed
clang-format
1 parent c678a65 commit 30313e2

21 files changed

+73
-97
lines changed

sycl/include/CL/sycl/ONEAPI/reduction.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,8 +1584,9 @@ size_t reduAuxCGFunc(handler &CGH, size_t NWorkItems, size_t MaxWGSize,
15841584
return NWorkGroups;
15851585
}
15861586

1587-
inline void reduSaveFinalResultToUserMemHelper(
1588-
std::vector<event> &, std::shared_ptr<detail::queue_impl>, bool) {}
1587+
inline void
1588+
reduSaveFinalResultToUserMemHelper(std::vector<event> &,
1589+
std::shared_ptr<detail::queue_impl>, bool) {}
15891590

15901591
template <typename Reduction, typename... RestT>
15911592
std::enable_if_t<Reduction::is_usm>

sycl/include/CL/sycl/detail/common_info.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace sycl {
1515
namespace detail {
1616

1717
std::vector<std::string> __SYCL_EXPORT split_string(const std::string &str,
18-
char delimeter);
18+
char delimeter);
1919

2020
} // namespace detail
2121
} // namespace sycl

sycl/include/CL/sycl/handler.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,9 +2284,8 @@ class __SYCL_EXPORT handler {
22842284
template <typename Reduction, typename... RestT>
22852285
std::enable_if_t<!Reduction::is_usm> friend ONEAPI::detail::
22862286
reduSaveFinalResultToUserMemHelper(
2287-
std::vector<event> &Events,
2288-
std::shared_ptr<detail::queue_impl> Queue, bool IsHost, Reduction &,
2289-
RestT...);
2287+
std::vector<event> &Events, std::shared_ptr<detail::queue_impl> Queue,
2288+
bool IsHost, Reduction &, RestT...);
22902289

22912290
friend void detail::associateWithHandler(handler &,
22922291
detail::AccessorBaseHost *,

sycl/include/CL/sycl/info/info_desc.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ enum class device : cl_device_info {
8787
global_mem_cache_line_size = CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE,
8888
global_mem_cache_size = CL_DEVICE_GLOBAL_MEM_CACHE_SIZE,
8989
global_mem_size = CL_DEVICE_GLOBAL_MEM_SIZE,
90-
max_constant_buffer_size __SYCL2020_DEPRECATED("max_constant_buffer_size is deprecated") = CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE,
91-
max_constant_args __SYCL2020_DEPRECATED("max_constant_args is deprecated") = CL_DEVICE_MAX_CONSTANT_ARGS,
90+
max_constant_buffer_size __SYCL2020_DEPRECATED(
91+
"max_constant_buffer_size is deprecated") =
92+
CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE,
93+
max_constant_args __SYCL2020_DEPRECATED("max_constant_args is deprecated") =
94+
CL_DEVICE_MAX_CONSTANT_ARGS,
9295
local_mem_type = CL_DEVICE_LOCAL_MEM_TYPE,
9396
local_mem_size = CL_DEVICE_LOCAL_MEM_SIZE,
9497
error_correction_support = CL_DEVICE_ERROR_CORRECTION_SUPPORT,

sycl/include/CL/sycl/item.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ template <int dimensions = 1, bool with_offset = true> class item {
7575

7676
template <bool has_offset = with_offset>
7777
__SYCL2020_DEPRECATED("offsets are deprecated in SYCL2020")
78-
detail::enable_if_t<has_offset, size_t>
79-
__SYCL_ALWAYS_INLINE get_offset(int dimension) const {
78+
detail::enable_if_t<has_offset, size_t> __SYCL_ALWAYS_INLINE
79+
get_offset(int dimension) const {
8080
size_t Id = MImpl.MOffset[dimension];
8181
__SYCL_ASSUME_INT(Id);
8282
return Id;

sycl/include/CL/sycl/kernel_bundle.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -682,17 +682,15 @@ template <> struct hash<cl::sycl::kernel_id> {
682682
template <cl::sycl::bundle_state State>
683683
struct hash<cl::sycl::device_image<State>> {
684684
size_t operator()(const cl::sycl::device_image<State> &DeviceImage) const {
685-
return hash<
686-
std::shared_ptr<cl::sycl::detail::device_image_impl>>()(
685+
return hash<std::shared_ptr<cl::sycl::detail::device_image_impl>>()(
687686
cl::sycl::detail::getSyclObjImpl(DeviceImage));
688687
}
689688
};
690689

691690
template <cl::sycl::bundle_state State>
692691
struct hash<cl::sycl::kernel_bundle<State>> {
693692
size_t operator()(const cl::sycl::kernel_bundle<State> &KernelBundle) const {
694-
return hash<
695-
std::shared_ptr<cl::sycl::detail::kernel_bundle_impl>>()(
693+
return hash<std::shared_ptr<cl::sycl::detail::kernel_bundle_impl>>()(
696694
cl::sycl::detail::getSyclObjImpl(KernelBundle));
697695
}
698696
};

sycl/include/CL/sycl/nd_range.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ template <int dimensions = 1> class nd_range {
3434
: globalSize(globalSize), localSize(localSize), offset(offset) {}
3535

3636
nd_range(range<dimensions> globalSize, range<dimensions> localSize)
37-
: globalSize(globalSize), localSize(localSize), offset(id<dimensions>()) {}
37+
: globalSize(globalSize), localSize(localSize), offset(id<dimensions>()) {
38+
}
3839

3940
range<dimensions> get_global_range() const { return globalSize; }
4041

sycl/include/CL/sycl/program.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ class __SYCL_EXPORT __SYCL2020_DEPRECATED(
7575
///
7676
/// \param ProgramList is a list of SYCL program instances.
7777
/// \param PropList is an instance of property_list.
78-
program(std::vector<program> ProgramList,
79-
const property_list &PropList = {});
78+
program(std::vector<program> ProgramList, const property_list &PropList = {});
8079

8180
/// Constructs an instance of SYCL program by linking together each SYCL
8281
/// program instance in ProgramList.
@@ -405,8 +404,7 @@ class __SYCL_EXPORT __SYCL2020_DEPRECATED(
405404
/// \param KernelName is a stringified kernel name.
406405
/// \param CompileOptions is a string of valid OpenCL compile options.
407406
/// \param M is a valid OS handle to the user executable or library.
408-
void build_with_kernel_name(std::string KernelName,
409-
std::string buildOptions,
407+
void build_with_kernel_name(std::string KernelName, std::string buildOptions,
410408
detail::OSModuleHandle M);
411409

412410
void set_spec_constant_impl(const char *Name, void *Data, size_t Size);

sycl/include/CL/sycl/queue.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,7 @@ class __SYCL_EXPORT queue {
513513
/// \param KernelFunc is the Kernel functor or lambda
514514
/// \param CodeLoc contains the code location of user code
515515
template <typename KernelName = detail::auto_name, typename KernelType>
516-
event parallel_for(range<1> NumWorkItems,
517-
const std::vector<event> &DepEvents,
516+
event parallel_for(range<1> NumWorkItems, const std::vector<event> &DepEvents,
518517
_KERNELFUNCPARAM(KernelFunc) _CODELOCPARAM(&CodeLoc)) {
519518
_CODELOCARG(&CodeLoc);
520519
return parallel_for_impl<KernelName>(NumWorkItems, DepEvents, KernelFunc,
@@ -530,8 +529,7 @@ class __SYCL_EXPORT queue {
530529
/// \param KernelFunc is the Kernel functor or lambda
531530
/// \param CodeLoc contains the code location of user code
532531
template <typename KernelName = detail::auto_name, typename KernelType>
533-
event parallel_for(range<2> NumWorkItems,
534-
const std::vector<event> &DepEvents,
532+
event parallel_for(range<2> NumWorkItems, const std::vector<event> &DepEvents,
535533
_KERNELFUNCPARAM(KernelFunc) _CODELOCPARAM(&CodeLoc)) {
536534
_CODELOCARG(&CodeLoc);
537535
return parallel_for_impl<KernelName>(NumWorkItems, DepEvents, KernelFunc,
@@ -547,8 +545,7 @@ class __SYCL_EXPORT queue {
547545
/// \param KernelFunc is the Kernel functor or lambda
548546
/// \param CodeLoc contains the code location of user code
549547
template <typename KernelName = detail::auto_name, typename KernelType>
550-
event parallel_for(range<3> NumWorkItems,
551-
const std::vector<event> &DepEvents,
548+
event parallel_for(range<3> NumWorkItems, const std::vector<event> &DepEvents,
552549
_KERNELFUNCPARAM(KernelFunc) _CODELOCPARAM(&CodeLoc)) {
553550
_CODELOCARG(&CodeLoc);
554551
return parallel_for_impl<KernelName>(NumWorkItems, DepEvents, KernelFunc,
@@ -823,8 +820,7 @@ class __SYCL_EXPORT queue {
823820
namespace std {
824821
template <> struct hash<cl::sycl::queue> {
825822
size_t operator()(const cl::sycl::queue &Q) const {
826-
return std::hash<
827-
std::shared_ptr<cl::sycl::detail::queue_impl>>()(
823+
return std::hash<std::shared_ptr<cl::sycl::detail::queue_impl>>()(
828824
cl::sycl::detail::getSyclObjImpl(Q));
829825
}
830826
};

sycl/include/CL/sycl/stl.hpp

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,30 @@ namespace sycl {
5151
// to show deprecation warning with those aliases anyway.
5252

5353
template <class T, class Alloc = std::allocator<T>>
54-
using vector_class
55-
= std::vector<T, Alloc>;
54+
using vector_class = std::vector<T, Alloc>;
5655

57-
using string_class __SYCL2020_DEPRECATED("use STL classes directly")
58-
= std::string;
56+
using string_class
57+
__SYCL2020_DEPRECATED("use STL classes directly") = std::string;
5958

60-
template <class Sig>
61-
using function_class
62-
= std::function<Sig>;
59+
template <class Sig> using function_class = std::function<Sig>;
6360

64-
using mutex_class __SYCL2020_DEPRECATED("use STL classes directly")
65-
= std::mutex;
61+
using mutex_class
62+
__SYCL2020_DEPRECATED("use STL classes directly") = std::mutex;
6663

6764
template <class T, class Deleter = std::default_delete<T>>
68-
using unique_ptr_class
69-
= std::unique_ptr<T, Deleter>;
65+
using unique_ptr_class = std::unique_ptr<T, Deleter>;
7066

71-
template <class T>
72-
using shared_ptr_class
73-
= std::shared_ptr<T>;
67+
template <class T> using shared_ptr_class = std::shared_ptr<T>;
7468

75-
template <class T>
76-
using weak_ptr_class
77-
= std::weak_ptr<T>;
69+
template <class T> using weak_ptr_class = std::weak_ptr<T>;
7870

79-
template <class T> using hash_class
80-
= std::hash<T>;
71+
template <class T> using hash_class = std::hash<T>;
8172

82-
using exception_ptr_class __SYCL2020_DEPRECATED("use STL classes directly")
83-
= std::exception_ptr;
73+
using exception_ptr_class
74+
__SYCL2020_DEPRECATED("use STL classes directly") = std::exception_ptr;
8475

8576
template <typename T, typename... ArgsT>
86-
std::unique_ptr<T> make_unique_ptr(ArgsT &&... Args) {
77+
std::unique_ptr<T> make_unique_ptr(ArgsT &&...Args) {
8778
return std::unique_ptr<T>(new T(std::forward<ArgsT>(Args)...));
8879
}
8980

sycl/source/detail/common.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ const char *stringifyErrorCode(cl_int error) {
221221
}
222222
}
223223

224-
std::vector<std::string> split_string(const std::string &str,
225-
char delimeter) {
224+
std::vector<std::string> split_string(const std::string &str, char delimeter) {
226225
std::vector<std::string> result;
227226
size_t beg = 0;
228227
size_t length = 0;

sycl/source/detail/device_impl.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ device_impl::create_sub_devices(const cl_device_partition_property *Properties,
147147
return res;
148148
}
149149

150-
std::vector<device>
151-
device_impl::create_sub_devices(size_t ComputeUnits) const {
150+
std::vector<device> device_impl::create_sub_devices(size_t ComputeUnits) const {
152151

153152
if (MIsHostDevice)
154153
// TODO: implement host device partitioning

sycl/source/detail/device_info.hpp

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ __SYCL_INLINE_NAMESPACE(cl) {
2626
namespace sycl {
2727
namespace detail {
2828

29-
inline std::vector<info::fp_config>
30-
read_fp_bitfield(cl_device_fp_config bits) {
29+
inline std::vector<info::fp_config> read_fp_bitfield(cl_device_fp_config bits) {
3130
std::vector<info::fp_config> result;
3231
if (bits & CL_FP_DENORM)
3332
result.push_back(info::fp_config::denorm);
@@ -168,7 +167,7 @@ template <info::device param> struct get_device_info<id<3>, param> {
168167
template <info::device param>
169168
struct get_device_info<std::vector<info::fp_config>, param> {
170169
static std::vector<info::fp_config> get(RT::PiDevice dev,
171-
const plugin &Plugin) {
170+
const plugin &Plugin) {
172171
// Check if fp type is supported
173172
if (!get_device_info<
174173
typename info::param_traits<
@@ -213,7 +212,7 @@ template <>
213212
struct get_device_info<std::vector<info::fp_config>,
214213
info::device::single_fp_config> {
215214
static std::vector<info::fp_config> get(RT::PiDevice dev,
216-
const plugin &Plugin) {
215+
const plugin &Plugin) {
217216
cl_device_fp_config result;
218217
Plugin.call<PiApiKind::piDeviceGetInfo>(
219218
dev, pi::cast<RT::PiDeviceInfo>(info::device::single_fp_config),
@@ -238,7 +237,7 @@ template <>
238237
struct get_device_info<std::vector<info::execution_capability>,
239238
info::device::execution_capabilities> {
240239
static std::vector<info::execution_capability> get(RT::PiDevice dev,
241-
const plugin &Plugin) {
240+
const plugin &Plugin) {
242241
cl_device_exec_capabilities result;
243242
Plugin.call<PiApiKind::piDeviceGetInfo>(
244243
dev, pi::cast<RT::PiDeviceInfo>(info::device::execution_capabilities),
@@ -251,8 +250,7 @@ struct get_device_info<std::vector<info::execution_capability>,
251250
template <>
252251
struct get_device_info<std::vector<std::string>,
253252
info::device::built_in_kernels> {
254-
static std::vector<std::string> get(RT::PiDevice dev,
255-
const plugin &Plugin) {
253+
static std::vector<std::string> get(RT::PiDevice dev, const plugin &Plugin) {
256254
std::string result =
257255
get_device_info<std::string, info::device::built_in_kernels>::get(
258256
dev, Plugin);
@@ -263,11 +261,10 @@ struct get_device_info<std::vector<std::string>,
263261
// Specialization for extensions, splits the string returned by OpenCL
264262
template <>
265263
struct get_device_info<std::vector<std::string>, info::device::extensions> {
266-
static std::vector<std::string> get(RT::PiDevice dev,
267-
const plugin &Plugin) {
264+
static std::vector<std::string> get(RT::PiDevice dev, const plugin &Plugin) {
268265
std::string result =
269266
get_device_info<std::string, info::device::extensions>::get(dev,
270-
Plugin);
267+
Plugin);
271268
return split_string(result, ' ');
272269
}
273270
};
@@ -288,7 +285,7 @@ template <>
288285
struct get_device_info<std::vector<info::partition_property>,
289286
info::device::partition_properties> {
290287
static std::vector<info::partition_property> get(RT::PiDevice dev,
291-
const plugin &Plugin) {
288+
const plugin &Plugin) {
292289
auto info_partition =
293290
pi::cast<RT::PiDeviceInfo>(info::device::partition_properties);
294291

@@ -1038,8 +1035,7 @@ template <> struct get_device_info<bool, info::device::ext_intel_mem_channel> {
10381035
// Specializations for intel extensions for Level Zero low-level
10391036
// detail device descriptors (not support on host).
10401037
template <>
1041-
inline std::string
1042-
get_device_info_host<info::device::ext_intel_pci_address>() {
1038+
inline std::string get_device_info_host<info::device::ext_intel_pci_address>() {
10431039
throw runtime_error(
10441040
"Obtaining the PCI address is not supported on HOST device",
10451041
PI_INVALID_DEVICE);

sycl/source/detail/error_handling/enqueue_kernel.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel,
187187
Plugin.call<PiApiKind::piProgramGetBuildInfo>(
188188
Program, Device, PI_PROGRAM_BUILD_INFO_OPTIONS, OptsSize,
189189
&Opts.front(), nullptr);
190-
const bool HasStd20 =
191-
Opts.find("-cl-std=CL2.0") != std::string::npos;
190+
const bool HasStd20 = Opts.find("-cl-std=CL2.0") != std::string::npos;
192191
const bool RequiresUniformWGSize =
193192
Opts.find("-cl-uniform-work-group-size") != std::string::npos;
194193
std::string LocalWGSize = std::to_string(NDRDesc.LocalSize[0]) +

sycl/source/detail/platform_info.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ template <info::platform param> struct get_platform_info<std::string, param> {
3939
};
4040

4141
template <>
42-
struct get_platform_info<std::vector<std::string>,
43-
info::platform::extensions> {
42+
struct get_platform_info<std::vector<std::string>, info::platform::extensions> {
4443
static std::vector<std::string> get(RT::PiPlatform plt,
45-
const plugin &Plugin) {
44+
const plugin &Plugin) {
4645
std::string result =
47-
get_platform_info<std::string, info::platform::extensions>::get(
48-
plt, Plugin);
46+
get_platform_info<std::string, info::platform::extensions>::get(plt,
47+
Plugin);
4948
return split_string(result, ' ');
5049
}
5150
};

sycl/source/detail/program_impl.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ class program_impl {
184184
/// \param KernelName is a string containing SYCL kernel name.
185185
/// \param BuildOptions is a string containing OpenCL compile options.
186186
/// \param M is an OS handle to user code module.
187-
void build_with_kernel_name(std::string KernelName,
188-
std::string BuildOptions, OSModuleHandle M);
187+
void build_with_kernel_name(std::string KernelName, std::string BuildOptions,
188+
OSModuleHandle M);
189189

190190
/// Builds the OpenCL C kernel function defined by source code.
191191
///
@@ -409,8 +409,7 @@ class program_impl {
409409
RT::PiKernel get_pi_kernel(const std::string &KernelName) const;
410410

411411
/// \return a vector of sorted in ascending order SYCL devices.
412-
std::vector<device>
413-
sort_devices_by_cl_device_id(std::vector<device> Devices);
412+
std::vector<device> sort_devices_by_cl_device_id(std::vector<device> Devices);
414413

415414
/// Throws an invalid_object_exception if state of this program is in the
416415
/// specified state.

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ ProgramManager::getPiProgramFromPiKernel(RT::PiKernel Kernel,
569569
}
570570

571571
std::string ProgramManager::getProgramBuildLog(const RT::PiProgram &Program,
572-
const ContextImplPtr Context) {
572+
const ContextImplPtr Context) {
573573
size_t PIDevicesSize = 0;
574574
const detail::plugin &Plugin = Context->getPlugin();
575575
Plugin.call<PiApiKind::piProgramGetInfo>(Program, PI_PROGRAM_INFO_DEVICES, 0,
@@ -579,7 +579,7 @@ std::string ProgramManager::getProgramBuildLog(const RT::PiProgram &Program,
579579
PIDevicesSize, PIDevices.data(),
580580
nullptr);
581581
std::string Log = "The program was built for " +
582-
std::to_string(PIDevices.size()) + " devices";
582+
std::to_string(PIDevices.size()) + " devices";
583583
for (RT::PiDevice &Device : PIDevices) {
584584
std::string DeviceBuildInfoString;
585585
size_t DeviceBuildInfoStrSize = 0;
@@ -1147,8 +1147,7 @@ uint32_t ProgramManager::getDeviceLibReqMask(const RTDeviceBinaryImage &Img) {
11471147
// header instead.
11481148
ProgramManager::KernelArgMask ProgramManager::getEliminatedKernelArgMask(
11491149
OSModuleHandle M, const context &Context, const device &Device,
1150-
pi::PiProgram NativePrg, const std::string &KernelName,
1151-
bool KnownProgram) {
1150+
pi::PiProgram NativePrg, const std::string &KernelName, bool KnownProgram) {
11521151
// If instructed to use a spv file, assume no eliminated arguments.
11531152
if (m_UseSpvFile && M == OSUtil::ExeModuleHandle)
11541153
return {};

0 commit comments

Comments
 (0)