Skip to content

Commit

Permalink
[SYCL][UR] Bump UR version and add missing values to pi2ur (intel#10049)
Browse files Browse the repository at this point in the history
Includes a large number of missing `pi_result` mappings, so previously
reported errors should no longer map to just `PI_ERROR_UNKNOWN`. NFCI
for the adapters.
  • Loading branch information
callumfare authored Jun 26, 2023
1 parent 7847b96 commit 972aa67
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,

return ReturnValue(ILVersion.data(), ILVersion.size());
}
case UR_EXT_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP: {
case UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP: {
// Maximum number of 32-bit registers available to a thread block.
// Note: This number is shared by all thread blocks simultaneously resident
// on a multiprocessor.
Expand Down
25 changes: 17 additions & 8 deletions kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelGetNativeHandle(
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
}

UR_APIEXPORT ur_result_t UR_APICALL
urKernelSetArgValue(ur_kernel_handle_t hKernel, uint32_t argIndex,
size_t argSize, const void *pArgValue) {
UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgValue(
ur_kernel_handle_t hKernel, uint32_t argIndex, size_t argSize,
const ur_kernel_arg_value_properties_t *pProperties,
const void *pArgValue) {
std::ignore = pProperties;
UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
UR_ASSERT(argSize, UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE);

Expand Down Expand Up @@ -289,8 +291,11 @@ urKernelGetSubGroupInfo(ur_kernel_handle_t hKernel, ur_device_handle_t hDevice,
return UR_RESULT_ERROR_INVALID_ENUMERATION;
}

UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgPointer(
ur_kernel_handle_t hKernel, uint32_t argIndex, const void *pArgValue) {
UR_APIEXPORT ur_result_t UR_APICALL
urKernelSetArgPointer(ur_kernel_handle_t hKernel, uint32_t argIndex,
const ur_kernel_arg_pointer_properties_t *pProperties,
const void *pArgValue) {
std::ignore = pProperties;
hKernel->setKernelArg(argIndex, sizeof(pArgValue), pArgValue);
return UR_RESULT_SUCCESS;
}
Expand Down Expand Up @@ -339,10 +344,12 @@ urKernelSetArgMemObj(ur_kernel_handle_t hKernel, uint32_t argIndex,
}

// A NOP for the CUDA backend
UR_APIEXPORT ur_result_t UR_APICALL
urKernelSetExecInfo(ur_kernel_handle_t hKernel, ur_kernel_exec_info_t propName,
size_t propSize, const void *pPropValue) {
UR_APIEXPORT ur_result_t UR_APICALL urKernelSetExecInfo(
ur_kernel_handle_t hKernel, ur_kernel_exec_info_t propName, size_t propSize,
const ur_kernel_exec_info_properties_t *pProperties,
const void *pPropValue) {
std::ignore = propSize;
std::ignore = pProperties;
UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
UR_ASSERT(pPropValue, UR_RESULT_ERROR_INVALID_NULL_POINTER);
switch (propName) {
Expand Down Expand Up @@ -370,8 +377,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelCreateWithNativeHandle(

UR_APIEXPORT ur_result_t UR_APICALL
urKernelSetArgSampler(ur_kernel_handle_t hKernel, uint32_t argIndex,
const ur_kernel_arg_sampler_properties_t *pProperties,
ur_sampler_handle_t hArgValue) {
UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
std::ignore = pProperties;

ur_result_t Result = UR_RESULT_SUCCESS;
try {
Expand Down
8 changes: 4 additions & 4 deletions queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ urQueueCreate(ur_context_handle_t hContext, ur_device_handle_t hDevice,
bool IsOutOfOrder = false;
if (pProps && pProps->stype == UR_STRUCTURE_TYPE_QUEUE_PROPERTIES) {
URFlags = pProps->flags;
if (URFlags == __SYCL_UR_CUDA_USE_DEFAULT_STREAM) {
if (URFlags == UR_QUEUE_FLAG_USE_DEFAULT_STREAM) {
Flags = CU_STREAM_DEFAULT;
} else if (URFlags == __SYCL_UR_CUDA_SYNC_WITH_DEFAULT) {
} else if (URFlags == UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM) {
Flags = 0;
}

Expand Down Expand Up @@ -261,9 +261,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueCreateWithNativeHandle(

ur_queue_flags_t Flags = 0;
if (CuFlags == CU_STREAM_DEFAULT)
Flags = __SYCL_UR_CUDA_USE_DEFAULT_STREAM;
Flags = UR_QUEUE_FLAG_USE_DEFAULT_STREAM;
else if (CuFlags == CU_STREAM_NON_BLOCKING)
Flags = __SYCL_UR_CUDA_SYNC_WITH_DEFAULT;
Flags = UR_QUEUE_FLAG_SYNC_WITH_DEFAULT_STREAM;
else
sycl::detail::ur::die("Unknown cuda stream");

Expand Down

0 comments on commit 972aa67

Please sign in to comment.