nucypher / nufhe

NuCypher fully homomorphic encryption (NuFHE) library implemented in Python
https://nufhe.readthedocs.io/en/latest/
GNU General Public License v3.0
441 stars 53 forks source link

[Feature Request] Support for CPU/non-GPU systems? #24

Open Perzan opened 3 years ago

Perzan commented 3 years ago

This would only be for learning or developing with it.

fjarri commented 3 years ago

At the moment it should work on Intel videocards. Possibly, on any other OpenCL platform that supports kernels with shared memory on CPUs. I only have access to the Apple implementation, and, unfortunately, it doesn't, but the driver for AMD CPUs might.

OpenCL implementations which don't allow shared memory in CPU kernels can be theoretically supported, by making special versions of kernels that don't use shared memory (and don't worry about coalescing, execution divergence, and other GPU peculiarities), but that would involve a substantial amount of work. Performance is the main unknown here, I don't have a lot of experience with optimizing CPU-based OpenCL code.

Alternatively one could make a pure-CPU version, I suppose, with cffi and fftw - numpy would have too much overhead.