nvptx-std

Crates.ionvptx-std
lib.rsnvptx-std
version0.1.0
sourcesrc
created_at2024-10-12 08:47:33.225926
updated_at2024-10-12 08:47:33.225926
descriptionstdlib for nvptx64-nvidia-cuda
homepagehttps://github.com/Gui-Yom/turbo-metrics
repositoryhttps://github.com/Gui-Yom/turbo-metrics
max_upload_size
id1406359
size9,723
(Gui-Yom)

documentation

README

nvptx-core

Core functionality for developing cuda kernels in rust. This crate only contains device code and should only be compiled with the nvptx64-nvidia-cuda target.

Math std

Some math functions are defined in libstd rather than core (mul_add, cbrt, ...). This crate defines the extension trait StdMathExt that mimic those functions. The goal is to be able to import code without changing much.

Linking libdevice

The llvm bitcode linker can't link bitcode files in rlib so we cannot link to libdevice in this library directly. You need to add the following build script to your kernel crate.

use std::env;

fn main() {
    let cuda_path =
        env::var("CUDA_PATH").expect("CUDA_PATH must be set to the path of your CUDA installation");
    println!("cargo:rerun-if-env-changed=CUDA_PATH");
    println!("cargo:rustc-link-arg={cuda_path}/nvvm/libdevice/libdevice.10.bc");
}
Commit count: 75

cargo fmt