Skip to content

Commit 5749b6a

Browse files
committed
fix: 兼容天数
Signed-off-by: YdrMaster <[email protected]>
1 parent ed28f2d commit 5749b6a

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ infini-op = { git = "https://github.com/InfiniTensor/infini-toolkit", rev = "e83
1212
infini-ccl = { git = "https://github.com/InfiniTensor/infini-toolkit", rev = "e8362c3" }
1313
search-infini-tools = { git = "https://github.com/InfiniTensor/infini-toolkit", rev = "e8362c3" }
1414

15-
cuda = { git = "https://github.com/YdrMaster/cuda-driver", rev = "077b425" }
16-
cublas = { git = "https://github.com/YdrMaster/cuda-driver", rev = "077b425" }
17-
nccl = { git = "https://github.com/YdrMaster/cuda-driver", rev = "077b425" }
18-
search-cuda-tools = { git = "https://github.com/YdrMaster/cuda-driver", rev = "077b425" }
19-
search-corex-tools = { git = "https://github.com/YdrMaster/cuda-driver", rev = "077b425" }
15+
cuda = { git = "https://github.com/YdrMaster/cuda-driver", rev = "9eb3b45" }
16+
cublas = { git = "https://github.com/YdrMaster/cuda-driver", rev = "9eb3b45" }
17+
nccl = { git = "https://github.com/YdrMaster/cuda-driver", rev = "9eb3b45" }
18+
search-cuda-tools = { git = "https://github.com/YdrMaster/cuda-driver", rev = "9eb3b45" }
19+
search-corex-tools = { git = "https://github.com/YdrMaster/cuda-driver", rev = "9eb3b45" }

operators/build.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ fn main() {
2626
{
2727
infini.define()
2828
}
29-
let use_nvidia = cfg!(feature = "nvidia-gpu") && find_cuda_root().is_some();
29+
30+
// iluvatar
3031
let use_iluvatar = cfg!(feature = "iluvatar-gpu") && find_corex().is_some();
32+
if use_iluvatar {
33+
iluvatar.define();
34+
cuda.define();
35+
return;
36+
}
37+
38+
let use_nvidia = cfg!(feature = "nvidia-gpu") && find_cuda_root().is_some();
3139
if use_nvidia {
3240
nvidia.define();
3341
if find_nccl_root().is_some() {
3442
nccl.define()
3543
}
36-
}
37-
if use_iluvatar {
38-
iluvatar.define()
39-
}
40-
if use_nvidia || use_iluvatar {
41-
cuda.define()
44+
cuda.define();
4245
}
4346
}

operators/src/handle/cuda/alloc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ impl<'ctx> Alloc<DevMem<'ctx>> for &'ctx CurrentCtx {
9999
fn free(&self, _mem: DevMem<'ctx>) {}
100100
}
101101

102-
#[cfg(use_nvidia)]
103102
impl<'ctx> Alloc<DevMem<'ctx>> for Stream<'ctx> {
104103
#[inline]
105104
fn alloc(&self, size: usize) -> DevMem<'ctx> {
@@ -112,7 +111,6 @@ impl<'ctx> Alloc<DevMem<'ctx>> for Stream<'ctx> {
112111
}
113112
}
114113

115-
#[cfg(use_nvidia)]
116114
impl<'ctx> QueueAlloc for Stream<'ctx> {
117115
type Hardware = Gpu;
118116
type DevMem = DevMem<'ctx>;

0 commit comments

Comments
 (0)