Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superfluous/Misleading generic parameter in ExecuteKernel::set_arg_local_buffer #35

Closed
KarelPeeters opened this issue Sep 12, 2021 · 2 comments

Comments

@KarelPeeters
Copy link

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
Copy link
Owner

kenba commented Sep 13, 2021

Agreed, generic type parameter removed on develop branch.

@KarelPeeters
Copy link
Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants