Skip to content

Commit 0da79f9

Browse files
committed
feat(gpu): div_rem_2_2_blocks
1 parent 71f427d commit 0da79f9

File tree

6 files changed

+1153
-274
lines changed

6 files changed

+1153
-274
lines changed

backends/tfhe-cuda-backend/cuda/include/integer/compression/compression.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,7 @@
22
#define CUDA_INTEGER_COMPRESSION_H
33

44
#include "../../pbs/pbs_enums.h"
5-
6-
typedef struct {
7-
void *ptr;
8-
uint32_t num_radix_blocks;
9-
uint32_t lwe_dimension;
10-
} CudaLweCiphertextListFFI;
11-
12-
typedef struct {
13-
void *ptr;
14-
uint32_t storage_log_modulus;
15-
uint32_t lwe_per_glwe;
16-
// Input LWEs are grouped by groups of `lwe_per_glwe`(the last group may be
17-
// smaller)
18-
// Each group is then packed into one GLWE with `lwe_per_glwe` bodies (one for
19-
// each LWE of the group). In the end the total number of bodies is equal to
20-
// the number of input LWE
21-
uint32_t total_lwe_bodies_count;
22-
uint32_t glwe_dimension;
23-
uint32_t polynomial_size;
24-
} CudaPackedGlweCiphertextListFFI;
25-
5+
#include "../integer.h"
266
extern "C" {
277
uint64_t scratch_cuda_integer_compress_radix_ciphertext_64(
288
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count,

backends/tfhe-cuda-backend/cuda/include/integer/integer.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ typedef struct {
8080
bool const divisor_has_more_bits_than_numerator;
8181
} CudaScalarDivisorFFI;
8282

83+
typedef struct {
84+
void *ptr;
85+
uint32_t num_radix_blocks;
86+
uint32_t lwe_dimension;
87+
} CudaLweCiphertextListFFI;
88+
89+
typedef struct {
90+
void *ptr;
91+
uint32_t storage_log_modulus;
92+
uint32_t lwe_per_glwe;
93+
// Input LWEs are grouped by groups of `lwe_per_glwe`(the last group may be
94+
// smaller)
95+
// Each group is then packed into one GLWE with `lwe_per_glwe` bodies (one for
96+
// each LWE of the group). In the end the total number of bodies is equal to
97+
// the number of input LWE
98+
uint32_t total_lwe_bodies_count;
99+
uint32_t glwe_dimension;
100+
uint32_t polynomial_size;
101+
} CudaPackedGlweCiphertextListFFI;
102+
83103
uint64_t scratch_cuda_apply_univariate_lut_kb_64(
84104
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count,
85105
int8_t **mem_ptr, void const *input_lut, uint32_t lwe_dimension,

0 commit comments

Comments
 (0)