@@ -156,7 +156,7 @@ impl<
156
156
type AsyncHostType < ' stream , ' b > = crate :: utils:: r#async:: AsyncProj <
157
157
' b ,
158
158
' stream ,
159
- & ' b crate :: host:: HostAndDeviceConstRef < ' b , T > ,
159
+ crate :: host:: HostAndDeviceConstRef < ' b , T > ,
160
160
> where Self : ' b ;
161
161
#[ cfg( any( feature = "device" , doc) ) ]
162
162
type DeviceType < ' b > = & ' b T where Self : ' b ;
@@ -173,8 +173,9 @@ impl<
173
173
where
174
174
Self : ' b ,
175
175
{
176
+ let _ = stream;
176
177
crate :: host:: HostAndDeviceConstRef :: with_new ( param, |const_ref| {
177
- inner. with ( const_ref . as_async ( stream ) . as_ref ( ) )
178
+ inner. with ( unsafe { crate :: utils :: r#async :: AsyncProj :: new ( const_ref , None ) } )
178
179
} )
179
180
}
180
181
@@ -257,9 +258,10 @@ impl<
257
258
where
258
259
Self : ' b ,
259
260
{
261
+ let _ = stream;
260
262
// FIXME: forward impl
261
263
crate :: host:: HostAndDeviceConstRef :: with_new ( param, |const_ref| {
262
- inner. with ( const_ref . as_async ( stream ) . as_ref ( ) )
264
+ inner. with ( unsafe { crate :: utils :: r#async :: AsyncProj :: new ( const_ref , None ) } )
263
265
} )
264
266
}
265
267
@@ -272,7 +274,8 @@ impl<
272
274
where
273
275
Self : ' b ,
274
276
{
275
- let param = unsafe { param. unwrap_ref_unchecked ( ) } ;
277
+ let param_ref = param. proj_ref ( ) ;
278
+ let param = unsafe { param_ref. unwrap_ref_unchecked ( ) } ;
276
279
inner ( Some ( & param_as_raw_bytes ( param. for_host ( ) ) ) )
277
280
}
278
281
@@ -360,7 +363,7 @@ impl<
360
363
type AsyncHostType < ' stream , ' b > = crate :: utils:: r#async:: AsyncProj <
361
364
' b ,
362
365
' stream ,
363
- & ' b crate :: host:: HostAndDeviceConstRef < ' b , T >
366
+ crate :: host:: HostAndDeviceConstRef < ' b , T >
364
367
> where Self : ' b ;
365
368
#[ cfg( any( feature = "device" , doc) ) ]
366
369
type DeviceType < ' b > = & ' b T where Self : ' b ;
@@ -379,8 +382,9 @@ impl<
379
382
where
380
383
Self : ' b ,
381
384
{
382
- crate :: host:: HostAndDeviceMutRef :: with_new ( param, |const_ref| {
383
- inner. with ( const_ref. as_ref ( ) . as_async ( stream) . as_ref ( ) )
385
+ let _ = stream;
386
+ crate :: host:: HostAndDeviceMutRef :: with_new ( param, |mut_ref| {
387
+ inner. with ( unsafe { crate :: utils:: r#async:: AsyncProj :: new ( mut_ref. as_ref ( ) , None ) } )
384
388
} )
385
389
}
386
390
@@ -580,7 +584,7 @@ impl<'a, T: Sync + RustToCuda> CudaKernelParameter for &'a DeepPerThreadBorrow<T
580
584
type AsyncHostType < ' stream , ' b > = crate :: utils:: r#async:: AsyncProj <
581
585
' b ,
582
586
' stream ,
583
- & ' b crate :: host:: HostAndDeviceConstRef <
587
+ crate :: host:: HostAndDeviceConstRef <
584
588
' b ,
585
589
DeviceAccessible < <T as RustToCuda >:: CudaRepresentation > ,
586
590
> ,
@@ -601,8 +605,9 @@ impl<'a, T: Sync + RustToCuda> CudaKernelParameter for &'a DeepPerThreadBorrow<T
601
605
where
602
606
Self : ' b ,
603
607
{
608
+ let _ = stream;
604
609
crate :: lend:: LendToCuda :: lend_to_cuda ( param, |param| {
605
- inner. with ( param . as_async ( stream ) . as_ref ( ) )
610
+ inner. with ( unsafe { crate :: utils :: r#async :: AsyncProj :: new ( param , None ) } )
606
611
} )
607
612
}
608
613
@@ -663,7 +668,7 @@ impl<'a, T: Sync + RustToCuda + SafeMutableAliasing> CudaKernelParameter
663
668
type AsyncHostType < ' stream , ' b > = crate :: utils:: r#async:: AsyncProj <
664
669
' b ,
665
670
' stream ,
666
- & ' b mut crate :: host:: HostAndDeviceMutRef <
671
+ crate :: host:: HostAndDeviceMutRef <
667
672
' b ,
668
673
DeviceAccessible < <T as RustToCuda >:: CudaRepresentation > ,
669
674
> ,
@@ -690,7 +695,7 @@ impl<'a, T: Sync + RustToCuda + SafeMutableAliasing> CudaKernelParameter
690
695
inner. with ( {
691
696
// Safety: this projection cannot be moved to a different stream
692
697
// without first exiting lend_to_cuda_mut and synchronizing
693
- unsafe { crate :: utils:: r#async:: AsyncProj :: new ( & mut param. into_mut ( ) , None ) }
698
+ unsafe { crate :: utils:: r#async:: AsyncProj :: new ( param. into_mut ( ) , None ) }
694
699
} )
695
700
} )
696
701
}
@@ -727,7 +732,7 @@ impl<'a, T: Sync + RustToCuda + SafeMutableAliasing> CudaKernelParameter
727
732
Self : ' b ,
728
733
{
729
734
param. record_mut_use ( ) ?;
730
- let param = unsafe { param. unwrap_unchecked ( ) } ;
735
+ let mut param = unsafe { param. unwrap_unchecked ( ) } ;
731
736
Ok ( param. for_device ( ) )
732
737
}
733
738
@@ -858,8 +863,9 @@ impl<'a, T: Sync + RustToCuda> CudaKernelParameter for &'a PtxJit<DeepPerThreadB
858
863
Self : ' b ,
859
864
{
860
865
// FIXME: forward impl
866
+ let _ = stream;
861
867
crate :: lend:: LendToCuda :: lend_to_cuda ( param, |param| {
862
- inner. with ( param . as_async ( stream ) . as_ref ( ) )
868
+ inner. with ( unsafe { crate :: utils :: r#async :: AsyncProj :: new ( param , None ) } )
863
869
} )
864
870
}
865
871
@@ -872,7 +878,8 @@ impl<'a, T: Sync + RustToCuda> CudaKernelParameter for &'a PtxJit<DeepPerThreadB
872
878
where
873
879
Self : ' b ,
874
880
{
875
- let param = unsafe { param. unwrap_ref_unchecked ( ) } ;
881
+ let param_ref = param. proj_ref ( ) ;
882
+ let param = unsafe { param_ref. unwrap_unchecked ( ) } ;
876
883
inner ( Some ( & param_as_raw_bytes ( param. for_host ( ) ) ) )
877
884
}
878
885
@@ -945,7 +952,7 @@ impl<'a, T: Sync + RustToCuda + SafeMutableAliasing> CudaKernelParameter
945
952
inner. with ( {
946
953
// Safety: this projection cannot be moved to a different stream
947
954
// without first exiting lend_to_cuda_mut and synchronizing
948
- unsafe { crate :: utils:: r#async:: AsyncProj :: new ( & mut param. into_mut ( ) , None ) }
955
+ unsafe { crate :: utils:: r#async:: AsyncProj :: new ( param. into_mut ( ) , None ) }
949
956
} )
950
957
} )
951
958
}
@@ -959,7 +966,8 @@ impl<'a, T: Sync + RustToCuda + SafeMutableAliasing> CudaKernelParameter
959
966
where
960
967
Self : ' b ,
961
968
{
962
- let param = unsafe { param. as_ref ( ) . unwrap_unchecked ( ) } ;
969
+ let param_ref = param. proj_ref ( ) ;
970
+ let param = unsafe { param_ref. unwrap_unchecked ( ) } ;
963
971
inner ( Some ( & param_as_raw_bytes ( param. for_host ( ) ) ) )
964
972
}
965
973
0 commit comments