Skip to content

Commit 916653a

Browse files
Fix/no std runtime (#1100)
1 parent 4455569 commit 916653a

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

crates/cubecl-cpu/Cargo.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,19 @@ mlir-dump = []
2323

2424

2525
[dependencies]
26-
cubecl-common = { path = "../cubecl-common", version = "=0.9.0-pre.5", default-features = false }
27-
cubecl-core = { path = "../cubecl-core", version = "=0.9.0-pre.5", default-features = false }
28-
cubecl-opt = { path = "../cubecl-opt", version = "=0.9.0-pre.5", default-features = false }
26+
cubecl-common = { path = "../cubecl-common", version = "=0.9.0-pre.5", default-features = false, features = [
27+
"std",
28+
] }
29+
cubecl-core = { path = "../cubecl-core", version = "=0.9.0-pre.5", default-features = false, features = [
30+
"std",
31+
] }
32+
cubecl-opt = { path = "../cubecl-opt", version = "=0.9.0-pre.5", default-features = false, features = [
33+
"std",
34+
] }
2935
cubecl-runtime = { path = "../cubecl-runtime", version = "=0.9.0-pre.5", default-features = false, features = [
3036
"channel-mutex",
37+
"std",
38+
"storage-bytes",
3139
] }
3240
cubecl-std = { path = "../cubecl-std", version = "=0.9.0-pre.5", default-features = false }
3341

crates/cubecl-cpu/src/compute/server.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,21 @@ impl ComputeServer for CpuServer {
270270
}
271271

272272
fn flush(&mut self, stream_id: StreamId) {
273+
self.scheduler.execute_streams(vec![stream_id]);
273274
let stream = self.scheduler.stream(&stream_id);
274275
stream.flush();
275276
}
276277

277278
fn sync(&mut self, stream_id: StreamId) -> DynFut<Result<(), ExecutionError>> {
278-
self.utilities.logger.profile_summary();
279+
self.scheduler.execute_streams(vec![stream_id]);
279280
let stream = self.scheduler.stream(&stream_id);
280281
stream.flush();
281282

282283
Box::pin(async move { Ok(()) })
283284
}
284285

285286
fn start_profile(&mut self, stream_id: StreamId) -> ProfilingToken {
287+
self.scheduler.execute_streams(vec![stream_id]);
286288
let stream = self.scheduler.stream(&stream_id);
287289
stream.start_profile()
288290
}
@@ -292,7 +294,7 @@ impl ComputeServer for CpuServer {
292294
stream_id: StreamId,
293295
token: ProfilingToken,
294296
) -> Result<ProfileDuration, ProfileError> {
295-
self.utilities.logger.profile_summary();
297+
self.scheduler.execute_streams(vec![stream_id]);
296298
let stream = self.scheduler.stream(&stream_id);
297299
stream.end_profile(token)
298300
}

crates/cubecl-runtime/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub mod id;
1515
pub mod kernel;
1616

1717
/// Stream related utilities.
18-
#[cfg(feature = "std")]
1918
pub mod stream;
2019

2120
/// Compute client module.

crates/cubecl-runtime/src/stream/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use alloc::vec::Vec;
12
use cubecl_common::stream_id::StreamId;
23

34
/// Trait for creating streams, used by the stream pool to generate streams as needed.

crates/cubecl-runtime/src/stream/scheduler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::{
44
server::Binding,
55
stream::{StreamFactory, StreamPool},
66
};
7-
use alloc::sync::Arc;
7+
use alloc::{format, sync::Arc, vec, vec::Vec};
88
use cubecl_common::stream_id::StreamId;
99

1010
/// Defines a trait for a scheduler stream backend, specifying the types and behavior for task scheduling.

0 commit comments

Comments
 (0)