@@ -5,8 +5,9 @@ use cubecl_core::{
55 CubeCount , ExecutionMode , MemoryUsage ,
66 future:: DynFut ,
77 server:: {
8- Allocation , AllocationDescriptor , Binding , Bindings , ComputeServer , CopyDescriptor , Handle ,
9- IoError , LaunchError , ProfileError , ProfilingToken , ServerCommunication , ServerUtilities ,
8+ Allocation , AllocationDescriptor , Binding , Bindings , ComputeServer , CopyDescriptor ,
9+ ExecutionError , Handle , IoError , LaunchError , ProfileError , ProfilingToken ,
10+ ServerCommunication , ServerUtilities ,
1011 } ,
1112} ;
1213use cubecl_runtime:: {
@@ -202,13 +203,15 @@ impl ComputeServer for CpuServer {
202203
203204 fn flush ( & mut self , _stream_id : StreamId ) { }
204205
205- fn sync ( & mut self , _stream_id : StreamId ) -> DynFut < ( ) > {
206+ fn sync ( & mut self , _stream_id : StreamId ) -> DynFut < Result < ( ) , ExecutionError > > {
206207 self . utilities . logger . profile_summary ( ) ;
207- Box :: pin ( async move { } )
208+ Box :: pin ( async move { Ok ( ( ) ) } )
208209 }
209210
210211 fn start_profile ( & mut self , stream_id : StreamId ) -> ProfilingToken {
211- cubecl_common:: future:: block_on ( self . sync ( stream_id) ) ;
212+ if let Err ( err) = cubecl_common:: future:: block_on ( self . sync ( stream_id) ) {
213+ self . ctx . timestamps . error ( err. into ( ) ) ;
214+ } ;
212215 self . ctx . timestamps . start ( )
213216 }
214217
@@ -218,7 +221,11 @@ impl ComputeServer for CpuServer {
218221 token : ProfilingToken ,
219222 ) -> Result < ProfileDuration , ProfileError > {
220223 self . utilities . logger . profile_summary ( ) ;
221- cubecl_common:: future:: block_on ( self . sync ( stream_id) ) ;
224+
225+ if let Err ( err) = cubecl_common:: future:: block_on ( self . sync ( stream_id) ) {
226+ self . ctx . timestamps . error ( err. into ( ) ) ;
227+ }
228+
222229 self . ctx . timestamps . stop ( token)
223230 }
224231
0 commit comments