kenba/opencl3

Superfluous/Misleading generic parameter in `ExecuteKernel::set_arg_local_buffer`

Closed this issue · 2 comments

Currently ExecuteKernel::set_arg_local_buffer has a generic type parameter T. Even though it's never actually used. Initially I thought this meant the size was the length of the buffer (with the given data type), but it's indeed the size in bytes.

I think this generic parameter can just be removed.

opencl3/src/kernel.rs

Lines 368 to 389 in f8f972e

/// Set the next argument of the kernel as a local buffer
/// Calls `self.kernel.set_arg_local_buffer` to set the next unset kernel argument.
///
/// # Panics
///
/// Panics if too many arguments have been set.
///
/// * `size` - the size of the local memory buffer in bytes.
///
/// returns a reference to self.
pub fn set_arg_local_buffer<T>(&mut self, size: size_t) -> &mut Self {
assert!(
self.arg_index < self.num_args,
"ExecuteKernel::set_arg_local_buffer too many args"
);
self.kernel
.set_arg_local_buffer(self.arg_index, size)
.unwrap();
self.arg_index += 1;
self
}

kenba commented

Agreed, generic type parameter removed on develop branch.

Great, thanks!