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

Putting deprecation notices behind conditional attributes #48

Closed
vmx opened this issue Apr 28, 2022 · 2 comments
Closed

Putting deprecation notices behind conditional attributes #48

vmx opened this issue Apr 28, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@vmx
Copy link
Contributor

vmx commented Apr 28, 2022

I'm compiling with only the CL_VERSION_1_2 feature set. When I use CommandQueue::create() I get a deprecation warning like this:

warning: use of deprecated associated function `opencl3::command_queue::CommandQueue::create`: From CL_VERSION_2_0 use create_command_queue_with_properties

This doesn't really apply, as I'm not using OpenCL 2.0.

I suggest enabling this warning only if CL_VERSION_2_0 or above is set via cfg_attr. In this case it would like like this:

    #[cfg_attr(any(feature = "CL_VERSION_2_0", feature = "CL_VERSION_2_1", feature = "CL_VERSION_2_2", feature = "CL_VERSION_3_0"), deprecated(
        since = "0.1.0",
        note = "From CL_VERSION_2_0 use create_command_queue_with_properties"
    ))]
@kenba kenba self-assigned this Apr 28, 2022
@kenba kenba added the enhancement New feature or request label Apr 28, 2022
@kenba
Copy link
Owner

kenba commented Apr 28, 2022

Thanks Volker, that's a great way of tying the deprecated notices to the correct OpenCL versions!

I've changed all the deprecated methods in this crate. I'll now go back to cl3 and opencl-sys and fix the deprecated functions in those crates.

@kenba
Copy link
Owner

kenba commented May 2, 2022

Changes pushed to crates.io.

@kenba kenba closed this as completed May 2, 2022
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

No branches or pull requests

2 participants