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(())
|
||||
}
|
||||
|
||||
#[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)]
|
||||
fn get_device_and_host_timer(
|
||||
device: cl_device_id,
|
||||
|
@@ -115,7 +115,7 @@ pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
|
||||
clRetainDeviceEXT: None,
|
||||
clReleaseDeviceEXT: None,
|
||||
clCreateEventFromGLsyncKHR: None,
|
||||
clCreateSubDevices: None,
|
||||
clCreateSubDevices: Some(clCreateSubDevices),
|
||||
clRetainDevice: Some(clRetainDevice),
|
||||
clReleaseDevice: Some(clReleaseDevice),
|
||||
clCreateImage: Some(clCreateImage),
|
||||
|
Reference in New Issue
Block a user