chore(gpu): fix static analysis warnings - #3844
Conversation
|
✅ Backward-compat snapshot: everything looks good! No backward-compatibility issues detected. |
|
✅ Forward compatibility matrix unchanged: it still matches the committed baseline. MatrixWhich released versions can load data produced by this branch. A ❌ is not a failure by itself: it only means forward compatibility is not (or no longer) provided for that type. What matters is whether it was reviewed.
|
f0e8ec5 to
78ab24a
Compare
|
If you're new to commit signing, there are different ways to set it up: Sign commits with
|
16601ec to
d36cc09
Compare
d36cc09 to
ee2d133
Compare
Summary
Fix minor warnings raised by static analysis across the CUDA backends.
Value-initialized structs:
cudaPointerAttributes attr{}indevice.cu(5 instances) to avoid reading uninitialized fieldscudaDeviceProp prop{}inbootstrapping_key.cuto avoid reading uninitialized fieldscudaDeviceProp deviceProp{}inhelper_multi_gpu.cuto avoid reading uninitialized fieldscudaDeviceProp device_prop{}indevice.cu(tfhe-cuda-common) to avoid reading uninitialized fieldsDeprecated C headers replaced with C++ equivalents:
<stdint.h>→<cstdint>inhelper_profile.cu<stdio.h>→<cstdio>inprogrammable_bootstrap_classic.cuDeprecated CUDA types replaced:
ulonglong4→ulonglong4_16ainlinearalgebra/multiplication.cu(2 instances) andpolynomial/dot_product.cuh(1 instance)Narrowing conversion fixes:
blockIdx.y→static_cast<int>(blockIdx.y)inprogrammable_bootstrap.cuthreadIdx.x + blockIdx.x * blockDim.x→static_cast<int>(...)indevice.cu0xff000000 | (r << 16) | ...→static_cast<int>(...)inhelper_profile.cuautowith cast expressions:double2 *buffer = (double2 *)cuda_malloc_async(...)→auto *buffer = ...inbootstrapping_key.cu__uint128_t *d_standard = (__uint128_t *)cuda_malloc_async(...)→auto *d_standard = ...inbootstrapping_key.cuErroneous
constoncudaStream_tparameter:cudaStream_t const stream→cudaStream_t streaminradix_ciphertext.handradix_ciphertext.cu(cudaStream_tis a pointer typedef, so top-levelconstis misleading)Unused includes removed:
#include <omp.h>fromhelper_multi_gpu.cu#include <iostream>frominteger/scalar_comparison.cu#include "ciphertext.h"frompbs/programmable_bootstrap_classic.cuUnused parameter names commented out:
groupandsupport_dsmin 3grid_grouptemplate specializations inprogrammable_bootstrap.cupolynomial_sizeininteger/scalar_mul.cunum_radixininteger/multiplication.cu(declaration updated ininteger_utilities.h)num_inputsinkreyvium/kreyvium.cuandtrivium/trivium.cu(2 functions each)Missing Doxygen
@paramentries:oprf.cu: added@paramforstreams,message_modulus,carry_modulus,allocate_gpu_memory,bsks,ksksshuffle.cu: added@paramforstreams,bsks,ksks,lwe_flattened_encryptions_of_zero_compact_array_in,rerand_ksksinteger.cu: added@paramforstream,gpu_indexParameter name mismatches between declarations and definitions:
stream_v/_input1/_input2/_output→stream/input1/input2/outputin 4 fourier polynomial functions inbootstrapping_key.cu(local casts use short namess,in1,in2,out,buf)mem_ptr→bufferin PBS scratch/cleanup/execute functions acrossprogrammable_bootstrap_classic.cu,programmable_bootstrap_classic_128.cu,programmable_bootstrap_multibit.cu,programmable_bootstrap_multibit_128.cu(local casts usepbs_bufto avoid shadowing thepbs_buffertype)pbs_buffer→bufferin multibit noise-test wrapper functions inprogrammable_bootstrap_multibit.hand.cuuses_trivial_indices→uses_trivial_indexesin 2 keyswitch functions inkeyswitch.cunum_radix_blocks→lwe_ciphertext_countin 2 comparison functions incomparison.cunum_radix_blocks→input_lwe_ciphertext_count,num_many_lut→num_luts,original_num_blocks→num_original_blocksin 3 integer functions ininteger.cumem→mem_ptrinscalar_mul.cuglwe_lhs→poly_lhsinmultiplication.cubindings.rs(auto-generated) to reflect header changesValidation
make pcc_gpupasses (doxygen check, formatting)cargo check -p tfhe-cuda-backendpasses