Skip to main content

Crate vortex_cuda_macros

Crate vortex_cuda_macros 

Source
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).