Find the libdevice bitcode library which contains math intrinsics and is linked when building the nvvm program.
()
| 139 | /// Find the libdevice bitcode library which contains math intrinsics and is |
| 140 | /// linked when building the nvvm program. |
| 141 | pub 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 | |
| 155 | unsafe fn cleanup_dicompileunit(module: &Module) { |
| 156 | let mut cu1 = ptr::null_mut(); |
no test coverage detected