-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gpu): automatically generate rust bindings for cuda functions, …
…except device.cu
- Loading branch information
1 parent
416fb5a
commit e698d18
Showing
104 changed files
with
3,900 additions
and
3,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
#ifndef CUDA_CIPHERTEXT_H | ||
#define CUDA_CIPHERTEXT_H | ||
|
||
#include "device.h" | ||
#include <cstdint> | ||
#include "stdint.h" | ||
|
||
extern "C" { | ||
void cuda_convert_lwe_ciphertext_vector_to_gpu_64(void *stream, | ||
uint32_t gpu_index, | ||
void *dest, void *src, | ||
void *dest, void const *src, | ||
uint32_t number_of_cts, | ||
uint32_t lwe_dimension); | ||
void cuda_convert_lwe_ciphertext_vector_to_cpu_64(void *stream, | ||
uint32_t gpu_index, | ||
void *dest, void *src, | ||
void *dest, void const *src, | ||
uint32_t number_of_cts, | ||
uint32_t lwe_dimension); | ||
|
||
void cuda_glwe_sample_extract_64(void *stream, uint32_t gpu_index, | ||
void *lwe_array_out, void *glwe_array_in, | ||
uint32_t *nth_array, uint32_t num_nths, | ||
void *lwe_array_out, void const *glwe_array_in, | ||
uint32_t const *nth_array, uint32_t num_nths, | ||
uint32_t glwe_dimension, | ||
uint32_t polynomial_size); | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
backends/tfhe-cuda-backend/cuda/include/integer/compression/compression.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef CUDA_INTEGER_COMPRESSION_H | ||
#define CUDA_INTEGER_COMPRESSION_H | ||
|
||
#include "../../pbs/pbs_enums.h" | ||
|
||
extern "C" { | ||
void scratch_cuda_integer_compress_radix_ciphertext_64( | ||
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count, | ||
int8_t **mem_ptr, uint32_t compression_glwe_dimension, | ||
uint32_t compression_polynomial_size, uint32_t lwe_dimension, | ||
uint32_t ks_level, uint32_t ks_base_log, uint32_t num_radix_blocks, | ||
uint32_t message_modulus, uint32_t carry_modulus, PBS_TYPE pbs_type, | ||
uint32_t lwe_per_glwe, uint32_t storage_log_modulus, | ||
bool allocate_gpu_memory); | ||
|
||
void scratch_cuda_integer_decompress_radix_ciphertext_64( | ||
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count, | ||
int8_t **mem_ptr, uint32_t encryption_glwe_dimension, | ||
uint32_t encryption_polynomial_size, uint32_t compression_glwe_dimension, | ||
uint32_t compression_polynomial_size, uint32_t lwe_dimension, | ||
uint32_t pbs_level, uint32_t pbs_base_log, uint32_t num_radix_blocks, | ||
uint32_t message_modulus, uint32_t carry_modulus, PBS_TYPE pbs_type, | ||
uint32_t storage_log_modulus, uint32_t body_count, | ||
bool allocate_gpu_memory); | ||
|
||
void cuda_integer_compress_radix_ciphertext_64( | ||
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count, | ||
void *glwe_array_out, void const *lwe_array_in, void *const *fp_ksk, | ||
uint32_t num_nths, int8_t *mem_ptr); | ||
|
||
void cuda_integer_decompress_radix_ciphertext_64( | ||
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count, | ||
void *lwe_array_out, void const *glwe_in, uint32_t const *indexes_array, | ||
uint32_t indexes_array_size, void *const *bsks, int8_t *mem_ptr); | ||
|
||
void cleanup_cuda_integer_compress_radix_ciphertext_64( | ||
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count, | ||
int8_t **mem_ptr_void); | ||
|
||
void cleanup_cuda_integer_decompress_radix_ciphertext_64( | ||
void *const *streams, uint32_t const *gpu_indexes, uint32_t gpu_count, | ||
int8_t **mem_ptr_void); | ||
} | ||
|
||
#endif |
Oops, something went wrong.