Skip to content

Commit d30dee1

Browse files
authored
#474 Block cuCtxCreate_v4() (#476)
1 parent 8f2d1d1 commit d30dee1

3 files changed

Lines changed: 10 additions & 75 deletions

File tree

bindings_generator/src/main.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ fn create_modules() -> Vec<ModuleConfig> {
5858
functions: vec![
5959
"^cuCheckpoint.*",
6060
"cuDeviceGetNvSciSyncAttributes",
61+
// NOTE: see https://github.com/coreylowman/cudarc/issues/474
62+
"cuCtxCreate_v4",
6163
],
6264
vars: vec![],
6365
},
@@ -108,10 +110,7 @@ fn create_modules() -> Vec<ModuleConfig> {
108110
allowlist_recursively: true,
109111
blocklist: Filters {
110112
types: vec![],
111-
functions: vec![
112-
"curandGenerateBinomial",
113-
"curandGenerateBinomialMethod",
114-
],
113+
functions: vec!["curandGenerateBinomial", "curandGenerateBinomialMethod"],
115114
vars: vec![],
116115
},
117116
libs: vec!["curand"],
@@ -238,10 +237,7 @@ fn create_modules() -> Vec<ModuleConfig> {
238237
allowlist_recursively: true,
239238
blocklist: Filters {
240239
types: vec!["^cusolverMg.*"],
241-
functions: vec![
242-
"^cusolverMg.*",
243-
"^cusolverDnLogger.*",
244-
],
240+
functions: vec!["^cusolverMg.*", "^cusolverDnLogger.*"],
245241
vars: vec!["^cusolverMg.*"],
246242
},
247243
libs: vec!["cusolver"],
@@ -285,7 +281,7 @@ fn create_modules() -> Vec<ModuleConfig> {
285281
vars: vec!["^nvtx.*"],
286282
},
287283
allowlist_recursively: true,
288-
blocklist: Filters {
284+
blocklist: Filters {
289285
types: vec![],
290286
functions: vec!["nvtxInitialize"],
291287
vars: vec![],
@@ -341,10 +337,7 @@ fn create_modules() -> Vec<ModuleConfig> {
341337
},
342338
libs: vec!["cupti"],
343339
clang_args: vec![],
344-
raw_lines: vec![
345-
"use crate::driver::sys::*;",
346-
"use crate::runtime::sys::*;",
347-
],
340+
raw_lines: vec!["use crate::driver::sys::*;", "use crate::runtime::sys::*;"],
348341
},
349342
]
350343
}
@@ -530,7 +523,7 @@ fn create_bindings(modules: &[ModuleConfig], cuda_versions: &[&str]) -> Result<(
530523
} else {
531524
vec!["cuda_nvcc"]
532525
};
533-
526+
534527
let archive_pb = multi_progress.add(ProgressBar::new(names.len() as u64));
535528
archive_pb.set_style(
536529
ProgressStyle::default_bar().template("{msg} {wide_bar} {pos}/{len} ({eta})")?,

bindings_generator/src/merge.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ impl BindingMerger {
193193
.or_default()
194194
.insert(version, func.clone());
195195
}
196-
other => println!("WARNING: Unhandled foreign item {other:?} in {path:?}... SKIPPING"),
196+
other => println!(
197+
"WARNING: Unhandled foreign item {other:?} in {path:?}... SKIPPING"
198+
),
197199
}
198200
}
199201
}

