@@ -691,6 +691,8 @@ pi_result cuda_piContextGetInfo(pi_context context, pi_context_info param_name,
691
691
case PI_CONTEXT_INFO_REFERENCE_COUNT:
692
692
return getInfo (param_value_size, param_value, param_value_size_ret,
693
693
context->get_reference_count ());
694
+ default :
695
+ PI_HANDLE_UNKNOWN_PARAM_NAME (param_name);
694
696
}
695
697
696
698
return PI_OUT_OF_RESOURCES;
@@ -1010,7 +1012,7 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
1010
1012
}
1011
1013
case PI_DEVICE_INFO_LOCAL_MEM_TYPE: {
1012
1014
return getInfo (param_value_size, param_value, param_value_size_ret,
1013
- PI_LOCAL_MEM_TYPE_LOCAL );
1015
+ PI_DEVICE_LOCAL_MEM_TYPE_LOCAL );
1014
1016
}
1015
1017
case PI_DEVICE_INFO_LOCAL_MEM_SIZE: {
1016
1018
// OpenCL's "local memory" maps most closely to CUDA's "shared memory".
@@ -1051,16 +1053,16 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
1051
1053
return getInfo (param_value_size, param_value, param_value_size_ret,
1052
1054
size_t {1000u });
1053
1055
}
1054
- case PI_DEVICE_INFO_IS_ENDIAN_LITTLE : {
1056
+ case PI_DEVICE_INFO_ENDIAN_LITTLE : {
1055
1057
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1056
1058
}
1057
- case PI_DEVICE_INFO_IS_AVAILABLE : {
1059
+ case PI_DEVICE_INFO_AVAILABLE : {
1058
1060
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1059
1061
}
1060
- case PI_DEVICE_INFO_IS_COMPILER_AVAILABLE : {
1062
+ case PI_DEVICE_INFO_COMPILER_AVAILABLE : {
1061
1063
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1062
1064
}
1063
- case PI_DEVICE_INFO_IS_LINKER_AVAILABLE : {
1065
+ case PI_DEVICE_INFO_LINKER_AVAILABLE : {
1064
1066
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1065
1067
}
1066
1068
case PI_DEVICE_INFO_EXECUTION_CAPABILITIES: {
@@ -1630,8 +1632,8 @@ pi_result cuda_piEnqueueMemBufferWrite(pi_queue command_queue, pi_mem buffer,
1630
1632
event_wait_list, nullptr );
1631
1633
1632
1634
if (event) {
1633
- retImplEv = std::unique_ptr<_pi_event>(
1634
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_WRITE , command_queue));
1635
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
1636
+ PI_COMMAND_TYPE_MEM_BUFFER_WRITE , command_queue));
1635
1637
retImplEv->start ();
1636
1638
}
1637
1639
@@ -1675,8 +1677,8 @@ pi_result cuda_piEnqueueMemBufferRead(pi_queue command_queue, pi_mem buffer,
1675
1677
event_wait_list, nullptr );
1676
1678
1677
1679
if (retEvent) {
1678
- retImplEv = std::unique_ptr<_pi_event>(
1679
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_READ , command_queue));
1680
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
1681
+ PI_COMMAND_TYPE_MEM_BUFFER_READ , command_queue));
1680
1682
retImplEv->start ();
1681
1683
}
1682
1684
@@ -1915,8 +1917,8 @@ pi_result cuda_piEnqueueKernelLaunch(
1915
1917
auto argIndices = kernel->get_arg_indices ();
1916
1918
1917
1919
if (event) {
1918
- retImplEv = std::unique_ptr<_pi_event>(
1919
- _pi_event::make_native (PI_COMMAND_KERNEL_LAUNCH , command_queue));
1920
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
1921
+ PI_COMMAND_TYPE_NDRANGE_KERNEL , command_queue));
1920
1922
retImplEv->start ();
1921
1923
}
1922
1924
@@ -2153,15 +2155,15 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2153
2155
if (kernel != nullptr ) {
2154
2156
2155
2157
switch (param_name) {
2156
- case PI_KERNEL_GROUP_INFO_SIZE : {
2158
+ case PI_KERNEL_GROUP_INFO_WORK_GROUP_SIZE : {
2157
2159
int max_threads = 0 ;
2158
2160
cl::sycl::detail::pi::assertion (cuFuncGetAttribute (&max_threads,
2159
2161
CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK,
2160
2162
kernel->get ()) == CUDA_SUCCESS);
2161
2163
return getInfo (param_value_size, param_value, param_value_size_ret,
2162
2164
size_t (max_threads));
2163
2165
}
2164
- case PI_KERNEL_COMPILE_GROUP_INFO_SIZE : {
2166
+ case PI_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE : {
2165
2167
// Returns the work-group size specified in the kernel source or IL.
2166
2168
// If the work-group size is not specified in the kernel source or IL,
2167
2169
// (0, 0, 0) is returned.
@@ -2172,7 +2174,7 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2172
2174
return getInfoArray (3 , param_value_size, param_value,
2173
2175
param_value_size_ret, group_size);
2174
2176
}
2175
- case PI_KERNEL_LOCAL_MEM_SIZE : {
2177
+ case PI_KERNEL_GROUP_INFO_LOCAL_MEM_SIZE : {
2176
2178
// OpenCL LOCAL == CUDA SHARED
2177
2179
int bytes = 0 ;
2178
2180
cl::sycl::detail::pi::assertion (cuFuncGetAttribute (&bytes,
@@ -2181,7 +2183,7 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2181
2183
return getInfo (param_value_size, param_value, param_value_size_ret,
2182
2184
pi_uint64 (bytes));
2183
2185
}
2184
- case PI_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE : {
2186
+ case PI_KERNEL_GROUP_INFO_PREFERRED_WORK_GROUP_SIZE_MULTIPLE : {
2185
2187
// Work groups should be multiples of the warp size
2186
2188
int warpSize = 0 ;
2187
2189
cl::sycl::detail::pi::assertion (
@@ -2190,7 +2192,7 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2190
2192
return getInfo (param_value_size, param_value, param_value_size_ret,
2191
2193
static_cast <size_t >(warpSize));
2192
2194
}
2193
- case PI_KERNEL_PRIVATE_MEM_SIZE : {
2195
+ case PI_KERNEL_GROUP_INFO_PRIVATE_MEM_SIZE : {
2194
2196
// OpenCL PRIVATE == CUDA LOCAL
2195
2197
int bytes = 0 ;
2196
2198
cl::sycl::detail::pi::assertion (
@@ -2279,7 +2281,7 @@ pi_result cuda_piEventGetInfo(pi_event event, pi_event_info param_name,
2279
2281
assert (event != nullptr );
2280
2282
2281
2283
switch (param_name) {
2282
- case PI_EVENT_INFO_QUEUE :
2284
+ case PI_EVENT_INFO_COMMAND_QUEUE :
2283
2285
return getInfo<pi_queue>(param_value_size, param_value,
2284
2286
param_value_size_ret, event->get_queue ());
2285
2287
case PI_EVENT_INFO_COMMAND_TYPE:
@@ -2456,7 +2458,7 @@ pi_result cuda_piEnqueueEventsWait(pi_queue command_queue,
2456
2458
2457
2459
if (event) {
2458
2460
auto new_event =
2459
- _pi_event::make_native (PI_COMMAND_EVENTS_WAIT , command_queue);
2461
+ _pi_event::make_native (PI_COMMAND_TYPE_MARKER , command_queue);
2460
2462
new_event->start ();
2461
2463
new_event->record ();
2462
2464
*event = new_event;
@@ -2550,8 +2552,8 @@ pi_result cuda_piEnqueueMemBufferReadRect(
2550
2552
event_wait_list, nullptr );
2551
2553
2552
2554
if (retEvent) {
2553
- retImplEv = std::unique_ptr<_pi_event>(
2554
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_READ , command_queue));
2555
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
2556
+ PI_COMMAND_TYPE_MEM_BUFFER_READ , command_queue));
2555
2557
retImplEv->start ();
2556
2558
}
2557
2559
@@ -2601,8 +2603,8 @@ pi_result cuda_piEnqueueMemBufferWriteRect(
2601
2603
event_wait_list, nullptr );
2602
2604
2603
2605
if (retEvent) {
2604
- retImplEv = std::unique_ptr<_pi_event>(
2605
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_WRITE , command_queue));
2606
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
2607
+ PI_COMMAND_TYPE_MEM_BUFFER_WRITE , command_queue));
2606
2608
retImplEv->start ();
2607
2609
}
2608
2610
@@ -2656,8 +2658,8 @@ pi_result cuda_piEnqueueMemBufferCopy(pi_queue command_queue, pi_mem src_buffer,
2656
2658
result = PI_CHECK_ERROR (cuMemcpyDtoDAsync (dst, src, size, stream));
2657
2659
2658
2660
if (event) {
2659
- auto new_event =
2660
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_COPY, command_queue);
2661
+ auto new_event = _pi_event::make_native (PI_COMMAND_TYPE_MEM_BUFFER_COPY,
2662
+ command_queue);
2661
2663
new_event->record ();
2662
2664
*event = new_event;
2663
2665
}
@@ -2694,8 +2696,8 @@ pi_result cuda_piEnqueueMemBufferCopyRect(
2694
2696
event_wait_list, nullptr );
2695
2697
2696
2698
if (event) {
2697
- retImplEv = std::unique_ptr<_pi_event>(
2698
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_COPY , command_queue));
2699
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
2700
+ PI_COMMAND_TYPE_MEM_BUFFER_COPY , command_queue));
2699
2701
retImplEv->start ();
2700
2702
}
2701
2703
@@ -2798,8 +2800,8 @@ pi_result cuda_piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer,
2798
2800
}
2799
2801
2800
2802
if (event) {
2801
- auto new_event =
2802
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_FILL, command_queue);
2803
+ auto new_event = _pi_event::make_native (PI_COMMAND_TYPE_MEM_BUFFER_FILL,
2804
+ command_queue);
2803
2805
new_event->record ();
2804
2806
*event = new_event;
2805
2807
}
0 commit comments