rusticl/program: add stubs for program ctors and dtors

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 22:01:31 +01:00 committed by Marge Bot
parent ebce0770e3
commit e646a30925
2 changed files with 19 additions and 1 deletions

View file

@ -166,7 +166,7 @@ pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
clGetHostTimer: None,
clGetKernelSubGroupInfo: Some(cl_get_kernel_sub_group_info),
clSetDefaultDeviceCommandQueue: None,
clSetProgramReleaseCallback: None,
clSetProgramReleaseCallback: Some(cl_set_program_release_callback),
clSetProgramSpecializationConstant: Some(cl_set_program_specialization_constant),
clCreateBufferWithProperties: Some(cl_create_buffer_with_properties),
clCreateImageWithProperties: Some(cl_create_image_with_properties),
@ -1669,6 +1669,14 @@ extern "C" fn cl_get_kernel_sub_group_info(
CL_OUT_OF_HOST_MEMORY
}
extern "C" fn cl_set_program_release_callback(
program: cl_program,
pfn_notify: ::std::option::Option<ProgramCB>,
user_data: *mut ::std::os::raw::c_void,
) -> cl_int {
match_err!(set_program_release_callback(program, pfn_notify, user_data))
}
extern "C" fn cl_set_program_specialization_constant(
program: cl_program,
spec_id: cl_uint,

View file

@ -47,6 +47,8 @@ impl CLInfo<cl_program_info> for cl_program {
CL_PROGRAM_NUM_DEVICES => cl_prop::<cl_uint>(prog.devs.len() as cl_uint),
CL_PROGRAM_NUM_KERNELS => cl_prop::<usize>(prog.kernels().len()),
CL_PROGRAM_REFERENCE_COUNT => cl_prop::<cl_uint>(self.refcnt()?),
CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT => cl_prop::<cl_bool>(CL_FALSE),
CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT => cl_prop::<cl_bool>(CL_FALSE),
CL_PROGRAM_SOURCE => cl_prop::<&CStr>(prog.src.as_c_str()),
// CL_INVALID_VALUE if param_name is not one of the supported values
_ => return Err(CL_INVALID_VALUE),
@ -371,3 +373,11 @@ pub fn set_program_specialization_constant(
println!("set_program_specialization_constantnot implemented");
Err(CL_INVALID_OPERATION)
}
pub fn set_program_release_callback(
_program: cl_program,
_pfn_notify: ::std::option::Option<ProgramCB>,
_user_data: *mut ::std::os::raw::c_void,
) -> CLResult<()> {
Err(CL_INVALID_OPERATION)
}