[−][src]Struct ptx_builder::reporter::CargoAdapter
Cargo integration adapter.
Provides PTX assembly path to Rust through specified environment variable name and informs Cargo about device crate dependencies, so it can rebuild on changes.
Usage in build.rs
use ptx_builder::error::Result; use ptx_builder::prelude::*; fn main() -> Result<()> { CargoAdapter::with_env_var("PTX_PATH").build(Builder::new(".")?); }
Methods
impl CargoAdapter
[src]
pub fn with_env_var<S: AsRef<str>>(env_name: S) -> Self
[src]
Creates an instance of the adapter that will provide PTX assembly path
to Rust via env_name
environment variable.
The PTX assembly can later be used in host crate:
ⓘThis example is not tested
use std::ffi::CString; let ptx = CString::new(include_str!(env!("PTX_PATH")))?;
pub fn build(&self, builder: Builder) -> !
[src]
Runs build process and reports artifacts to Cargo.
Depends on whether the build was successful or not, will either
call exit(0)
or exit(1)
and print error log to stderr
.
Auto Trait Implementations
impl Send for CargoAdapter
impl Sync for CargoAdapter
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,