Runs rustc to build the codegen and codegens the gpu crate, returning the path of the final ptx file. If [`ptx_file_copy_path`](Self::ptx_file_copy_path) is set, this returns the copied path.
(self)
| 297 | /// Runs rustc to build the codegen and codegens the gpu crate, returning the path of the final |
| 298 | /// ptx file. If [`ptx_file_copy_path`](Self::ptx_file_copy_path) is set, this returns the copied path. |
| 299 | pub fn build(self) -> Result<PathBuf, CudaBuilderError> { |
| 300 | println!("cargo:rerun-if-changed={}", self.path_to_crate.display()); |
| 301 | let path = invoke_rustc(&self)?; |
| 302 | if let Some(copy_path) = self.ptx_file_copy_path { |
| 303 | std::fs::copy(path, ©_path).map_err(CudaBuilderError::FailedToCopyPtxFile)?; |
| 304 | Ok(copy_path) |
| 305 | } else { |
| 306 | Ok(path) |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | // https://github.com/rust-lang/cargo/blob/1857880b5124580c4aeb4e8bc5f1198f491d61b1/src/cargo/util/paths.rs#L29-L52 |
nothing calls this directly
no test coverage detected