Skip to content

Commit a2a55f8

Browse files
Fix profiling deadlock (#963)
* Fix profiling deadlock * Remove print
1 parent 011f553 commit a2a55f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/cubecl-runtime/src/client.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,10 @@ where
369369
stream_id: StreamId,
370370
) {
371371
let level = self.utilities.logger.profile_level();
372-
let mut state = self.context.lock();
373372

374373
match level {
375374
None | Some(ProfileLevel::ExecutionOnly) => {
375+
let mut state = self.context.lock();
376376
let name = kernel.name();
377377

378378
unsafe { state.execute(kernel, count, bindings, mode, stream_id) };
@@ -388,6 +388,7 @@ where
388388
let profile = self
389389
.profile(
390390
|| unsafe {
391+
let mut state = self.context.lock();
391392
state.execute(kernel, count.clone(), bindings, mode, stream_id)
392393
},
393394
name,

0 commit comments

Comments
 (0)