src/driver/sys/mod.rs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8572,19 +8572,6 @@ extern "C" {
85728572
flags: ::core::ffi::c_uint,
85738573
dev: CUdevice,
85748574
) -> CUresult;
8575-
#[cfg(any(
8576-
feature = "cuda-12050",
8577-
feature = "cuda-12060",
8578-
feature = "cuda-12080",
8579-
feature = "cuda-12090",
8580-
feature = "cuda-13000"
8581-
))]
8582-
pub fn cuCtxCreate_v4(
8583-
pctx: *mut CUcontext,
8584-
ctxCreateParams: *mut CUctxCreateParams,
8585-
flags: ::core::ffi::c_uint,
8586-
dev: CUdevice,
8587-
) -> CUresult;
85888575
pub fn cuCtxDestroy_v2(ctx: CUcontext) -> CUresult;
85898576
pub fn cuCtxDetach(ctx: CUcontext) -> CUresult;
85908577
pub fn cuCtxDisablePeerAccess(peerContext: CUcontext) -> CUresult;
@@ -11920,21 +11907,6 @@ mod loaded {
1192011907
) -> CUresult {
1192111908
(culib().cuCtxCreate_v3)(pctx, paramsArray, numParams, flags, dev)
1192211909
}
11923-
#[cfg(any(
11924-
feature = "cuda-12050",
11925-
feature = "cuda-12060",
11926-
feature = "cuda-12080",
11927-
feature = "cuda-12090",
11928-
feature = "cuda-13000"
11929-
))]
11930-
pub unsafe fn cuCtxCreate_v4(
11931-
pctx: *mut CUcontext,
11932-
ctxCreateParams: *mut CUctxCreateParams,
11933-
flags: ::core::ffi::c_uint,
11934-
dev: CUdevice,
11935-
) -> CUresult {
11936-
(culib().cuCtxCreate_v4)(pctx, ctxCreateParams, flags, dev)
11937-
}
1193811910
pub unsafe fn cuCtxDestroy_v2(ctx: CUcontext) -> CUresult {
1193911911
(culib().cuCtxDestroy_v2)(ctx)
1194011912
}
@@ -16550,19 +16522,6 @@ mod loaded {
1655016522
flags: ::core::ffi::c_uint,
1655116523
dev: CUdevice,
1655216524
) -> CUresult,
16553-
#[cfg(any(
16554-
feature = "cuda-12050",
16555-
feature = "cuda-12060",
16556-
feature = "cuda-12080",
16557-
feature = "cuda-12090",
16558-
feature = "cuda-13000"
16559-
))]
16560-
pub cuCtxCreate_v4: unsafe extern "C" fn(
16561-
pctx: *mut CUcontext,
16562-
ctxCreateParams: *mut CUctxCreateParams,
16563-
flags: ::core::ffi::c_uint,
16564-
dev: CUdevice,
16565-
) -> CUresult,
1656616525
pub cuCtxDestroy_v2: unsafe extern "C" fn(ctx: CUcontext) -> CUresult,
1656716526
pub cuCtxDetach: unsafe extern "C" fn(ctx: CUcontext) -> CUresult,
1656816527
pub cuCtxDisablePeerAccess: unsafe extern "C" fn(peerContext: CUcontext) -> CUresult,
@@ -20001,17 +19960,6 @@ mod loaded {
2000119960
.get(b"cuCtxCreate_v3\0")
2000219961
.map(|sym| *sym)
2000319962
.expect("Expected symbol in library");
20004-
#[cfg(any(
20005-
feature = "cuda-12050",
20006-
feature = "cuda-12060",
20007-
feature = "cuda-12080",
20008-
feature = "cuda-12090",
20009-
feature = "cuda-13000"
20010-
))]
20011-
let cuCtxCreate_v4 = __library
20012-
.get(b"cuCtxCreate_v4\0")
20013-
.map(|sym| *sym)
20014-
.expect("Expected symbol in library");
2001519963
let cuCtxDestroy_v2 = __library
2001619964
.get(b"cuCtxDestroy_v2\0")
2001719965
.map(|sym| *sym)
@@ -23218,14 +23166,6 @@ mod loaded {
2321823166
feature = "cuda-12090"
2321923167
))]
2322023168
cuCtxCreate_v3,
23221-
#[cfg(any(
23222-
feature = "cuda-12050",
23223-
feature = "cuda-12060",
23224-
feature = "cuda-12080",
23225-
feature = "cuda-12090",
23226-
feature = "cuda-13000"
23227-
))]
23228-
cuCtxCreate_v4,
2322923169
cuCtxDestroy_v2,
2323023170
cuCtxDetach,
2323123171
cuCtxDisablePeerAccess,

0 commit comments

Comments
 (0)