Skip to content

urPlatformCreateWithNativeHandle should accept adapter #1068

@alexbatashev

Description

@alexbatashev

Currently urPlatformCreateWithNativeHandle tries to extract dispatch table from native platform handle. That, however, can't work because the native handle may be anything, including nullptr, which may be a valid case for some adapters. So, instead the API should be something like:

UR_APIEXPORT ur_result_t UR_APICALL urPlatformCreateWithNativeHandle(ur_native_handle_t hNativePlatform, ur_adapter_handle_t adapter, const ur_platform_native_properties_t *pProperties, ur_platform_handle_t *phPlatform)

Which would be consistent with how SYCL handles the matter:

namespace sycl {

template <backend Backend>
platform make_platform(const backend_input_t<Backend, platform>& backendObject);

}

where backend is part of the API call.

This also reveals a big gap in CTS testing - CTS gets native object from the UR API and then feeds it back, which means that the creation of UR objects from external handles (e.g., from cuBLAS or something) is never tested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    conformanceConformance test suite issues.specificationChanges or additions to the specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions