@@ -24,6 +24,8 @@ pub use traits::{IOwnedArray, Slicing, SlicingMut};
2424use crate :: array:: stride:: DynDimensions ;
2525use crate :: core_crypto:: prelude:: { Numeric , OverflowingAdd , SignedNumeric , UnsignedNumeric } ;
2626use crate :: integer:: block_decomposition:: DecomposableInto ;
27+ #[ cfg( feature = "gpu" ) ]
28+ use crate :: integer:: gpu:: ciphertext:: CudaIntegerRadixCiphertext ;
2729use crate :: integer:: RadixCiphertext ;
2830use crate :: prelude:: { CastFrom , CastInto } ;
2931pub use cpu:: {
@@ -472,8 +474,25 @@ where
472474 )
473475 }
474476 #[ cfg( feature = "gpu" ) ]
475- InternalServerKey :: Cuda ( _) => {
476- panic ! ( "GPU does not support contains() on FheIntegerType yet" )
477+ InternalServerKey :: Cuda ( gpu_key) => {
478+ use crate :: high_level_api:: details:: MaybeCloned ;
479+
480+ let streams = & gpu_key. streams ;
481+ let tmp_data = data
482+ . iter ( )
483+ . map ( |element| match element. on_gpu ( streams) {
484+ MaybeCloned :: Borrowed ( ct) => ct. duplicate ( streams) ,
485+ MaybeCloned :: Cloned ( ct) => ct,
486+ } )
487+ . collect :: < Vec < _ > > ( ) ;
488+ let tmp_value = value. on_gpu ( streams) ;
489+
490+ let result = gpu_key. pbs_key ( ) . contains ( & tmp_data, & * tmp_value, streams) ;
491+ FheBool :: new (
492+ result,
493+ gpu_key. tag . clone ( ) ,
494+ ReRandomizationMetadata :: default ( ) ,
495+ )
477496 }
478497 #[ cfg( feature = "hpu" ) ]
479498 InternalServerKey :: Hpu ( _) => {
0 commit comments