@@ -713,6 +713,8 @@ pi_result cuda_piContextGetInfo(pi_context context, pi_context_info param_name,
713
713
case PI_CONTEXT_INFO_REFERENCE_COUNT:
714
714
return getInfo (param_value_size, param_value, param_value_size_ret,
715
715
context->get_reference_count ());
716
+ default :
717
+ PI_HANDLE_UNKNOWN_PARAM_NAME (param_name);
716
718
}
717
719
718
720
return PI_OUT_OF_RESOURCES;
@@ -1032,7 +1034,7 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
1032
1034
}
1033
1035
case PI_DEVICE_INFO_LOCAL_MEM_TYPE: {
1034
1036
return getInfo (param_value_size, param_value, param_value_size_ret,
1035
- PI_LOCAL_MEM_TYPE_LOCAL );
1037
+ PI_DEVICE_LOCAL_MEM_TYPE_LOCAL );
1036
1038
}
1037
1039
case PI_DEVICE_INFO_LOCAL_MEM_SIZE: {
1038
1040
// OpenCL's "local memory" maps most closely to CUDA's "shared memory".
@@ -1073,16 +1075,16 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
1073
1075
return getInfo (param_value_size, param_value, param_value_size_ret,
1074
1076
size_t {1000u });
1075
1077
}
1076
- case PI_DEVICE_INFO_IS_ENDIAN_LITTLE : {
1078
+ case PI_DEVICE_INFO_ENDIAN_LITTLE : {
1077
1079
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1078
1080
}
1079
- case PI_DEVICE_INFO_IS_AVAILABLE : {
1081
+ case PI_DEVICE_INFO_AVAILABLE : {
1080
1082
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1081
1083
}
1082
- case PI_DEVICE_INFO_IS_COMPILER_AVAILABLE : {
1084
+ case PI_DEVICE_INFO_COMPILER_AVAILABLE : {
1083
1085
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1084
1086
}
1085
- case PI_DEVICE_INFO_IS_LINKER_AVAILABLE : {
1087
+ case PI_DEVICE_INFO_LINKER_AVAILABLE : {
1086
1088
return getInfo (param_value_size, param_value, param_value_size_ret, true );
1087
1089
}
1088
1090
case PI_DEVICE_INFO_EXECUTION_CAPABILITIES: {
@@ -1658,8 +1660,8 @@ pi_result cuda_piEnqueueMemBufferWrite(pi_queue command_queue, pi_mem buffer,
1658
1660
event_wait_list, nullptr );
1659
1661
1660
1662
if (event) {
1661
- retImplEv = std::unique_ptr<_pi_event>(
1662
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_WRITE , command_queue));
1663
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
1664
+ PI_COMMAND_TYPE_MEM_BUFFER_WRITE , command_queue));
1663
1665
retImplEv->start ();
1664
1666
}
1665
1667
@@ -1703,8 +1705,8 @@ pi_result cuda_piEnqueueMemBufferRead(pi_queue command_queue, pi_mem buffer,
1703
1705
event_wait_list, nullptr );
1704
1706
1705
1707
if (retEvent) {
1706
- retImplEv = std::unique_ptr<_pi_event>(
1707
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_READ , command_queue));
1708
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
1709
+ PI_COMMAND_TYPE_MEM_BUFFER_READ , command_queue));
1708
1710
retImplEv->start ();
1709
1711
}
1710
1712
@@ -1943,8 +1945,8 @@ pi_result cuda_piEnqueueKernelLaunch(
1943
1945
auto argIndices = kernel->get_arg_indices ();
1944
1946
1945
1947
if (event) {
1946
- retImplEv = std::unique_ptr<_pi_event>(
1947
- _pi_event::make_native (PI_COMMAND_KERNEL_LAUNCH , command_queue));
1948
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
1949
+ PI_COMMAND_TYPE_NDRANGE_KERNEL , command_queue));
1948
1950
retImplEv->start ();
1949
1951
}
1950
1952
@@ -2247,15 +2249,15 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2247
2249
if (kernel != nullptr ) {
2248
2250
2249
2251
switch (param_name) {
2250
- case PI_KERNEL_GROUP_INFO_SIZE : {
2252
+ case PI_KERNEL_GROUP_INFO_WORK_GROUP_SIZE : {
2251
2253
int max_threads = 0 ;
2252
2254
cl::sycl::detail::pi::assertion (cuFuncGetAttribute (&max_threads,
2253
2255
CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK,
2254
2256
kernel->get ()) == CUDA_SUCCESS);
2255
2257
return getInfo (param_value_size, param_value, param_value_size_ret,
2256
2258
size_t (max_threads));
2257
2259
}
2258
- case PI_KERNEL_COMPILE_GROUP_INFO_SIZE : {
2260
+ case PI_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE : {
2259
2261
// Returns the work-group size specified in the kernel source or IL.
2260
2262
// If the work-group size is not specified in the kernel source or IL,
2261
2263
// (0, 0, 0) is returned.
@@ -2266,7 +2268,7 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2266
2268
return getInfoArray (3 , param_value_size, param_value,
2267
2269
param_value_size_ret, group_size);
2268
2270
}
2269
- case PI_KERNEL_LOCAL_MEM_SIZE : {
2271
+ case PI_KERNEL_GROUP_INFO_LOCAL_MEM_SIZE : {
2270
2272
// OpenCL LOCAL == CUDA SHARED
2271
2273
int bytes = 0 ;
2272
2274
cl::sycl::detail::pi::assertion (cuFuncGetAttribute (&bytes,
@@ -2275,7 +2277,7 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2275
2277
return getInfo (param_value_size, param_value, param_value_size_ret,
2276
2278
pi_uint64 (bytes));
2277
2279
}
2278
- case PI_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE : {
2280
+ case PI_KERNEL_GROUP_INFO_PREFERRED_WORK_GROUP_SIZE_MULTIPLE : {
2279
2281
// Work groups should be multiples of the warp size
2280
2282
int warpSize = 0 ;
2281
2283
cl::sycl::detail::pi::assertion (
@@ -2284,7 +2286,7 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
2284
2286
return getInfo (param_value_size, param_value, param_value_size_ret,
2285
2287
static_cast <size_t >(warpSize));
2286
2288
}
2287
- case PI_KERNEL_PRIVATE_MEM_SIZE : {
2289
+ case PI_KERNEL_GROUP_INFO_PRIVATE_MEM_SIZE : {
2288
2290
// OpenCL PRIVATE == CUDA LOCAL
2289
2291
int bytes = 0 ;
2290
2292
cl::sycl::detail::pi::assertion (
@@ -2373,7 +2375,7 @@ pi_result cuda_piEventGetInfo(pi_event event, pi_event_info param_name,
2373
2375
assert (event != nullptr );
2374
2376
2375
2377
switch (param_name) {
2376
- case PI_EVENT_INFO_QUEUE :
2378
+ case PI_EVENT_INFO_COMMAND_QUEUE :
2377
2379
return getInfo<pi_queue>(param_value_size, param_value,
2378
2380
param_value_size_ret, event->get_queue ());
2379
2381
case PI_EVENT_INFO_COMMAND_TYPE:
@@ -2554,7 +2556,7 @@ pi_result cuda_piEnqueueEventsWait(pi_queue command_queue,
2554
2556
2555
2557
if (event) {
2556
2558
auto new_event =
2557
- _pi_event::make_native (PI_COMMAND_EVENTS_WAIT , command_queue);
2559
+ _pi_event::make_native (PI_COMMAND_TYPE_MARKER , command_queue);
2558
2560
new_event->start ();
2559
2561
new_event->record ();
2560
2562
*event = new_event;
@@ -2648,8 +2650,8 @@ pi_result cuda_piEnqueueMemBufferReadRect(
2648
2650
event_wait_list, nullptr );
2649
2651
2650
2652
if (retEvent) {
2651
- retImplEv = std::unique_ptr<_pi_event>(
2652
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_READ , command_queue));
2653
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
2654
+ PI_COMMAND_TYPE_MEM_BUFFER_READ , command_queue));
2653
2655
retImplEv->start ();
2654
2656
}
2655
2657
@@ -2699,8 +2701,8 @@ pi_result cuda_piEnqueueMemBufferWriteRect(
2699
2701
event_wait_list, nullptr );
2700
2702
2701
2703
if (retEvent) {
2702
- retImplEv = std::unique_ptr<_pi_event>(
2703
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_WRITE , command_queue));
2704
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
2705
+ PI_COMMAND_TYPE_MEM_BUFFER_WRITE , command_queue));
2704
2706
retImplEv->start ();
2705
2707
}
2706
2708
@@ -2754,8 +2756,8 @@ pi_result cuda_piEnqueueMemBufferCopy(pi_queue command_queue, pi_mem src_buffer,
2754
2756
result = PI_CHECK_ERROR (cuMemcpyDtoDAsync (dst, src, size, stream));
2755
2757
2756
2758
if (event) {
2757
- auto new_event =
2758
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_COPY, command_queue);
2759
+ auto new_event = _pi_event::make_native (PI_COMMAND_TYPE_MEM_BUFFER_COPY,
2760
+ command_queue);
2759
2761
new_event->record ();
2760
2762
*event = new_event;
2761
2763
}
@@ -2792,8 +2794,8 @@ pi_result cuda_piEnqueueMemBufferCopyRect(
2792
2794
event_wait_list, nullptr );
2793
2795
2794
2796
if (event) {
2795
- retImplEv = std::unique_ptr<_pi_event>(
2796
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_COPY , command_queue));
2797
+ retImplEv = std::unique_ptr<_pi_event>(_pi_event::make_native (
2798
+ PI_COMMAND_TYPE_MEM_BUFFER_COPY , command_queue));
2797
2799
retImplEv->start ();
2798
2800
}
2799
2801
@@ -2896,8 +2898,8 @@ pi_result cuda_piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer,
2896
2898
}
2897
2899
2898
2900
if (event) {
2899
- auto new_event =
2900
- _pi_event::make_native (PI_COMMAND_MEMBUFFER_FILL, command_queue);
2901
+ auto new_event = _pi_event::make_native (PI_COMMAND_TYPE_MEM_BUFFER_FILL,
2902
+ command_queue);
2901
2903
new_event->record ();
2902
2904
*event = new_event;
2903
2905
}
0 commit comments