MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / find_libdevice

Function find_libdevice

crates/rustc_codegen_nvvm/src/nvvm.rs:141–153  ·  view source on GitHub ↗

Find the libdevice bitcode library which contains math intrinsics and is linked when building the nvvm program.

()

Source from the content-addressed store, hash-verified

139/// Find the libdevice bitcode library which contains math intrinsics and is
140/// linked when building the nvvm program.
141pub fn find_libdevice() -> Option<Vec<u8>> {
142 if let Some(base_path) = find_cuda_root() {
143 let libdevice_file = fs::read_dir(Path::new(&base_path).join("nvvm").join("libdevice"))
144 .ok()?
145 .filter_map(Result::ok)
146 .find(|f| f.path().extension() == Some(OsStr::new("bc")))?
147 .path();
148
149 fs::read(libdevice_file).ok()
150 } else {
151 None
152 }
153}
154
155unsafe fn cleanup_dicompileunit(module: &Module) {
156 let mut cu1 = ptr::null_mut();

Callers 1

codegen_bitcode_modulesFunction · 0.85

Calls 2

find_cuda_rootFunction · 0.85
newFunction · 0.85

Tested by

no test coverage detected