rusticl/pipe: add clGetPipeInfo stub end return CL_INVALID_MEM_OBJECT

spec requires this for devices not supporting pipes

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15439>
This commit is contained in:
Karol Herbst
2022-03-20 21:47:33 +01:00
committed by Marge Bot
parent 8e13e90b71
commit ebce0770e3
3 changed files with 19 additions and 8 deletions

View File

@@ -1516,14 +1516,18 @@ extern "C" fn cl_create_pipe(
}
extern "C" fn cl_get_pipe_info(
_pipe: cl_mem,
_param_name: cl_pipe_info,
_param_value_size: usize,
_param_value: *mut ::std::os::raw::c_void,
_param_value_size_ret: *mut usize,
pipe: cl_mem,
param_name: cl_pipe_info,
param_value_size: usize,
param_value: *mut ::std::os::raw::c_void,
param_value_size_ret: *mut usize,
) -> cl_int {
println!("get_pipe_info not implemented");
CL_OUT_OF_HOST_MEMORY
match_err!(pipe.get_info(
param_name,
param_value_size,
param_value,
param_value_size_ret,
))
}
extern "C" fn cl_svm_alloc(

View File

@@ -1604,3 +1604,10 @@ pub fn enqueue_migrate_mem_objects(
//• CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for the specified set of memory objects in mem_objects.
}
impl CLInfo<cl_pipe_info> for cl_mem {
fn query(&self, _q: cl_pipe_info, _: &[u8]) -> CLResult<Vec<u8>> {
// CL_INVALID_MEM_OBJECT if pipe is a not a valid pipe object.
Err(CL_INVALID_MEM_OBJECT)
}
}

View File

@@ -133,7 +133,7 @@ rusticl_opencl_bindings_rs = rust.bindgen(
'--whitelist-type', 'cl_.*',
'--whitelist-var', 'CL_.*',
# some info types need to be strongly typed so we can implement various get_infos
'--new-type-alias-deref', 'cl_(mem|image)_info',
'--new-type-alias-deref', 'cl_(mem|image|pipe)_info',
'--new-type-alias-deref', 'cl_kernel_(arg|work_group)_info',
'--new-type-alias-deref', 'cl_(event|profiling)_info',
],