mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-08 06:13:58 -05:00
6.5 KiB
6.5 KiB
GPU operations
This document outlines the GPU operations supported in TFHE-rs.
The GPU backend includes the following operations for both signed and unsigned encrypted integers:
| name | symbol | Enc/Enc |
Enc/ Int |
|---|---|---|---|
| Neg | - |
✔️ | N/A |
| Add | + |
✔️ | ✔️ |
| Sub | - |
✔️ | ✔️ |
| Mul | * |
✔️ | ✔️ |
| Div | / |
✔️ | ✔️ |
| Rem | % |
✔️ | ✔️ |
| Not | ! |
✔️ | N/A |
| BitAnd | & |
✔️ | ✔️ |
| BitOr | | |
✔️ | ✔️ |
| BitXor | ^ |
✔️ | ✔️ |
| Shr | >> |
✔️ | ✔️ |
| Shl | << |
✔️ | ✔️ |
| Rotate right | rotate_right |
✔️ | ✔️ |
| Rotate left | rotate_left |
✔️ | ✔️ |
| Min | min |
✔️ | ✔️ |
| Max | max |
✔️ | ✔️ |
| Greater than | gt |
✔️ | ✔️ |
| Greater or equal than | ge |
✔️ | ✔️ |
| Lower than | lt |
✔️ | ✔️ |
| Lower or equal than | le |
✔️ | ✔️ |
| Equal | eq |
✔️ | ✔️ |
| Not Equal | ne |
✔️ | ✔️ |
| Cast (into dest type) | cast_into |
✔️ | N/A |
| Cast (from src type) | cast_from |
✔️ | N/A |
| Ternary operator | select |
✔️ | ✖️ |
| Integer logarithm | ilog2 |
✔️ | N/A |
| Count trailing/leading ones | leading_zeros |
✔️ | N/A |
| Count trailing/leading zeros | leading_ones |
✔️ | N/A |
| Oblivious Pseudo Random Generation | oprf |
✔️ | N/A |
{% hint style="info" %} All operations follow the same syntax as the one described in here. {% endhint %}