Skip to content

Commit 2bae103

Browse files
committed
Fixed clang-format issues
Signed-off-by: Gail Lyons <[email protected]>
1 parent 4285c0d commit 2bae103

File tree

4 files changed

+47
-43
lines changed

4 files changed

+47
-43
lines changed

sycl/include/CL/sycl/backend/level_zero.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ template <> struct interop<backend::level_zero, program> {
3232

3333
template <typename DataT, int Dimensions, access::mode AccessMode>
3434
struct interop<backend::level_zero, accessor<DataT, Dimensions, AccessMode,
35-
access::target::global_buffer,
36-
access::placeholder::false_t>> {
35+
access::target::global_buffer,
36+
access::placeholder::false_t>> {
3737
using type = char *;
3838
};
3939

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//===----------- pi_level_zero.cpp - Level Zero Plugin--------------------------==//
1+
//===-------- pi_level_zero.cpp - Level Zero Plugin --------------------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
7-
//===----------------------------------------------------------------------===//
7+
//===------------------------------------------------------------------===//
88

99
/// \file pi_level_zero.cpp
1010
/// Implementation of Level Zero Plugin.
@@ -26,8 +26,8 @@
2626

2727
namespace {
2828

29-
// Controls Level Zero calls serialization to w/a Level Zero driver being not MT ready.
30-
// Recognized values (can be used as a bit mask):
29+
// Controls Level Zero calls serialization to w/a Level Zero driver being not MT
30+
// ready. Recognized values (can be used as a bit mask):
3131
enum {
3232
ZeSerializeNone =
3333
0, // no locking or blocking (except when SYCL RT requested blocking)
@@ -754,7 +754,8 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
754754
// cl_khr_3d_image_writes - Extension to enable writes to 3D image memory
755755
// objects.
756756
//
757-
// Hardcoding some extensions we know are supported by all Level Zero devices.
757+
// Hardcoding some extensions we know are supported by all Level Zero
758+
// devices.
758759
SupportedExtensions += (ZE_SUPPORTED_EXTENSIONS);
759760
if (ZeDeviceKernelProperties.fp16Supported)
760761
SupportedExtensions += ("cl_khr_fp16 ");
@@ -995,24 +996,24 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
995996
return ReturnValue(pi_uint64{DoubleFPValue});
996997
}
997998
case PI_DEVICE_INFO_IMAGE2D_MAX_WIDTH:
998-
// Until Level Zero provides needed info, hardcode default minimum values required
999-
// by the SYCL specification.
999+
// Until Level Zero provides needed info, hardcode default minimum values
1000+
// required by the SYCL specification.
10001001
return ReturnValue(size_t{8192});
10011002
case PI_DEVICE_INFO_IMAGE2D_MAX_HEIGHT:
1002-
// Until Level Zero provides needed info, hardcode default minimum values required
1003-
// by the SYCL specification.
1003+
// Until Level Zero provides needed info, hardcode default minimum values
1004+
// required by the SYCL specification.
10041005
return ReturnValue(size_t{8192});
10051006
case PI_DEVICE_INFO_IMAGE3D_MAX_WIDTH:
1006-
// Until Level Zero provides needed info, hardcode default minimum values required
1007-
// by the SYCL specification.
1007+
// Until Level Zero provides needed info, hardcode default minimum values
1008+
// required by the SYCL specification.
10081009
return ReturnValue(size_t{2048});
10091010
case PI_DEVICE_INFO_IMAGE3D_MAX_HEIGHT:
1010-
// Until Level Zero provides needed info, hardcode default minimum values required
1011-
// by the SYCL specification.
1011+
// Until Level Zero provides needed info, hardcode default minimum values
1012+
// required by the SYCL specification.
10121013
return ReturnValue(size_t{2048});
10131014
case PI_DEVICE_INFO_IMAGE3D_MAX_DEPTH:
1014-
// Until Level Zero provides needed info, hardcode default minimum values required
1015-
// by the SYCL specification.
1015+
// Until Level Zero provides needed info, hardcode default minimum values
1016+
// required by the SYCL specification.
10161017
return ReturnValue(size_t{2048});
10171018
case PI_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE:
10181019
return ReturnValue(size_t{ZeDeviceImageProperties.maxImageBufferSize});
@@ -1437,9 +1438,9 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
14371438
auto HostPtrOrNull =
14381439
(Flags & PI_MEM_FLAGS_HOST_PTR_USE) ? pi_cast<char *>(HostPtr) : nullptr;
14391440
try {
1440-
*RetMem = new _pi_buffer(Context->Device->Platform,
1441-
pi_cast<char *>(Ptr) /* Level Zero Memory Handle */,
1442-
HostPtrOrNull);
1441+
*RetMem = new _pi_buffer(
1442+
Context->Device->Platform,
1443+
pi_cast<char *>(Ptr) /* Level Zero Memory Handle */, HostPtrOrNull);
14431444
} catch (const std::bad_alloc &) {
14441445
return PI_OUT_OF_HOST_MEMORY;
14451446
} catch (...) {
@@ -1660,8 +1661,8 @@ pi_result piProgramCreate(pi_context Context, const void *IL, size_t Length,
16601661
assert(Context);
16611662
assert(Program);
16621663

1663-
// NOTE: the Level Zero module creation is also building the program, so we are
1664-
// deferring it until the program is ready to be built in piProgramBuild
1664+
// NOTE: the Level Zero module creation is also building the program, so we
1665+
// are deferring it until the program is ready to be built in piProgramBuild
16651666
// and piProgramCompile. Also it is only then we know the build options.
16661667
//
16671668
ze_module_desc_t ZeModuleDesc = {};
@@ -1796,7 +1797,8 @@ pi_result piProgramLink(pi_context Context, pi_uint32 NumDevices,
17961797
void (*PFnNotify)(pi_program Program, void *UserData),
17971798
void *UserData, pi_program *RetProgram) {
17981799

1799-
// TODO: Level Zero does not [yet] support linking so dummy implementation here.
1800+
// TODO: Level Zero does not [yet] support linking so dummy implementation
1801+
// here.
18001802
assert(NumInputPrograms == 1 && InputPrograms);
18011803
assert(RetProgram);
18021804
*RetProgram = InputPrograms[0];
@@ -2052,9 +2054,9 @@ pi_result piKernelGetInfo(pi_kernel Kernel, pi_kernel_info ParamName,
20522054
case PI_KERNEL_INFO_PROGRAM:
20532055
return ReturnValue(pi_program{Kernel->Program});
20542056
case PI_KERNEL_INFO_FUNCTION_NAME:
2055-
// TODO: Replace with the line in the comment once bug in the Level Zero driver will
2056-
// be fixed. Problem is that currently Level Zero driver truncates name of the
2057-
// returned kernel if it is longer than 256 symbols.
2057+
// TODO: Replace with the line in the comment once bug in the Level Zero
2058+
// driver will be fixed. Problem is that currently Level Zero driver
2059+
// truncates name of the returned kernel if it is longer than 256 symbols.
20582060
//
20592061
// return ReturnValue(ZeKernelProperties.name);
20602062
return ReturnValue(Kernel->KernelName.c_str());
@@ -3010,8 +3012,8 @@ piEnqueueMemBufferMap(pi_queue Queue, pi_mem Buffer, pi_bool BlockingMap,
30103012
ZE_CALL(zeCommandListAppendWaitOnEvents(ZeCommandList, NumEventsInWaitList,
30113013
ZeEventWaitList));
30123014

3013-
// TODO: Level Zero is missing the memory "mapping" capabilities, so we are left
3014-
// to doing new memory allocation and a copy (read).
3015+
// TODO: Level Zero is missing the memory "mapping" capabilities, so we are
3016+
// left to doing new memory allocation and a copy (read).
30153017
//
30163018
// TODO: check if the input buffer is already allocated in shared
30173019
// memory and thus is accessible from the host as is. Can we get SYCL RT
@@ -3081,8 +3083,8 @@ pi_result piEnqueueMemUnmap(pi_queue Queue, pi_mem MemObj, void *MappedPtr,
30813083
ZE_CALL(zeCommandListAppendWaitOnEvents(ZeCommandList, NumEventsInWaitList,
30823084
ZeEventWaitList));
30833085

3084-
// TODO: Level Zero is missing the memory "mapping" capabilities, so we are left
3085-
// to doing copy (write back to the device).
3086+
// TODO: Level Zero is missing the memory "mapping" capabilities, so we are
3087+
// left to doing copy (write back to the device).
30863088
//
30873089
// NOTE: Keep this in sync with the implementation of
30883090
// piEnqueueMemBufferMap/piEnqueueMemImageMap.
@@ -3754,7 +3756,8 @@ pi_result piextProgramSetSpecializationConstant(pi_program Prog,
37543756
// Pass SpecValue pointer. Spec constant value is retrieved
37553757
// by Level-Zero when creating the modul
37563758
//
3757-
// NOTE: SpecSize is unused in Level Zero, the size is known from SPIR-V by SpecID.
3759+
// NOTE: SpecSize is unused in Level Zero, the size is known from SPIR-V by
3760+
// SpecID.
37583761
Prog->ZeSpecConstants[SpecID] = reinterpret_cast<uint64_t>(SpecValue);
37593762

37603763
return PI_SUCCESS;

sycl/plugins/level_zero/pi_level_zero.hpp

100755100644
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//===---------- pi_level_zero.hpp - Level Zero Plugin -------------------------===//
1+
//===------- pi_level_zero.hpp - Level Zero Plugin -------------------===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
7-
//===----------------------------------------------------------------------===//
7+
//===-----------------------------------------------------------------===//
88

99
/// \defgroup sycl_pi_level_zero Level Zero Plugin
1010
/// \ingroup sycl_pi
@@ -56,13 +56,14 @@ struct _pi_object {
5656
std::atomic<pi_uint32> RefCount;
5757
};
5858

59-
// Define the types that are opaque in pi.h in a manner suitabale for Level Zero plugin
59+
// Define the types that are opaque in pi.h in a manner suitabale for Level Zero
60+
// plugin
6061

6162
struct _pi_platform {
6263
_pi_platform(ze_driver_handle_t Driver) : ZeDriver{Driver} {}
6364

64-
// Level Zero lacks the notion of a platform, but there is a driver, which is a
65-
// pretty good fit to keep here.
65+
// Level Zero lacks the notion of a platform, but there is a driver, which is
66+
// a pretty good fit to keep here.
6667
ze_driver_handle_t ZeDriver;
6768

6869
// Cache versions info from zeDriverGetProperties.
@@ -89,8 +90,8 @@ struct _pi_device : _pi_object {
8990
// PI platform to which this device belongs.
9091
pi_platform Platform;
9192

92-
// Immediate Level Zero command list for this device, to be used for initializations.
93-
// To be created as:
93+
// Immediate Level Zero command list for this device, to be used for
94+
// initializations. To be created as:
9495
// - Immediate command list: So any command appended to it is immediately
9596
// offloaded to the device.
9697
// - Synchronous: So implicit synchronization is made inside the level-zero
@@ -283,9 +284,9 @@ struct _pi_event : _pi_object {
283284
// Level Zero event pool handle.
284285
ze_event_pool_handle_t ZeEventPool;
285286

286-
// Level Zero command list where the command signaling this event was appended to.
287-
// This is currently used to remember/destroy the command list after
288-
// all commands in it are completed, i.e. this event signaled.
287+
// Level Zero command list where the command signaling this event was appended
288+
// to. This is currently used to remember/destroy the command list after all
289+
// commands in it are completed, i.e. this event signaled.
289290
ze_command_list_handle_t ZeCommandList;
290291

291292
// Keeps the command-queue and command associated with the event.

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,8 @@ ProgramManager::build(ProgramPtr Program, const ContextImplPtr Context,
783783
LinkOpts = LinkOptions.c_str();
784784
}
785785

786-
// Level-Zero plugin doesn't support piProgramCompile/piProgramLink commands, program
787-
// is built during piProgramCreate.
786+
// Level-Zero plugin doesn't support piProgramCompile/piProgramLink commands,
787+
// program is built during piProgramCreate.
788788
// TODO: remove this check as soon as piProgramCompile/piProgramLink will be
789789
// implemented in Level-Zero plugin.
790790
if (Context->getPlugin().getBackend() == backend::level_zero) {

0 commit comments

Comments
 (0)