Skip to content

Info queries for interop objects fail silently #1235

Open
@alexbatashev

Description

@alexbatashev

Objects that have been created with interop APIs often lack important pieces of information, required for info queries. For example, urEventCreateWithNativeHandle expects a native CUDA handle, and the resulting event handle will lack a reference to a UR queue. However, urEventGetInfo has no checks for whether an object was created with a native API or not, neither it will return an error in that case. Instead the returned queue handle will be invalid, i.e. == nullptr:

UR_APIEXPORT ur_result_t UR_APICALL urEventGetInfo(ur_event_handle_t hEvent,
ur_event_info_t propName,
size_t propValueSize,
void *pPropValue,
size_t *pPropValueSizeRet) {
UrReturnHelper ReturnValue(propValueSize, pPropValue, pPropValueSizeRet);
switch (propName) {
case UR_EVENT_INFO_COMMAND_QUEUE:
return ReturnValue(hEvent->getQueue());
case UR_EVENT_INFO_COMMAND_TYPE:
return ReturnValue(hEvent->getCommandType());
case UR_EVENT_INFO_REFERENCE_COUNT:
return ReturnValue(hEvent->getReferenceCount());
case UR_EVENT_INFO_COMMAND_EXECUTION_STATUS:
return ReturnValue(hEvent->getExecutionStatus());
case UR_EVENT_INFO_CONTEXT:
return ReturnValue(hEvent->getContext());
default:
detail::ur::die("Event info request not implemented");
}
return UR_RESULT_ERROR_INVALID_ENUMERATION;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    conformanceConformance test suite issues.cudaCUDA adapter specific issueshipHIP adapter specific issuesspecificationChanges or additions to the specification

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions