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

Change the API to use String instead of ffi::CString #10

Closed
kenba opened this issue Mar 21, 2021 · 2 comments · Fixed by #11
Closed

Change the API to use String instead of ffi::CString #10

kenba opened this issue Mar 21, 2021 · 2 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request

Comments

@kenba
Copy link
Owner

kenba commented Mar 21, 2021

It is easier for users to handle standard Rust Strings than Rust ffi::CStrings.
Therefore, the API should use standard Rust Strings or strs instead of ffi::CStrings or ffi::CStr wherever possible.

Note: this change depends on c3 issue #4.

@kenba kenba added the enhancement New feature or request label Mar 21, 2021
@kenba kenba self-assigned this Mar 21, 2021
kenba added a commit that referenced this issue Mar 21, 2021
The first stage in migrating the API from CString to String.
@kenba kenba linked a pull request Mar 21, 2021 that will close this issue
@kenba kenba closed this as completed in #11 Mar 26, 2021
kenba added a commit that referenced this issue Mar 26, 2021
Replace calls to to_str with to_string for issue #10
@kenba
Copy link
Owner Author

kenba commented Mar 28, 2021

Re-open to change API to replace use of CStr with str and CString with String wherever possible.

@kenba kenba reopened this Mar 28, 2021
@kenba
Copy link
Owner Author

kenba commented Mar 28, 2021

Now uses new cl3 0.2.0 API.
All functions now accept str with the exception of Program::compile which takes: header_include_names: &[&CStr].

@kenba kenba closed this as completed Mar 28, 2021
kenba added a commit that referenced this issue Mar 28, 2021
By storing a `intptr_t` in `Platform` and `Device` instead of `cl_platform_id` and `cl_device_id`, the structs can derive the Copy, Clone and Debug traits and implement the Send and Sync traits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant