Skip to content

Commit 2959bc5

Browse files
author
Diptorup Deb
committed
Reformat using clang-format.
1 parent 4c5cf61 commit 2959bc5

7 files changed

+80
-83
lines changed

dpctl-capi/helper/include/dpctl_utils_helper.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#pragma once
2626

27-
#include <CL/sycl.hpp>
2827
#include "../include/dpctl_sycl_enum_types.h"
28+
#include <CL/sycl.hpp>
2929

3030
using namespace cl::sycl;
3131

@@ -35,29 +35,29 @@ using namespace cl::sycl;
3535
* @param devTy My Param doc
3636
* @return {return} My Param doc
3737
*/
38-
std::string DPCTL_DeviceTypeToStr (info::device_type devTy);
38+
std::string DPCTL_DeviceTypeToStr(info::device_type devTy);
3939

4040
/*!
4141
* @brief
4242
*
4343
* @param devTyStr My Param doc
4444
* @return {return} My Param doc
4545
*/
46-
info::device_type DPCTL_StrToDeviceType (const std::string & devTyStr);
46+
info::device_type DPCTL_StrToDeviceType(const std::string &devTyStr);
4747

4848
/*!
4949
* @brief
5050
*
5151
* @param BeTy My Param doc
5252
* @return {return} My Param doc
5353
*/
54-
backend DPCTL_DPCTLBackendTypeToSyclBackend (const DPCTLSyclBackendType & BeTy);
54+
backend DPCTL_DPCTLBackendTypeToSyclBackend(const DPCTLSyclBackendType &BeTy);
5555

5656
/*!
5757
* @brief
5858
*
5959
* @param BeTy My Param doc
6060
* @return {return} My Param doc
6161
*/
62-
info::device_type DPCTL_DPCTLDeviceTypeToSyclDeviceType (
63-
const DPCTLSyclDeviceType & DTy);
62+
info::device_type
63+
DPCTL_DPCTLDeviceTypeToSyclDeviceType(const DPCTLSyclDeviceType &DTy);

dpctl-capi/helper/source/dpctl_utils_helper.cpp

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ std::string DPCTL_DeviceTypeToStr(info::device_type devTy)
5858
}
5959

6060
/*!
61-
* Transforms string to enum info::device_type.
62-
*/
63-
info::device_type DPCTL_StrToDeviceType(const std::string & devTyStr)
61+
* Transforms string to enum info::device_type.
62+
*/
63+
info::device_type DPCTL_StrToDeviceType(const std::string &devTyStr)
6464
{
6565
info::device_type devTy;
6666
if (devTyStr == "cpu") {
@@ -85,43 +85,41 @@ info::device_type DPCTL_StrToDeviceType(const std::string & devTyStr)
8585
return devTy;
8686
}
8787

88-
backend DPCTL_DPCTLBackendTypeToSyclBackend(const DPCTLSyclBackendType & BeTy)
88+
backend DPCTL_DPCTLBackendTypeToSyclBackend(const DPCTLSyclBackendType &BeTy)
8989
{
90-
switch(BeTy)
91-
{
92-
case DPCTLSyclBackendType::DPCTL_CUDA:
93-
return backend::cuda;
94-
case DPCTLSyclBackendType::DPCTL_HOST:
95-
return backend::host;
96-
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO:
97-
return backend::level_zero;
98-
case DPCTLSyclBackendType::DPCTL_OPENCL:
99-
return backend::opencl;
100-
default:
101-
throw runtime_error("Unsupported backend type", -1);
90+
switch (BeTy) {
91+
case DPCTLSyclBackendType::DPCTL_CUDA:
92+
return backend::cuda;
93+
case DPCTLSyclBackendType::DPCTL_HOST:
94+
return backend::host;
95+
case DPCTLSyclBackendType::DPCTL_LEVEL_ZERO:
96+
return backend::level_zero;
97+
case DPCTLSyclBackendType::DPCTL_OPENCL:
98+
return backend::opencl;
99+
default:
100+
throw runtime_error("Unsupported backend type", -1);
102101
}
103102
}
104103

105-
info::device_type DPCTL_DPCTLDeviceTypeToSyclDeviceType (
106-
const DPCTLSyclDeviceType & DTy)
104+
info::device_type
105+
DPCTL_DPCTLDeviceTypeToSyclDeviceType(const DPCTLSyclDeviceType &DTy)
107106
{
108-
switch(DTy)
109-
{
110-
case DPCTLSyclDeviceType::DPCTL_ACCELERATOR:
111-
return info::device_type::accelerator;
112-
case DPCTLSyclDeviceType::DPCTL_ALL:
113-
return info::device_type::all;
114-
case DPCTLSyclDeviceType::DPCTL_AUTOMATIC:
115-
return info::device_type::automatic;
116-
case DPCTLSyclDeviceType::DPCTL_CPU:
117-
return info::device_type::cpu;
118-
case DPCTLSyclDeviceType::DPCTL_CUSTOM:
119-
return info::device_type::custom;
120-
case DPCTLSyclDeviceType::DPCTL_GPU:
121-
return info::device_type::gpu;
122-
case DPCTLSyclDeviceType::DPCTL_HOST_DEVICE:
123-
return info::device_type::host;
124-
default:
125-
throw runtime_error("Unsupported device type", -1);
107+
switch (DTy) {
108+
case DPCTLSyclDeviceType::DPCTL_ACCELERATOR:
109+
return info::device_type::accelerator;
110+
case DPCTLSyclDeviceType::DPCTL_ALL:
111+
return info::device_type::all;
112+
case DPCTLSyclDeviceType::DPCTL_AUTOMATIC:
113+
return info::device_type::automatic;
114+
case DPCTLSyclDeviceType::DPCTL_CPU:
115+
return info::device_type::cpu;
116+
case DPCTLSyclDeviceType::DPCTL_CUSTOM:
117+
return info::device_type::custom;
118+
case DPCTLSyclDeviceType::DPCTL_GPU:
119+
return info::device_type::gpu;
120+
case DPCTLSyclDeviceType::DPCTL_HOST_DEVICE:
121+
return info::device_type::host;
122+
default:
123+
throw runtime_error("Unsupported device type", -1);
126124
}
127125
}

dpctl-capi/include/dpctl_sycl_device_interface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ DPCTL_C_EXTERN_C_BEGIN
4242
* @return {return} My Param doc
4343
*/
4444
DPCTL_API
45-
__dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create ();
45+
__dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create();
4646

4747
/*!
4848
* @brief
@@ -51,7 +51,7 @@ __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create ();
5151
*/
5252
DPCTL_API
5353
__dpctl_give DPCTLSyclDeviceRef
54-
DPCTLDevice_CreateFromSelector (__dpctl_keep DPCTLSyclDeviceSelectorRef DSRef);
54+
DPCTLDevice_CreateFromSelector(__dpctl_keep DPCTLSyclDeviceSelectorRef DSRef);
5555

5656
/*!
5757
* @brief Prints out some of the info::deivice attributes for the device.

dpctl-capi/include/dpctl_sycl_device_selector_interface.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626

2727
#pragma once
2828

29-
#include "dpctl_sycl_types.h"
3029
#include "Support/DllExport.h"
3130
#include "Support/ExternC.h"
3231
#include "Support/MemOwnershipAttrs.h"
32+
#include "dpctl_sycl_types.h"
3333

3434
DPCTL_C_EXTERN_C_BEGIN
3535

@@ -39,23 +39,23 @@ DPCTL_C_EXTERN_C_BEGIN
3939
* @return An opaque pointer to a sycl::accelerator_selector object.
4040
*/
4141
DPCTL_API
42-
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLAcceleratorSelector_Create ();
42+
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLAcceleratorSelector_Create();
4343

4444
/*!
4545
* @brief Returns an opaque wrapper for sycl::default_selector object.
4646
*
4747
* @return An opaque pointer to a sycl::default_selector object.
4848
*/
4949
DPCTL_API
50-
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLDefaultSelector_Create ();
50+
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLDefaultSelector_Create();
5151

5252
/*!
5353
* @brief Returns an opaque wrapper for sycl::cpu_selector object.
5454
*
5555
* @return An opaque pointer to a sycl::cpu_selector object.
5656
*/
5757
DPCTL_API
58-
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create ();
58+
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create();
5959

6060
/*!
6161
* @brief Returns an opaque wrapper for sycl::ONEAPI::filter_selector object
@@ -67,23 +67,23 @@ __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create ();
6767
*/
6868
DPCTL_API
6969
__dpctl_give DPCTLSyclDeviceSelectorRef
70-
DPCTLFilterSelector_Create (__dpctl_keep const char *filter_str);
70+
DPCTLFilterSelector_Create(__dpctl_keep const char *filter_str);
7171

7272
/*!
7373
* @brief Returns an opaque wrapper for sycl::gpu_selector object.
7474
*
7575
* @return An opaque pointer to a sycl::gpu_selector object.
7676
*/
7777
DPCTL_API
78-
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create ();
78+
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create();
7979

8080
/*!
8181
* @brief Returns an opaque wrapper for sycl::host_selector object.
8282
*
8383
* @return An opaque pointer to a sycl::host_selector object.
8484
*/
8585
DPCTL_API
86-
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create ();
86+
__dpctl_give DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create();
8787

8888
/*!
8989
* @brief Deletes the DPCTLSyclDeviceSelectorRef after casting it to a
@@ -93,6 +93,6 @@ __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create ();
9393
* freed.
9494
*/
9595
DPCTL_API
96-
void DPCTLDeviceSelector_Delete (__dpctl_take DPCTLSyclDeviceSelectorRef DSRef);
96+
void DPCTLDeviceSelector_Delete(__dpctl_take DPCTLSyclDeviceSelectorRef DSRef);
9797

9898
DPCTL_C_EXTERN_C_END

dpctl-capi/include/dpctl_sycl_queue_manager.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ __dpctl_give DPCTLSyclQueueRef DPCTLQueueMgr_GetCurrentQueue();
6363
* the DPCTLSyclDeviceRef argument is invalid.
6464
*/
6565
DPCTL_API
66-
__dpctl_give DPCTLSyclQueueRef
67-
DPCTLQueueMgr_GetQueue (DPCTLSyclDeviceRef DRef);
66+
__dpctl_give DPCTLSyclQueueRef DPCTLQueueMgr_GetQueue(DPCTLSyclDeviceRef DRef);
6867

6968
/*!
7069
* @brief Get the number of activated queues not including the global or
@@ -84,8 +83,8 @@ size_t DPCTLQueueMgr_GetNumActivatedQueues();
8483
* @return The number of available queues.
8584
*/
8685
DPCTL_API
87-
size_t DPCTLQueueMgr_GetNumDevices (DPCTLSyclBackendType BETy,
88-
DPCTLSyclDeviceType DeviceTy);
86+
size_t DPCTLQueueMgr_GetNumDevices(DPCTLSyclBackendType BETy,
87+
DPCTLSyclDeviceType DeviceTy);
8988

9089
/*!
9190
* @brief Returns True if the passed in queue and the current queue are the
@@ -99,18 +98,18 @@ DPCTL_API
9998
bool DPCTLQueueMgr_IsCurrentQueue(__dpctl_keep const DPCTLSyclQueueRef QRef);
10099

101100
/*!
102-
* @brief Sets the default DPCTL queue to a sycl::queue for the passed in
103-
* DPCTLSyclDeviceRef and returns a DPCTLSyclQueueRef for that queue. If no
104-
* queue was created Null is returned to caller.
105-
*
106-
* @param DRef An opaque reference to a sycl::device.
107-
*
108-
* @return A copy of the sycl::queue that was set as the new default queue. If no
109-
* queue could be created then returns Null.
110-
*/
101+
* @brief Sets the default DPCTL queue to a sycl::queue for the passed in
102+
* DPCTLSyclDeviceRef and returns a DPCTLSyclQueueRef for that queue. If no
103+
* queue was created Null is returned to caller.
104+
*
105+
* @param DRef An opaque reference to a sycl::device.
106+
*
107+
* @return A copy of the sycl::queue that was set as the new default queue. If
108+
* no queue could be created then returns Null.
109+
*/
111110
DPCTL_API
112111
__dpctl_give DPCTLSyclQueueRef
113-
DPCTLQueueMgr_SetAsDefaultQueue (__dpctl_keep const DPCTLSyclDeviceRef DRef);
112+
DPCTLQueueMgr_SetAsDefaultQueue(__dpctl_keep const DPCTLSyclDeviceRef DRef);
114113

115114
/*!
116115
* @brief Pushes a new sycl::queue object to the top of DPCTL's stack of
@@ -133,7 +132,7 @@ DPCTLQueueMgr_SetAsDefaultQueue (__dpctl_keep const DPCTLSyclDeviceRef DRef);
133132
*/
134133
DPCTL_API
135134
__dpctl_give DPCTLSyclQueueRef
136-
DPCTLQueueMgr_PushQueue (__dpctl_keep const DPCTLSyclDeviceRef DRef);
135+
DPCTLQueueMgr_PushQueue(__dpctl_keep const DPCTLSyclDeviceRef DRef);
137136

138137
/*!
139138
* @brief Pops the top of stack element from DPCTL's stack of activated

dpctl-capi/source/dpctl_sycl_device_interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void dump_device_info(const device &Device)
6767

6868
} /* end of anonymous namespace */
6969

70-
__dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create ()
70+
__dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create()
7171
{
7272
try {
7373
auto Device = new device();
@@ -80,7 +80,7 @@ __dpctl_give DPCTLSyclDeviceRef DPCTLDevice_Create ()
8080
}
8181

8282
__dpctl_give DPCTLSyclDeviceRef
83-
DPCTLDevice_CreateFromSelector (__dpctl_keep DPCTLSyclDeviceSelectorRef DSRef)
83+
DPCTLDevice_CreateFromSelector(__dpctl_keep DPCTLSyclDeviceSelectorRef DSRef)
8484
{
8585
auto Selector = unwrap(DSRef);
8686
if (!Selector)

0 commit comments

Comments
 (0)