File tree Expand file tree Collapse file tree
vortex-cuda/src/kernel/patches Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,18 +221,19 @@ pub(crate) fn upload_gpu_patches(
221221 device_patches : & DevicePatches ,
222222 ctx : & CudaExecutionCtx ,
223223) -> VortexResult < ( BufferHandle , u64 ) > {
224- #[ expect( clippy:: cast_possible_truncation) ]
225- // Zero-initialize to avoid uninitialized padding bytes (e.g. between
226- // chunk_offset_type and indices) which would be UB when serialized.
224+ // Zero-initialize to avoid uninitialized padding bytes.
227225 let mut gpu_patches: GPUPatches = unsafe { std:: mem:: zeroed ( ) } ;
228226 gpu_patches. chunk_offsets = device_patches. chunk_offsets . cuda_device_ptr ( ) ? as _ ;
229227 gpu_patches. chunk_offset_type = ptype_to_chunk_offset_type ( device_patches. chunk_offset_ptype ) ?;
230228 gpu_patches. indices = device_patches. indices . cuda_device_ptr ( ) ? as _ ;
231229 gpu_patches. values = device_patches. values . cuda_device_ptr ( ) ? as _ ;
232- gpu_patches. offset = device_patches. offset as u32 ;
233- gpu_patches. offset_within_chunk = device_patches. offset_within_chunk as u32 ;
234- gpu_patches. num_patches = device_patches. num_patches as u32 ;
235- gpu_patches. n_chunks = device_patches. n_chunks as u32 ;
230+ #[ expect( clippy:: cast_possible_truncation) ]
231+ {
232+ gpu_patches. offset = device_patches. offset as u32 ;
233+ gpu_patches. offset_within_chunk = device_patches. offset_within_chunk as u32 ;
234+ gpu_patches. num_patches = device_patches. num_patches as u32 ;
235+ gpu_patches. n_chunks = device_patches. n_chunks as u32 ;
236+ }
236237
237238 // Serialize the repr(C) struct to bytes and upload to the device.
238239 let bytes = unsafe {
You can’t perform that action at this time.
0 commit comments