How to use cfg_if

        #[cfg(feature = "gpu")]

in my cargo.toml

gpu = []

i truly added gpu but the expression seems not work.

What do you mean with "seems not work"? Does it not compile? Is it ignored?

Did you add the feature to the cargo command line, as said in cargo documentation?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.