Skip to content

Commit da36441

Browse files
author
Steffen Larsen
committed
[SYCL][PI][CUDA] Kernel group preferred size multiple
Signed-off-by: Steffen Larsen <[email protected]>
1 parent 556dda7 commit da36441

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,12 @@ typedef enum {
241241
} _pi_kernel_info;
242242

243243
typedef enum {
244-
PI_KERNEL_GROUP_INFO_SIZE = CL_KERNEL_WORK_GROUP_SIZE,
245-
PI_KERNEL_COMPILE_GROUP_INFO_SIZE = CL_KERNEL_COMPILE_WORK_GROUP_SIZE,
246-
PI_KERNEL_LOCAL_MEM_SIZE = CL_KERNEL_LOCAL_MEM_SIZE
244+
PI_KERNEL_GROUP_INFO_SIZE = CL_KERNEL_WORK_GROUP_SIZE,
245+
PI_KERNEL_COMPILE_GROUP_INFO_SIZE =
246+
CL_KERNEL_COMPILE_WORK_GROUP_SIZE,
247+
PI_KERNEL_LOCAL_MEM_SIZE = CL_KERNEL_LOCAL_MEM_SIZE,
248+
PI_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE =
249+
CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE
247250
} _pi_kernel_group_info;
248251

249252
typedef enum {

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,6 +2065,15 @@ pi_result cuda_piKernelGetGroupInfo(pi_kernel kernel, pi_device device,
20652065
return getInfo(param_value_size, param_value, param_value_size_ret,
20662066
pi_uint64(bytes));
20672067
}
2068+
case PI_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE: {
2069+
// Work groups should be multiples of the warp size
2070+
int warpSize = 0;
2071+
cl::sycl::detail::pi::assertion(cuDeviceGetAttribute(&warpSize,
2072+
CU_DEVICE_ATTRIBUTE_WARP_SIZE,
2073+
device->get()) == CUDA_SUCCESS);
2074+
return getInfo(param_value_size, param_value, param_value_size_ret,
2075+
static_cast<size_t>(warpSize));
2076+
}
20682077
default:
20692078
PI_HANDLE_UNKNOWN_PARAM_NAME(param_name);
20702079
}

0 commit comments

Comments
 (0)