HEaaN GPU API in use
1. Check GPU is available
2. Make context with CUDA device ID
Choose ParameterPreset
If you plan to use bootstrapping operations, select the bootstrappable parameter. (Please refer the
ParameterPreset.hpp
)
Specify the set of device_ids recognized by the CUDA runtime.
Currently, since we provide a single GPU, only
{0}
is available.
3. Generate various keys and Send to GPU memory
HEaaN requires various keys, which need to be loaded into GPU memory for efficient computation.
You can generate various keys from KeyGenerator
.
Note that
context
takes an important role in key generation step.
Once Keys are generated, We have to send them into GPU memory.
4. [For bootstrapping] Generate Bootstrapper
and Send to GPU memory
Bootstrapper
and Send to GPU memoryIf you are interested at bootstrapping, you have to go through additional several steps.
Create the Bootstrapper which include pre-computed constants for bootstrapping.
5. Create and Load message to GPU memory
Message is the data that we want to compute on in an encrypted state.
6. Decrypt the result ciphertext
Secret key and Data should be located in the same device.
7. Send result message into CPU memory
At the end of the day, bring your result to CPU memory by using the to()
function.
Last updated
Was this helpful?