Expand description
Proc macros for CUDA conditional compilation.
These macros simplify gating code based on CUDA availability.
§Usage
ⓘ
use vortex_cuda_macros::{cuda_available, cuda_not_available, cuda_test};
// Only compiled when CUDA is available
#[cuda_available]
fn cuda_only_function() { /* ... */ }
// Only compiled when CUDA is NOT available
#[cuda_not_available]
fn fallback_function() { /* ... */ }
// Ignore tests when CUDA is not available
#[crate::test]
async fn my_test() {
...
}Attribute Macros§
- cuda_
available - Conditionally compiles the annotated item only when CUDA is available.
- cuda_
not_ available - Conditionally compiles the annotated item only when CUDA is not available.
- test
- Test attribute to ignore tests if CUDA isn’t available. Supports both sync and async tests (using tokio).