From: Karol Herbst Date: Sun, 20 Mar 2022 20:47:33 +0000 (+0100) Subject: rusticl/pipe: add clGetPipeInfo stub end return CL_INVALID_MEM_OBJECT X-Git-Tag: upstream/22.3.5~3293 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ebce0770e30cd9dfb92ba6bcd3a0dcdaee715dd4;p=platform%2Fupstream%2Fmesa.git rusticl/pipe: add clGetPipeInfo stub end return CL_INVALID_MEM_OBJECT spec requires this for devices not supporting pipes Signed-off-by: Karol Herbst Acked-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/frontends/rusticl/api/icd.rs b/src/gallium/frontends/rusticl/api/icd.rs index 6eebb02..2424d5d 100644 --- a/src/gallium/frontends/rusticl/api/icd.rs +++ b/src/gallium/frontends/rusticl/api/icd.rs @@ -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( diff --git a/src/gallium/frontends/rusticl/api/memory.rs b/src/gallium/frontends/rusticl/api/memory.rs index 4b7372c..b52c1bd 100644 --- a/src/gallium/frontends/rusticl/api/memory.rs +++ b/src/gallium/frontends/rusticl/api/memory.rs @@ -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 for cl_mem { + fn query(&self, _q: cl_pipe_info, _: &[u8]) -> CLResult> { + // CL_INVALID_MEM_OBJECT if pipe is a not a valid pipe object. + Err(CL_INVALID_MEM_OBJECT) + } +} diff --git a/src/gallium/frontends/rusticl/meson.build b/src/gallium/frontends/rusticl/meson.build index 633672d..44d2c85 100644 --- a/src/gallium/frontends/rusticl/meson.build +++ b/src/gallium/frontends/rusticl/meson.build @@ -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', ],