#![cfg_attr(
target_os = "cuda",
no_std,
feature(
register_attr,
alloc_error_handler,
asm,
asm_experimental_arch,
link_llvm_intrinsics
),
register_attr(nvvm_internal)
)]
extern crate alloc;
pub mod float;
#[allow(warnings)]
pub mod intrinsics;
pub mod io;
pub mod mem;
pub mod misc;
pub mod atomic;
pub mod cfg;
pub mod ptr;
pub mod shared;
pub mod thread;
pub mod warp;
mod float_ext;
pub use cuda_std_macros::*;
pub use float::GpuFloat;
pub use float_ext::*;
pub use half;
pub use vek;
pub use half::{bf16, f16};
pub mod prelude {
pub use crate::f16;
pub use crate::kernel;
pub use crate::thread;
pub use crate::{assert_eq, assert_ne, print, println};
pub use alloc::{
borrow::ToOwned,
boxed::Box,
format,
rc::Rc,
string::{String, ToString},
vec::Vec,
};
}
#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64"))]
#[alloc_error_handler]
fn alloc_handler(layout: core::alloc::Layout) -> ! {
core::panic!("Memory allocation of {} bytes failed", layout.size());
}
#[cfg(any(target_arch = "nvptx", target_arch = "nvptx64"))]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
extern "C" {
fn __nvvm_trap() -> !;
}
unsafe { __nvvm_trap() };
}