File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -250,16 +250,24 @@ async fn export_variadic(
250250 buffers. push ( None ) ;
251251
252252 if let Some ( buf) = buffer {
253- buffers. push ( Some ( buf) ) ;
253+ buffers. push ( Some ( ensure_device_resident ( buf, ctx ) . await ? ) ) ;
254254 }
255255
256256 // We create a new buffer that contains the lengths of the variadic buffers as i64.
257257 let mut variadic_buffer_lens = BufferMut :: with_capacity ( variadic_buffers. len ( ) ) ;
258258 for buffer in variadic_buffers {
259259 variadic_buffer_lens. push ( buffer. len ( ) as i64 ) ;
260- buffers. push ( Some ( buffer) ) ;
260+ buffers. push ( Some ( ensure_device_resident ( buffer, ctx ) . await ? ) ) ;
261261 }
262262
263+ let variadic_buffer_lens = ensure_device_resident (
264+ BufferHandle :: new_host ( variadic_buffer_lens. freeze ( ) . into_byte_buffer ( ) ) ,
265+ ctx,
266+ )
267+ . await ?;
268+
269+ buffers. push ( Some ( variadic_buffer_lens) ) ;
270+
263271 let mut private_data = PrivateData :: new ( buffers, vec ! [ ] , ctx) ?;
264272 let sync_event = private_data. sync_event ( ) ;
265273
You can’t perform that action at this time.
0 commit comments