Crates.io | ptx-builder |
lib.rs | ptx-builder |
version | 0.5.3 |
source | src |
created_at | 2018-02-08 15:35:16.459659 |
updated_at | 2019-02-13 08:26:53.400361 |
description | NVPTX build helper |
homepage | |
repository | https://github.com/denzp/rust-ptx-builder |
max_upload_size | |
id | 50189 |
size | 45,531 |
This allows us to use single-source CUDA in binary-only crates (ones without lib.rs
).
The crate does not provide a default panic_handler
anymore.
From now on, it either up to a user, or other crates (e.g. coming soon ptx-support
crate).
Next workaround should work in common cases, although it doesn't provide any panic details in runtime:
#![feature(core_intrinsics)]
#[panic_handler]
unsafe fn breakpoint_panic_handler(_: &::core::panic::PanicInfo) -> ! {
core::intrinsics::breakpoint();
core::hint::unreachable_unchecked();
}
build.rs
script was never so compact and clear before:
use ptx_builder::error::Result;
use ptx_builder::prelude::*;
fn main() -> Result<()> {
let builder = Builder::new(".")?;
CargoAdapter::with_env_var("KERNEL_PTX_PATH").build(builder);
}
This release comes with a significant documentation improvement! Check it out :)
The library should facilitate CUDA development with Rust. It can be used in a cargo build script of a host crate, and take responsibility for building device crates.
[PTX] Unable to get target details
[PTX]
[PTX] caused by:
[PTX] Command not found in PATH: 'rust-ptx-linker'. You can install it with: 'cargo install ptx-linker'.
The library depends on a fresh Nightly and ptx-linker. The latter can be installed from crates.io:
cargo install ptx-linker
Unfortunately, due to rustc-llvm-proxy#1 MSVS targets are not supported yet.
You might face similar errors:
Unable to find symbol 'LLVMContextCreate' in the LLVM shared lib
For now the only solution is to use GNU targets.
First, you need to specify a build script in host crate's Cargo.toml
and declare the library as a build-dependency:
[build-dependencies]
ptx-builder = "0.5"
Then, typical build.rs
might look like:
use ptx_builder::error::Result;
use ptx_builder::prelude::*;
fn main() -> Result<()> {
let builder = Builder::new(".")?;
CargoAdapter::with_env_var("KERNEL_PTX_PATH").build(builder);
}