rusticl: Add clCreateSubDevices stub
unified-runtime tries to call this unconditionally. It handles errors correctly, but calling None here isn't an error, it's a crash. Just return CL_INVALID_VALUE so we don't crash. Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30699>
This commit is contained in:
@@ -372,6 +372,20 @@ fn release_device(_device: cl_device_id) -> CLResult<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cl_entrypoint(clCreateSubDevices)]
|
||||||
|
fn create_sub_devices(
|
||||||
|
_device: cl_device_id,
|
||||||
|
_properties: *const cl_device_partition_property,
|
||||||
|
_num_devices: cl_uint,
|
||||||
|
_out_devices: *mut cl_device_id,
|
||||||
|
_num_devices_ret: *mut cl_uint,
|
||||||
|
) -> CLResult<()> {
|
||||||
|
// CL_INVALID_VALUE if values specified in properties are not valid or
|
||||||
|
// if values specified in properties are valid but not supported by the
|
||||||
|
// device.
|
||||||
|
Err(CL_INVALID_VALUE)
|
||||||
|
}
|
||||||
|
|
||||||
#[cl_entrypoint(clGetDeviceAndHostTimer)]
|
#[cl_entrypoint(clGetDeviceAndHostTimer)]
|
||||||
fn get_device_and_host_timer(
|
fn get_device_and_host_timer(
|
||||||
device: cl_device_id,
|
device: cl_device_id,
|
||||||
|
@@ -115,7 +115,7 @@ pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
|
|||||||
clRetainDeviceEXT: None,
|
clRetainDeviceEXT: None,
|
||||||
clReleaseDeviceEXT: None,
|
clReleaseDeviceEXT: None,
|
||||||
clCreateEventFromGLsyncKHR: None,
|
clCreateEventFromGLsyncKHR: None,
|
||||||
clCreateSubDevices: None,
|
clCreateSubDevices: Some(clCreateSubDevices),
|
||||||
clRetainDevice: Some(clRetainDevice),
|
clRetainDevice: Some(clRetainDevice),
|
||||||
clReleaseDevice: Some(clReleaseDevice),
|
clReleaseDevice: Some(clReleaseDevice),
|
||||||
clCreateImage: Some(clCreateImage),
|
clCreateImage: Some(clCreateImage),
|
||||||
|
Reference in New Issue
Block a user