Skip to content

Commit bc2305d

Browse files
committed
[SYCL] Changing all the PI_CALL(RT:: or PI_CALL_RESULT(RT:: to
PI_CALL( or PI_CALL_RESULT( and other required changes. Signed-off-by: Garima Gupta <[email protected]>
1 parent a8e86c7 commit bc2305d

35 files changed

+267
-360
lines changed

sycl/include/CL/sycl/buffer.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ class buffer {
181181
: Range{0} {
182182

183183
size_t BufSize = 0;
184-
PI_CALL(detail::RT::piMemGetInfo,
185-
detail::pi::cast<detail::RT::PiMem>(MemObject), CL_MEM_SIZE,
186-
sizeof(size_t), &BufSize, nullptr);
184+
PI_CALL(piMemGetInfo, detail::pi::cast<detail::RT::PiMem>(MemObject),
185+
CL_MEM_SIZE, sizeof(size_t), &BufSize, nullptr);
187186

188187
Range[0] = BufSize / sizeof(T);
189188
impl = std::make_shared<detail::buffer_impl<AllocatorT>>(

sycl/include/CL/sycl/detail/context_info.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ template <info::context param> struct get_context_info {
2222
static RetType _(RT::PiContext ctx) {
2323
RetType Result = 0;
2424
// TODO catch an exception and put it to list of asynchronous exceptions
25-
PI_CALL(RT::piContextGetInfo, ctx, pi::cast<pi_context_info>(param),
26-
sizeof(Result), &Result, nullptr);
25+
PI_CALL(piContextGetInfo, ctx, pi::cast<pi_context_info>(param),
26+
sizeof(Result), &Result, nullptr);
2727
return Result;
2828
}
2929
};

sycl/include/CL/sycl/detail/device_info.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ template <> struct check_fp_support<info::device::double_fp_config> {
4848
template <typename T, info::device param> struct get_device_info {
4949
static T _(RT::PiDevice dev) {
5050
typename sycl_to_pi<T>::type result;
51-
PI_CALL(RT::piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
51+
PI_CALL(piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
5252
sizeof(result), &result, nullptr);
5353
return T(result);
5454
}
@@ -58,7 +58,7 @@ template <typename T, info::device param> struct get_device_info {
5858
template <info::device param> struct get_device_info<platform, param> {
5959
static platform _(RT::PiDevice dev) {
6060
typename sycl_to_pi<platform>::type result;
61-
PI_CALL(RT::piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
61+
PI_CALL(piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
6262
sizeof(result), &result, nullptr);
6363
return createSyclObjFromImpl<platform>(
6464
std::make_shared<platform_impl_pi>(result));
@@ -69,13 +69,13 @@ template <info::device param> struct get_device_info<platform, param> {
6969
template <info::device param> struct get_device_info<string_class, param> {
7070
static string_class _(RT::PiDevice dev) {
7171
size_t resultSize;
72-
PI_CALL(RT::piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param), 0, nullptr,
72+
PI_CALL(piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param), 0, nullptr,
7373
&resultSize);
7474
if (resultSize == 0) {
7575
return string_class();
7676
}
7777
unique_ptr_class<char[]> result(new char[resultSize]);
78-
PI_CALL(RT::piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param), resultSize,
78+
PI_CALL(piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param), resultSize,
7979
result.get(), nullptr);
8080

8181
return string_class(result.get());
@@ -91,7 +91,7 @@ template <typename T> struct get_device_info<T, info::device::parent_device> {
9191
template <info::device param> struct get_device_info<id<3>, param> {
9292
static id<3> _(RT::PiDevice dev) {
9393
size_t result[3];
94-
PI_CALL(RT::piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
94+
PI_CALL(piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
9595
sizeof(result), &result, nullptr);
9696
return id<3>(result[0], result[1], result[2]);
9797
}
@@ -109,7 +109,7 @@ struct get_device_info<vector_class<info::fp_config>, param> {
109109
return {};
110110
}
111111
cl_device_fp_config result;
112-
PI_CALL(RT::piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
112+
PI_CALL(piDeviceGetInfo, dev, pi::cast<RT::PiDeviceInfo>(param),
113113
sizeof(result), &result, nullptr);
114114
return read_fp_bitfield(result);
115115
}
@@ -121,7 +121,7 @@ struct get_device_info<vector_class<info::fp_config>,
121121
info::device::single_fp_config> {
122122
static vector_class<info::fp_config> _(RT::PiDevice dev) {
123123
cl_device_fp_config result;
124-
PI_CALL(RT::piDeviceGetInfo, dev,
124+
PI_CALL(piDeviceGetInfo, dev,
125125
pi::cast<RT::PiDeviceInfo>(info::device::single_fp_config),
126126
sizeof(result), &result, nullptr);
127127
return read_fp_bitfield(result);
@@ -132,7 +132,7 @@ struct get_device_info<vector_class<info::fp_config>,
132132
template <> struct get_device_info<bool, info::device::queue_profiling> {
133133
static bool _(RT::PiDevice dev) {
134134
cl_command_queue_properties result;
135-
PI_CALL(RT::piDeviceGetInfo, dev,
135+
PI_CALL(piDeviceGetInfo, dev,
136136
pi::cast<RT::PiDeviceInfo>(info::device::queue_profiling),
137137
sizeof(result), &result, nullptr);
138138
return (result & CL_QUEUE_PROFILING_ENABLE);
@@ -145,7 +145,7 @@ struct get_device_info<vector_class<info::execution_capability>,
145145
info::device::execution_capabilities> {
146146
static vector_class<info::execution_capability> _(RT::PiDevice dev) {
147147
cl_device_exec_capabilities result;
148-
PI_CALL(RT::piDeviceGetInfo, dev,
148+
PI_CALL(piDeviceGetInfo, dev,
149149
pi::cast<RT::PiDeviceInfo>(info::device::execution_capabilities),
150150
sizeof(result), &result, nullptr);
151151
return read_execution_bitfield(result);
@@ -182,15 +182,15 @@ struct get_device_info<vector_class<info::partition_property>,
182182
pi::cast<RT::PiDeviceInfo>(info::device::partition_properties);
183183

184184
size_t resultSize;
185-
PI_CALL(RT::piDeviceGetInfo, dev, info_partition, 0, nullptr, &resultSize);
185+
PI_CALL(piDeviceGetInfo, dev, info_partition, 0, nullptr, &resultSize);
186186

187187
size_t arrayLength = resultSize / sizeof(cl_device_partition_property);
188188
if (arrayLength == 0) {
189189
return {};
190190
}
191191
unique_ptr_class<cl_device_partition_property[]> arrayResult(
192192
new cl_device_partition_property[arrayLength]);
193-
PI_CALL(RT::piDeviceGetInfo, dev, info_partition, resultSize, arrayResult.get(),
193+
PI_CALL(piDeviceGetInfo, dev, info_partition, resultSize, arrayResult.get(),
194194
nullptr);
195195

196196
vector_class<info::partition_property> result;
@@ -208,7 +208,7 @@ struct get_device_info<vector_class<info::partition_affinity_domain>,
208208
static vector_class<info::partition_affinity_domain> _(RT::PiDevice dev) {
209209
cl_device_affinity_domain result;
210210
PI_CALL(
211-
RT::piDeviceGetInfo, dev,
211+
piDeviceGetInfo, dev,
212212
pi::cast<RT::PiDeviceInfo>(info::device::partition_affinity_domains),
213213
sizeof(result), &result, nullptr);
214214
return read_domain_bitfield(result);
@@ -222,15 +222,15 @@ struct get_device_info<info::partition_affinity_domain,
222222
info::device::partition_type_affinity_domain> {
223223
static info::partition_affinity_domain _(RT::PiDevice dev) {
224224
size_t resultSize;
225-
PI_CALL(RT::piDeviceGetInfo, dev,
225+
PI_CALL(piDeviceGetInfo, dev,
226226
pi::cast<RT::PiDeviceInfo>(
227227
info::device::partition_type_affinity_domain),
228228
0, nullptr, &resultSize);
229229
if (resultSize != 1) {
230230
return info::partition_affinity_domain::not_applicable;
231231
}
232232
cl_device_partition_property result;
233-
PI_CALL(RT::piDeviceGetInfo, dev,
233+
PI_CALL(piDeviceGetInfo, dev,
234234
pi::cast<RT::PiDeviceInfo>(
235235
info::device::partition_type_affinity_domain),
236236
sizeof(result), &result, nullptr);
@@ -252,7 +252,7 @@ struct get_device_info<info::partition_property,
252252
info::device::partition_type_property> {
253253
static info::partition_property _(RT::PiDevice dev) {
254254
size_t resultSize;
255-
PI_CALL(RT::piDeviceGetInfo, dev, PI_DEVICE_INFO_PARTITION_TYPE, 0, nullptr,
255+
PI_CALL(piDeviceGetInfo, dev, PI_DEVICE_INFO_PARTITION_TYPE, 0, nullptr,
256256
&resultSize);
257257
if (!resultSize)
258258
return info::partition_property::no_partition;
@@ -261,7 +261,7 @@ struct get_device_info<info::partition_property,
261261

262262
unique_ptr_class<cl_device_partition_property[]> arrayResult(
263263
new cl_device_partition_property[arrayLength]);
264-
PI_CALL(RT::piDeviceGetInfo, dev, PI_DEVICE_INFO_PARTITION_TYPE, resultSize,
264+
PI_CALL(piDeviceGetInfo, dev, PI_DEVICE_INFO_PARTITION_TYPE, resultSize,
265265
arrayResult.get(), nullptr);
266266
if (!arrayResult[0])
267267
return info::partition_property::no_partition;
@@ -273,12 +273,12 @@ template <>
273273
struct get_device_info<vector_class<size_t>, info::device::sub_group_sizes> {
274274
static vector_class<size_t> _(RT::PiDevice dev) {
275275
size_t resultSize = 0;
276-
PI_CALL(RT::piDeviceGetInfo, dev,
276+
PI_CALL(piDeviceGetInfo, dev,
277277
pi::cast<RT::PiDeviceInfo>(info::device::sub_group_sizes), 0,
278278
nullptr, &resultSize);
279279

280280
vector_class<size_t> result(resultSize / sizeof(size_t));
281-
PI_CALL(RT::piDeviceGetInfo, dev,
281+
PI_CALL(piDeviceGetInfo, dev,
282282
pi::cast<RT::PiDeviceInfo>(info::device::sub_group_sizes),
283283
resultSize, result.data(), nullptr);
284284
return result;

sycl/include/CL/sycl/detail/event_info.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ template <info::event_profiling Param> struct get_event_profiling_info {
2222
static RetType _(RT::PiEvent Event) {
2323
RetType Result = 0;
2424
// TODO catch an exception and put it to list of asynchronous exceptions
25-
PI_CALL(RT::piEventGetProfilingInfo,
26-
Event, cl_profiling_info(Param), sizeof(Result), &Result, nullptr);
25+
PI_CALL(piEventGetProfilingInfo, Event, cl_profiling_info(Param),
26+
sizeof(Result), &Result, nullptr);
2727
return Result;
2828
}
2929
};
@@ -34,8 +34,8 @@ template <info::event Param> struct get_event_info {
3434
static RetType _(RT::PiEvent Event) {
3535
RetType Result = (RetType)0;
3636
// TODO catch an exception and put it to list of asynchronous exceptions
37-
PI_CALL(RT::piEventGetInfo,
38-
Event, cl_profiling_info(Param), sizeof(Result), &Result, nullptr);
37+
PI_CALL(piEventGetInfo, Event, cl_profiling_info(Param), sizeof(Result),
38+
&Result, nullptr);
3939
return Result;
4040
}
4141
};

sycl/include/CL/sycl/detail/image_impl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class image_impl final : public SYCLMemObjT<AllocatorT> {
231231
: BaseT(MemObject, SyclContext, std::move(AvailableEvent)),
232232
MRange(InitializedVal<Dimensions, range>::template get<0>()) {
233233
RT::PiMem Mem = pi::cast<RT::PiMem>(BaseT::MInteropMemObject);
234-
PI_CALL(RT::piMemGetInfo, Mem, CL_MEM_SIZE, sizeof(size_t),
234+
PI_CALL(piMemGetInfo, Mem, CL_MEM_SIZE, sizeof(size_t),
235235
&(BaseT::MSizeInBytes), nullptr);
236236

237237
RT::PiMemImageFormat Format;
@@ -342,7 +342,7 @@ class image_impl final : public SYCLMemObjT<AllocatorT> {
342342
private:
343343
template <typename T> void getImageInfo(RT::PiMemImageInfo Info, T &Dest) {
344344
RT::PiMem Mem = pi::cast<RT::PiMem>(BaseT::MInteropMemObject);
345-
PI_CALL(RT::piMemImageGetInfo, Mem, Info, sizeof(T), &Dest, nullptr);
345+
PI_CALL(piMemImageGetInfo, Mem, Info, sizeof(T), &Dest, nullptr);
346346
}
347347

348348
template <info::device Param>

sycl/include/CL/sycl/detail/kernel_impl.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ class kernel_impl {
3838
IsCreatedFromSource(IsCreatedFromSource) {
3939

4040
RT::PiContext Context = nullptr;
41-
PI_CALL(RT::piKernelGetInfo, Kernel, CL_KERNEL_CONTEXT, sizeof(Context),
41+
PI_CALL(piKernelGetInfo, Kernel, CL_KERNEL_CONTEXT, sizeof(Context),
4242
&Context, nullptr);
4343
auto ContextImpl = detail::getSyclObjImpl(SyclContext);
4444
if (ContextImpl->getHandleRef() != Context)
4545
throw cl::sycl::invalid_parameter_error(
4646
"Input context must be the same as the context of cl_kernel");
47-
PI_CALL(RT::piKernelRetain, Kernel);
47+
PI_CALL(piKernelRetain, Kernel);
4848
}
4949

5050
// Host kernel constructor
@@ -55,15 +55,15 @@ class kernel_impl {
5555
~kernel_impl() {
5656
// TODO catch an exception and put it to list of asynchronous exceptions
5757
if (!is_host()) {
58-
PI_CALL(RT::piKernelRelease, Kernel);
58+
PI_CALL(piKernelRelease, Kernel);
5959
}
6060
}
6161

6262
cl_kernel get() const {
6363
if (is_host()) {
6464
throw invalid_object_error("This instance of kernel is a host instance");
6565
}
66-
PI_CALL(RT::piKernelRetain, Kernel);
66+
PI_CALL(piKernelRetain, Kernel);
6767
return pi::cast<cl_kernel>(Kernel);
6868
}
6969

sycl/include/CL/sycl/detail/kernel_info.hpp

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ template <info::kernel Param> struct get_kernel_info<string_class, Param> {
2424
static string_class _(RT::PiKernel Kernel) {
2525
size_t ResultSize;
2626
// TODO catch an exception and put it to list of asynchronous exceptions
27-
PI_CALL(RT::piKernelGetInfo,
28-
Kernel, cl_kernel_info(Param), 0, nullptr, &ResultSize);
27+
PI_CALL(piKernelGetInfo, Kernel, cl_kernel_info(Param), 0, nullptr,
28+
&ResultSize);
2929
if (ResultSize == 0) {
3030
return "";
3131
}
3232
vector_class<char> Result(ResultSize);
3333
// TODO catch an exception and put it to list of asynchronous exceptions
34-
PI_CALL(RT::piKernelGetInfo,
35-
Kernel, cl_kernel_info(Param), ResultSize, Result.data(), nullptr);
34+
PI_CALL(piKernelGetInfo, Kernel, cl_kernel_info(Param), ResultSize,
35+
Result.data(), nullptr);
3636
return string_class(Result.data());
3737
}
3838
};
@@ -41,8 +41,8 @@ template <info::kernel Param> struct get_kernel_info<cl_uint, Param> {
4141
static cl_uint _(RT::PiKernel Kernel) {
4242
cl_uint Result;
4343
// TODO catch an exception and put it to list of asynchronous exceptions
44-
PI_CALL(RT::piKernelGetInfo,
45-
Kernel, cl_kernel_info(Param), sizeof(cl_uint), &Result, nullptr);
44+
PI_CALL(piKernelGetInfo, Kernel, cl_kernel_info(Param), sizeof(cl_uint),
45+
&Result, nullptr);
4646
return Result;
4747
}
4848
};
@@ -54,9 +54,8 @@ struct get_kernel_work_group_info {
5454
static T _(RT::PiKernel Kernel, RT::PiDevice Device) {
5555
T Result;
5656
// TODO catch an exception and put it to list of asynchronous exceptions
57-
PI_CALL(RT::piKernelGetGroupInfo,
58-
Kernel, Device, cl_kernel_work_group_info(Param),
59-
sizeof(T), &Result, nullptr);
57+
PI_CALL(piKernelGetGroupInfo, Kernel, Device,
58+
cl_kernel_work_group_info(Param), sizeof(T), &Result, nullptr);
6059
return Result;
6160
}
6261
};
@@ -66,9 +65,9 @@ struct get_kernel_work_group_info<cl::sycl::range<3>, Param> {
6665
static cl::sycl::range<3> _(RT::PiKernel Kernel, RT::PiDevice Device) {
6766
size_t Result[3];
6867
// TODO catch an exception and put it to list of asynchronous exceptions
69-
PI_CALL(RT::piKernelGetGroupInfo,
70-
Kernel, Device, cl_kernel_work_group_info(Param),
71-
sizeof(size_t) * 3, Result, nullptr);
68+
PI_CALL(piKernelGetGroupInfo, Kernel, Device,
69+
cl_kernel_work_group_info(Param), sizeof(size_t) * 3, Result,
70+
nullptr);
7271
return cl::sycl::range<3>(Result[0], Result[1], Result[2]);
7372
}
7473
};
@@ -109,9 +108,9 @@ struct get_kernel_sub_group_info {
109108
static TOut _(RT::PiKernel Kernel, RT::PiDevice Device) {
110109
TOut Result;
111110
// TODO catch an exception and put it to list of asynchronous exceptions
112-
PI_CALL(RT::piKernelGetSubGroupInfo,
113-
Kernel, Device, cl_kernel_sub_group_info(Param), 0, nullptr,
114-
sizeof(TOut), &Result, nullptr);
111+
PI_CALL(piKernelGetSubGroupInfo, Kernel, Device,
112+
cl_kernel_sub_group_info(Param), 0, nullptr, sizeof(TOut), &Result,
113+
nullptr);
115114
return Result;
116115
}
117116
};
@@ -121,9 +120,9 @@ struct get_kernel_sub_group_info_with_input {
121120
static TOut _(RT::PiKernel Kernel, RT::PiDevice Device, TIn In) {
122121
TOut Result;
123122
// TODO catch an exception and put it to list of asynchronous exceptions
124-
PI_CALL(RT::piKernelGetSubGroupInfo,
125-
Kernel, Device, cl_kernel_sub_group_info(Param), sizeof(TIn), &In,
126-
sizeof(TOut), &Result, nullptr);
123+
PI_CALL(piKernelGetSubGroupInfo, Kernel, Device,
124+
cl_kernel_sub_group_info(Param), sizeof(TIn), &In, sizeof(TOut),
125+
&Result, nullptr);
127126
return Result;
128127
}
129128
};
@@ -135,9 +134,9 @@ struct get_kernel_sub_group_info_with_input<cl::sycl::range<3>, Param,
135134
size_t In) {
136135
size_t Result[3];
137136
// TODO catch an exception and put it to list of asynchronous exceptions
138-
PI_CALL(RT::piKernelGetSubGroupInfo,
139-
Kernel, Device, cl_kernel_sub_group_info(Param), sizeof(size_t),
140-
&In, sizeof(size_t) * 3, Result, nullptr);
137+
PI_CALL(piKernelGetSubGroupInfo, Kernel, Device,
138+
cl_kernel_sub_group_info(Param), sizeof(size_t), &In,
139+
sizeof(size_t) * 3, Result, nullptr);
141140
return cl::sycl::range<3>(Result[0], Result[1], Result[2]);
142141
}
143142
};
@@ -150,9 +149,9 @@ struct get_kernel_sub_group_info_with_input<size_t, Param,
150149
size_t Input[3] = {In[0], In[1], In[2]};
151150
size_t Result;
152151
// TODO catch an exception and put it to list of asynchronous exceptions
153-
PI_CALL(RT::piKernelGetSubGroupInfo,
154-
Kernel, Device, cl_kernel_sub_group_info(Param), sizeof(size_t) * 3,
155-
Input, sizeof(size_t), &Result, nullptr);
152+
PI_CALL(piKernelGetSubGroupInfo, Kernel, Device,
153+
cl_kernel_sub_group_info(Param), sizeof(size_t) * 3, Input,
154+
sizeof(size_t), &Result, nullptr);
156155
return Result;
157156
}
158157
};

0 commit comments

Comments
 (0)