diff --git a/Makefile b/Makefile index 88173e7b3..9d2ebce16 100644 --- a/Makefile +++ b/Makefile @@ -315,7 +315,7 @@ clippy_hpu: install_rs_check_toolchain .PHONY: clippy_gpu_hpu # Run clippy lints on tfhe with "gpu" and "hpu" enabled clippy_gpu_hpu: install_rs_check_toolchain RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \ - --features=boolean,shortint,integer,internal-keycache,gpu,hpu,pbs-stats,extended-types \ + --features=boolean,shortint,integer,internal-keycache,gpu,hpu,pbs-stats,extended-types,zk-pok \ --all-targets \ -p $(TFHE_SPEC) -- --no-deps -D warnings diff --git a/tfhe/src/high_level_api/compact_list.rs b/tfhe/src/high_level_api/compact_list.rs index a52a53f2d..8921bf54f 100644 --- a/tfhe/src/high_level_api/compact_list.rs +++ b/tfhe/src/high_level_api/compact_list.rs @@ -276,7 +276,8 @@ mod zk { } } - fn move_to_device(&mut self, device: crate::Device) { + #[allow(clippy::unnecessary_wraps)] // Method can return an error if hpu is enabled + fn move_to_device(&mut self, device: crate::Device) -> Result<(), crate::Error> { let new_value = match (&self, device) { (Self::Cpu(_), crate::Device::Cpu) => None, #[cfg(feature = "gpu")] @@ -303,11 +304,18 @@ mod zk { }); Some(Self::Cuda(cuda_ct)) } + #[cfg(feature = "hpu")] + (_, crate::Device::Hpu) => { + return Err(crate::error!( + "Hpu does not support ProvenCompactCiphertextList" + )) + } }; if let Some(v) = new_value { *self = v; } + Ok(()) } } @@ -330,7 +338,8 @@ mod zk { .map(Self::Cpu)?; if let Some(device) = device_of_internal_keys() { - new.move_to_device(device); + new.move_to_device(device) + .map_err(serde::de::Error::custom)?; } Ok(new)