File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,10 +106,8 @@ jobs:
106106 run : cargo build --all-features -p cust_raw
107107
108108 # Exclude crates that require cuDNN, not available on Windows CI: cudnn, cudnn-sys.
109- # Exclude vecadd because of a link error involving nanorand and `SystemFunction036` (a.k.a.
110- # `RtlGenRandom`).
111109 - name : Build workspace
112- run : cargo build --workspace --exclude cudnn --exclude cudnn-sys --exclude "vecadd*"
110+ run : cargo build --workspace --exclude cudnn --exclude cudnn-sys
113111
114112 # Exclude crates that require cuDNN, not available on Windows CI: cudnn, cudnn-sys.
115113 - name : Clippy
Original file line number Diff line number Diff line change @@ -418,6 +418,12 @@ impl Module {
418418 }
419419 }
420420
421+ // Get the inner `CUmodule` from the `Module`. If you use this handle elsewhere,
422+ // make sure not to use it after the module has been dropped. Or ManuallyDrop the struct to be safe.
423+ pub fn as_inner ( & self ) -> driver_sys:: CUmodule {
424+ self . inner
425+ }
426+
421427 /// Destroy a `Module`, returning an error.
422428 ///
423429 /// Destroying a module can return errors from previous asynchronous work. This function
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ use std::path;
44use cuda_builder:: CudaBuilder ;
55
66fn main ( ) {
7+ // On Windows, nanorand's entropy uses SystemFunction036 (RtlGenRandom) from advapi32.
8+ // Explicitly link it so the MSVC linker resolves the symbol (avoids LNK2019 when
9+ // mixing CRTs or with certain link orders).
10+ #[ cfg( target_os = "windows" ) ]
11+ println ! ( "cargo:rustc-link-lib=advapi32" ) ;
12+
713 println ! ( "cargo::rerun-if-changed=build.rs" ) ;
814 println ! ( "cargo::rerun-if-changed=kernels" ) ;
915
You can’t perform that action at this time.
0 commit comments