Compare commits
21 Commits
Workflows-
...
release/1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e53f5b6cba | ||
|
|
09dbe6eef3 | ||
|
|
f9318b5167 | ||
|
|
1f5169a580 | ||
|
|
686885e890 | ||
|
|
7826a3b537 | ||
|
|
3cfa7499ae | ||
|
|
6295531229 | ||
|
|
6a3f037b55 | ||
|
|
4e02ec5299 | ||
|
|
c319a8b637 | ||
|
|
ca6b4d487c | ||
|
|
b0afa12d09 | ||
|
|
6cdab08cf1 | ||
|
|
357d25d09d | ||
|
|
e1e87a7cc5 | ||
|
|
9657480262 | ||
|
|
bb063dfc8f | ||
|
|
b6b32ba096 | ||
|
|
597ffdc8f3 | ||
|
|
9ed7adf5f5 |
8
.github/workflows/ci_lint.yml
vendored
@@ -5,7 +5,8 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
ACTIONLINT_VERSION: 1.6.27
|
||||
ACTIONLINT_VERSION: 1.7.7
|
||||
ACTIONLINT_CHECKSUM: "023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757"
|
||||
CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
@@ -21,9 +22,10 @@ jobs:
|
||||
|
||||
- name: Get actionlint
|
||||
run: |
|
||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) ${{ env.ACTIONLINT_VERSION }}
|
||||
echo "f2ee6d561ce00fa93aab62a7791c1a0396ec7e8876b2a8f2057475816c550782 actionlint" > checksum
|
||||
wget "https://github.com/rhysd/actionlint/releases/download/v${{ env.ACTIONLINT_VERSION }}/actionlint_${{ env.ACTIONLINT_VERSION }}_linux_amd64.tar.gz"
|
||||
echo "${{ env.ACTIONLINT_CHECKSUM }} actionlint_${{ env.ACTIONLINT_VERSION }}_linux_amd64.tar.gz" > checksum
|
||||
sha256sum -c checksum
|
||||
tar -xf actionlint_${{ env.ACTIONLINT_VERSION }}_linux_amd64.tar.gz actionlint
|
||||
ln -s "$(pwd)/actionlint" /usr/local/bin/
|
||||
|
||||
- name: Lint workflows
|
||||
|
||||
9
.github/workflows/make_release.yml
vendored
@@ -81,7 +81,7 @@ jobs:
|
||||
# For provenance of npmjs publish
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
id-token: write # also needed for OIDC token exchange on crates.io
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -98,13 +98,16 @@ jobs:
|
||||
with:
|
||||
name: crate
|
||||
path: target/package
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
- name: Publish crate.io package
|
||||
if: ${{ inputs.push_to_crates }}
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
||||
run: |
|
||||
cargo publish -p tfhe --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
||||
cargo publish -p tfhe ${{ env.DRY_RUN }}
|
||||
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
|
||||
11
.github/workflows/make_release_cuda.yml
vendored
@@ -115,6 +115,9 @@ jobs:
|
||||
name: Publish CUDA Release
|
||||
needs: [setup-instance, package] # for comparing hashes
|
||||
runs-on: ${{ needs.setup-instance.outputs.runner-name }}
|
||||
permissions:
|
||||
# Needed for OIDC token exchange on crates.io
|
||||
id-token: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
# explicit include-based build matrix, of known valid options
|
||||
@@ -152,12 +155,16 @@ jobs:
|
||||
echo "HOME=/home/ubuntu";
|
||||
} >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
||||
run: |
|
||||
cargo publish -p tfhe-cuda-backend --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
||||
cargo publish -p tfhe-cuda-backend ${{ env.DRY_RUN }}
|
||||
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
|
||||
10
.github/workflows/make_release_tfhe_csprng.yml
vendored
@@ -59,6 +59,9 @@ jobs:
|
||||
name: Publish tfhe-csprng Release
|
||||
needs: [verify_tag, package]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed for OIDC token exchange on crates.io
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -70,12 +73,15 @@ jobs:
|
||||
with:
|
||||
name: crate-tfhe-csprng
|
||||
path: target/package
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
||||
run: |
|
||||
cargo publish -p tfhe-csprng --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
||||
cargo publish -p tfhe-csprng ${{ env.DRY_RUN }}
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
run: cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
11
.github/workflows/make_release_tfhe_fft.yml
vendored
@@ -60,6 +60,9 @@ jobs:
|
||||
name: Publish tfhe-fft Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [verify_tag, package] # for comparing hashes
|
||||
permissions:
|
||||
# Needed for OIDC token exchange on crates.io
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -67,12 +70,16 @@ jobs:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.FHE_ACTIONS_TOKEN }}
|
||||
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
||||
run: |
|
||||
cargo publish -p tfhe-fft --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
||||
cargo publish -p tfhe-fft ${{ env.DRY_RUN }}
|
||||
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
|
||||
11
.github/workflows/make_release_tfhe_ntt.yml
vendored
@@ -60,18 +60,25 @@ jobs:
|
||||
name: Publish tfhe-ntt Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: [verify_tag, package] # for comparing hashes
|
||||
permissions:
|
||||
# Needed for OIDC token exchange on crates.io
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
||||
run: |
|
||||
cargo publish -p tfhe-ntt --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
||||
cargo publish -p tfhe-ntt ${{ env.DRY_RUN }}
|
||||
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
|
||||
@@ -56,6 +56,9 @@ jobs:
|
||||
name: Publish tfhe-versionable-derive Release
|
||||
needs: [ verify_tag, package-derive ] # for comparing hashes
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed for OIDC token exchange on crates.io
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -68,11 +71,14 @@ jobs:
|
||||
with:
|
||||
name: crate-tfhe-versionable-derive
|
||||
path: target/package
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
run: |
|
||||
cargo publish -p tfhe-versionable-derive --token ${{ env.CRATES_TOKEN }}
|
||||
cargo publish -p tfhe-versionable-derive
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
run: cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
|
||||
@@ -141,11 +147,14 @@ jobs:
|
||||
with:
|
||||
name: crate-tfhe-versionable
|
||||
path: target/package
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
run: |
|
||||
cargo publish -p tfhe-versionable --token ${{ env.CRATES_TOKEN }}
|
||||
cargo publish -p tfhe-versionable
|
||||
- name: Generate hash
|
||||
id: published_hash
|
||||
run: cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
10
.github/workflows/make_release_zk_pok.yml
vendored
@@ -56,6 +56,9 @@ jobs:
|
||||
name: Publish tfhe-zk-pok Release
|
||||
needs: [verify_tag, package] # for comparing hashes
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed for OIDC token exchange on crates.io
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
@@ -68,12 +71,15 @@ jobs:
|
||||
with:
|
||||
name: crate-zk-pok
|
||||
path: target/package
|
||||
- name: Authenticate on registry
|
||||
uses: rust-lang/crates-io-auth-action@e919bc7605cde86df457cf5b93c5e103838bd879 # v1.0.1
|
||||
id: auth
|
||||
- name: Publish crate.io package
|
||||
env:
|
||||
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
|
||||
DRY_RUN: ${{ inputs.dry_run && '--dry-run' || '' }}
|
||||
run: |
|
||||
cargo publish -p tfhe-zk-pok --token ${{ env.CRATES_TOKEN }} ${{ env.DRY_RUN }}
|
||||
cargo publish -p tfhe-zk-pok ${{ env.DRY_RUN }}
|
||||
- name: Verify hash
|
||||
id: published_hash
|
||||
run: cd target/package && echo "pub_hash=$(sha256sum ./*.crate | base64 -w0)" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
@@ -26,7 +26,7 @@ itertools = "0.14"
|
||||
num-complex = "0.4"
|
||||
pulp = { version = "0.21", default-features = false }
|
||||
rand = "0.8"
|
||||
rayon = "1"
|
||||
rayon = "1.11"
|
||||
serde = { version = "1.0", default-features = false }
|
||||
wasm-bindgen = "0.2.100"
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
assert!(a.len() % 8 == 0);
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:02X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:02X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
@@ -74,7 +74,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
fn get_hexagonal_string_from_u64(a: Vec<u64>) -> String {
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:016X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:016X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ impl<const N: usize, T> Index<usize> for StaticDeque<N, T> {
|
||||
/// 0 is youngest
|
||||
fn index(&self, i: usize) -> &T {
|
||||
if i >= N {
|
||||
panic!("Index {:?} too high for size {:?}", i, N);
|
||||
panic!("Index {i:?} too high for size {N:?}");
|
||||
}
|
||||
&self.arr[(N + self.cursor - i - 1) % N]
|
||||
}
|
||||
@@ -66,7 +66,7 @@ impl<const N: usize, T> IndexMut<usize> for StaticDeque<N, T> {
|
||||
/// 0 is youngest
|
||||
fn index_mut(&mut self, i: usize) -> &mut T {
|
||||
if i >= N {
|
||||
panic!("Index {:?} too high for size {:?}", i, N);
|
||||
panic!("Index {i:?} too high for size {N:?}");
|
||||
}
|
||||
&mut self.arr[(N + self.cursor - i - 1) % N]
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
assert!(a.len() % 8 == 0);
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:02X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:02X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
@@ -74,7 +74,7 @@ fn get_hexagonal_string_from_bytes(a: Vec<u8>) -> String {
|
||||
fn get_hexagonal_string_from_u64(a: Vec<u64>) -> String {
|
||||
let mut hexadecimal: String = "".to_string();
|
||||
for test in a {
|
||||
hexadecimal.push_str(&format!("{:016X?}", test));
|
||||
hexadecimal.push_str(&format!("{test:016X?}"));
|
||||
}
|
||||
hexadecimal
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ fn main() {
|
||||
};
|
||||
let mut headers_modified = bindings_modified;
|
||||
for header in headers {
|
||||
println!("cargo:rerun-if-changed={}", header);
|
||||
println!("cargo:rerun-if-changed={header}");
|
||||
// Check modification times
|
||||
let header_modified = std::fs::metadata(header).unwrap().modified().unwrap();
|
||||
if header_modified > headers_modified {
|
||||
|
||||
@@ -277,8 +277,7 @@ pub fn test_hl_clientkey(
|
||||
if test_params != key_params {
|
||||
Err(test.failure(
|
||||
format!(
|
||||
"Invalid {} parameters:\n Expected :\n{:?}\nGot:\n{:?}",
|
||||
format, test_params, key_params
|
||||
"Invalid {format} parameters:\n Expected :\n{test_params:?}\nGot:\n{key_params:?}",
|
||||
),
|
||||
format,
|
||||
))
|
||||
@@ -327,8 +326,7 @@ pub fn test_hl_pubkey(
|
||||
if decrypted != value {
|
||||
Err(test.failure(
|
||||
format!(
|
||||
"Failed to decrypt value encrypted with public key, got {} expected {}",
|
||||
decrypted, value
|
||||
"Failed to decrypt value encrypted with public key, got {decrypted} expected {value}",
|
||||
),
|
||||
format,
|
||||
))
|
||||
|
||||
@@ -74,9 +74,9 @@ fn run_test<M: TestedModule>(
|
||||
let test_result = M::run_test(test_dir, testcase, format);
|
||||
|
||||
match &test_result {
|
||||
TestResult::Success(r) => println!("{}", r),
|
||||
TestResult::Failure(r) => println!("{}", r),
|
||||
TestResult::Skipped(r) => println!("{}", r),
|
||||
TestResult::Success(r) => println!("{r}"),
|
||||
TestResult::Failure(r) => println!("{r}"),
|
||||
TestResult::Skipped(r) => println!("{r}"),
|
||||
}
|
||||
|
||||
test_result
|
||||
|
||||
@@ -43,7 +43,7 @@ impl<BlockCipher: AesBlockCipher> AesCtrGenerator<BlockCipher> {
|
||||
let first_index = self.state.table_index().incremented();
|
||||
let output = (0..n_children.0)
|
||||
.into_par_iter()
|
||||
.zip(rayon::iter::repeatn(
|
||||
.zip(rayon::iter::repeat_n(
|
||||
(self.block_cipher.clone(), first_index, n_bytes),
|
||||
n_children.0,
|
||||
))
|
||||
|
||||
@@ -20,9 +20,8 @@ impl AesBlockCipher for AesniBlockCipher {
|
||||
if !(aes_detected && sse2_detected) {
|
||||
panic!(
|
||||
"The AesniBlockCipher requires both aes and sse2 x86 CPU features.\n\
|
||||
aes feature available: {}\nsse2 feature available: {}\n\
|
||||
aes feature available: {aes_detected}\nsse2 feature available: {sse2_detected}\n\
|
||||
Please consider enabling the SoftwareRandomGenerator with the `software-prng` feature",
|
||||
aes_detected, sse2_detected
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -331,7 +331,7 @@ mod test {
|
||||
Compress::Yes => Params::uncompress(bincode::deserialize(&bincode::serialize(
|
||||
&public_params.compress(),
|
||||
)?)?)
|
||||
.map_err(|e| Box::new(ErrorKind::Custom(format!("Failed to uncompress: {}", e)))),
|
||||
.map_err(|e| Box::new(ErrorKind::Custom(format!("Failed to uncompress: {e}")))),
|
||||
Compress::No => bincode::deserialize(&bincode::serialize(&public_params)?),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ impl Display for InvalidSerializedAffineError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
InvalidSerializedAffineError::InvalidFp(fp_error) => {
|
||||
write!(f, "Invalid fp element in affine: {}", fp_error)
|
||||
write!(f, "Invalid fp element in affine: {fp_error}")
|
||||
}
|
||||
InvalidSerializedAffineError::InvalidCompressedXCoordinate => {
|
||||
write!(
|
||||
@@ -262,10 +262,10 @@ impl Display for InvalidSerializedGroupElementsError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
InvalidSerializedGroupElementsError::InvalidAffine(affine_error) => {
|
||||
write!(f, "Invalid Affine in GroupElement: {}", affine_error)
|
||||
write!(f, "Invalid Affine in GroupElement: {affine_error}")
|
||||
}
|
||||
InvalidSerializedGroupElementsError::InvalidGlistDimension(arr_error) => {
|
||||
write!(f, "invalid number of elements in g_list: {}", arr_error)
|
||||
write!(f, "invalid number of elements in g_list: {arr_error}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,10 +357,10 @@ impl Display for InvalidSerializedPublicParamsError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
InvalidSerializedPublicParamsError::InvalidGroupElements(group_error) => {
|
||||
write!(f, "Invalid PublicParams: {}", group_error)
|
||||
write!(f, "Invalid PublicParams: {group_error}")
|
||||
}
|
||||
InvalidSerializedPublicParamsError::InvalidHashDimension(arr_error) => {
|
||||
write!(f, "invalid size of hash: {}", arr_error)
|
||||
write!(f, "invalid size of hash: {arr_error}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "tfhe"
|
||||
version = "1.1.0"
|
||||
version = "1.1.3"
|
||||
edition = "2021"
|
||||
readme = "../README.md"
|
||||
keywords = ["fully", "homomorphic", "encryption", "fhe", "cryptography"]
|
||||
|
||||
@@ -875,9 +875,7 @@ fn bench_server_key_binary_scalar_function_clean_inputs<F, G>(
|
||||
let clear_1 = rng_func(&mut rng, bit_size);
|
||||
assert!(
|
||||
range.contains(&clear_1),
|
||||
"{:?} is not within the range {:?}",
|
||||
clear_1,
|
||||
range
|
||||
"{clear_1:?} is not within the range {range:?}",
|
||||
);
|
||||
|
||||
(ct_0, clear_1)
|
||||
@@ -916,9 +914,7 @@ fn bench_server_key_binary_scalar_function_clean_inputs<F, G>(
|
||||
let clear_1 = rng_func(&mut rng, bit_size);
|
||||
assert!(
|
||||
range.contains(&clear_1),
|
||||
"{:?} is not within the range {:?}",
|
||||
clear_1,
|
||||
range
|
||||
"{clear_1:?} is not within the range {range:?}",
|
||||
);
|
||||
clear_1
|
||||
})
|
||||
|
||||
@@ -28,7 +28,7 @@ Learn the basics of TFHE-rs, set it up, and make it run with ease.
|
||||
|
||||
Start building with TFHE-rs by exploring its core features, discovering essential guides, and learning more with user-friendly tutorials.
|
||||
|
||||
<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>FHE Computations</strong></td><td>Run FHE computation on encrypted data.</td><td><ul><li><a href="fhe-computation/types/">Types </a></li><li><a href="fhe-computation/operations/">Operations</a></li></ul></td><td><a href=".gitbook/assets/build1.png">build1.png</a></td></tr><tr><td><strong>Configuration</strong></td><td>Advanced configuration for better performance.</td><td><ul><li><a href="configuration/rust_configuration.md">Advanced Rust </a></li><li><a href="configuration/run_on_gpu.md">GPU acceleration</a></li></ul></td><td><a href=".gitbook/assets/build2.png">build2.png</a></td></tr><tr><td><strong>Integration</strong></td><td>Use TFHE-rs in different contexts or platforms..</td><td><ul><li><a href="integration/c_api.md">C API</a></li><li><a href="integration/js_on_wasm_api.md">JS on WASM API</a></li></ul></td><td><a href=".gitbook/assets/build3.png">build3.png</a></td></tr></tbody></table>
|
||||
<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><strong>FHE Computations</strong></td><td>Run FHE computation on encrypted data.</td><td><ul><li><a href="fhe-computation/types/">Types </a></li><li><a href="fhe-computation/operations/">Operations</a></li></ul></td><td><a href=".gitbook/assets/build1.png">build1.png</a></td></tr><tr><td><strong>Configuration</strong></td><td>Advanced configuration for better performance.</td><td><ul><li><a href="configuration/rust_configuration.md">Advanced Rust </a></li><li><a href="configuration/gpu_acceleration/run_on_gpu.md">GPU acceleration</a></li></ul></td><td><a href=".gitbook/assets/build2.png">build2.png</a></td></tr><tr><td><strong>Integration</strong></td><td>Use TFHE-rs in different contexts or platforms..</td><td><ul><li><a href="integration/c_api.md">C API</a></li><li><a href="integration/js_on_wasm_api.md">JS on WASM API</a></li></ul></td><td><a href=".gitbook/assets/build3.png">build3.png</a></td></tr></tbody></table>
|
||||
|
||||
## Explore more
|
||||
|
||||
@@ -51,6 +51,7 @@ Take a deep dive into TFHE-rs, exploring APIs from the highest to the lowest lev
|
||||
* [Fine-grained APIs](references/fine-grained-apis/): Mid-level APIs that enable evaluation of Boolean, short integer, and integer circuits
|
||||
* [Core crypto API](references/core-crypto-api/): Low-level API with the primitive functions and types of the TFHE scheme
|
||||
* [TFHE deep dive](explanations/tfhe-deep-dive.md): Resources that explain the Fully Homomorphic Encryption scheme - TFHE
|
||||
* [TFHE-rs handbook](https://github.com/zama-ai/tfhe-rs-handbook): Document describing algorithms implemented in TFHE-rs
|
||||
|
||||
### Support channels
|
||||
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
* [Min/Max operations](fhe-computation/operations/min-max-operations.md)
|
||||
* [Ternary conditional operations](fhe-computation/operations/ternary-conditional-operations.md)
|
||||
* [Casting operations](fhe-computation/operations/casting-operations.md)
|
||||
* [Boolean Operations](fhe-computation/operations/boolean-operations.md)
|
||||
* [String Operations](fhe-computation/operations/string-operations.md)
|
||||
* [Boolean operations](fhe-computation/operations/boolean-operations.md)
|
||||
* [String operations](fhe-computation/operations/string-operations.md)
|
||||
* [Dot product](fhe-computation/operations/dot-product.md)
|
||||
* [Core workflow](fhe-computation/compute/README.md)
|
||||
* [Configuration and key generation](fhe-computation/compute/configure-and-generate-keys.md)
|
||||
* [Server key](fhe-computation/compute/set-the-server-key.md)
|
||||
@@ -57,7 +58,12 @@
|
||||
## Configuration
|
||||
|
||||
* [Advanced Rust setup](configuration/rust_configuration.md)
|
||||
* [GPU acceleration](configuration/run_on_gpu.md)
|
||||
* [GPU acceleration](configuration/gpu_acceleration/run_on_gpu.md)
|
||||
* [Operations](configuration/gpu_acceleration/gpu_operations.md)
|
||||
* [Benchmark](configuration/gpu_acceleration/benchmark.md)
|
||||
* [Compressing ciphertexts](configuration/gpu_acceleration/compressing_ciphertexts.md)
|
||||
* [Array types](configuration/gpu_acceleration/array_type.md)
|
||||
* [Multi-GPU support](configuration/gpu_acceleration/multi_gpu.md)
|
||||
* [Parallelized PBS](configuration/parallelized_pbs.md)
|
||||
|
||||
## Integration
|
||||
|
||||
@@ -8,43 +8,43 @@
|
||||
<rect x="300" y="40" width="420" height="520" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">Negation (-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="60.0">106 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="60.0">25.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="60.0">23.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">Add / Sub (+,-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="100.0">105 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="100.0">25.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="100.0">23.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">Mul (x)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="140.0">401 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="140.0">237 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="140.0">254 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">Equal / Not Equal (eq, ne)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="180.0">81.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="180.0">17.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="180.0">16.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="220.0">Comparisons (ge, gt, le, lt)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="220.0">102 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="220.0">26.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="220.0">23.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="260.0">Max / Min (max, min)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="260.0">145 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="260.0">43.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="260.0">40.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="300.0">Bitwise operations (&, |, ^)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="300.0">20.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="300.0">5.97 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="300.0">5.79 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="340.0">Div / Rem (/, %)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="340.0">8.22 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="340.0">2.05 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="340.0">1.88 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="380.0">Left / Right Shifts (<<, >>)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="380.0">134 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="380.0">86.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="380.0">83.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="420.0">Left / Right Rotations (left_rotate, right_rotate)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="420.0">133 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="420.0">86.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="420.0">83.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="460.0">Leading / Trailing zeros/ones</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="460.0">247 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="460.0">62.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="460.0">341 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="500.0">Log2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="500.0">267 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="500.0">73.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="500.0">341 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="540.0">Select</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="405.0" y="540.0">32.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="540.0">17.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="615.0" y="540.0">16.9 ms</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" ?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 560" preserveAspectRatio="meet" width="100%" height="560">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 480" preserveAspectRatio="meet" width="100%" height="480">
|
||||
<rect x="0" y="0" width="720" height="40" fill="black"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="6" y="20.0">Operation \ Size</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="342.0" y="13.333333333333334">FheUint</text>
|
||||
@@ -12,86 +12,74 @@
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="594.0" y="29.666666666666668">64</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="678.0" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="678.0" y="29.666666666666668">128</text>
|
||||
<rect x="0" y="40" width="300" height="520" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="520" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">Negation (-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">11.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">11.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">16.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">21.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">36.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">Add / Sub (+,-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">11.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">11.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">16.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">21.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">36.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">Mul (x)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">22.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">31.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">63.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">164 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">545 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">Equal / Not Equal (eq, ne)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">7.95 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">11.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">12.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">16.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">19.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="220.0">Comparisons (ge, gt, le, lt)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">11.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">15.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">19.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">24.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">31.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="260.0">Max / Min (max, min)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">18.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">23.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">28.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">35.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">50.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="300.0">Bitwise operations (&, |, ^)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">3.54 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">3.66 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">4.24 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">4.82 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">6.43 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="340.0">Div / Rem (/, %)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">273 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">580 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">1.28 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">2.97 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">7.41 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="380.0">Left / Right Shifts (<<, >>)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">21.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">27.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">36.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">53.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">106 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="420.0">Left / Right Rotations (left_rotate, right_rotate)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">21.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">27.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">36.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">53.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">106 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="460.0">Leading / Trailing zeros/ones</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="460.0">25.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="460.0">32.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="460.0">42.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="460.0">56.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="460.0">78.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="500.0">Log2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="500.0">43.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="500.0">57.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="500.0">99.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="500.0">280 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="500.0">962 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="540.0">Select</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="540.0">7.38 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="540.0">7.98 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="540.0">9.02 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="540.0">11.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="540.0">18.6 ms</text>
|
||||
<rect x="0" y="40" width="300" height="440" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="440" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">Add / Sub (+,-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">9.65 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">11.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">16.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">23.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">47.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">Mul (x)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">20.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">34.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">76.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">254 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">900 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">Equal / Not Equal (eq, ne)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">6.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">10.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">11.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">16.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">22.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">Comparisons (ge, gt, le, lt)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">9.71 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">13.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">17.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">23.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">35.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="220.0">Max / Min (max, min)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">16.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">21.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">27.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">40.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">65.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="260.0">Bitwise operations (&, |, ^)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">3.02 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">3.53 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">4.28 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">5.79 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">10.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="300.0">Div / Rem (/, %)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">132 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">281 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">695 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">1.88 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">6.11 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="340.0">Left / Right Shifts (<<, >>)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">19.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">27.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">41.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">83.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">161 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="380.0">Left / Right Rotations (left_rotate, right_rotate)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">20.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">27.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">41.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">83.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">161 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="420.0">Log2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">36.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">54.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">100 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">341 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">1.23 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="460.0">Select</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="460.0">6.67 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="460.0">7.92 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="460.0">10.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="460.0">16.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="460.0">30.1 ms</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
@@ -104,13 +92,11 @@
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="360" x2="720" y2="360"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="400" x2="720" y2="400"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="440" x2="720" y2="440"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="480" x2="720" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="520" x2="720" y2="520"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="384.0" y1="0" x2="384.0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="468.0" y1="0" x2="468.0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="552.0" y1="0" x2="552.0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="636.0" y1="0" x2="636.0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="560"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="384.0" y1="0" x2="384.0" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="468.0" y1="0" x2="468.0" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="552.0" y1="0" x2="552.0" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="636.0" y1="0" x2="636.0" y2="480"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="480"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
@@ -15,65 +15,65 @@
|
||||
<rect x="0" y="40" width="300" height="400" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="400" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">Add / Sub (+,-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">11.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">12.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">17.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">25.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">51.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">9.65 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">11.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">16.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">23.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">47.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">Mul (x)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">18.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">26.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">46.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">109 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">330 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">15.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">23.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">44.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">107 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">344 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">Equal / Not Equal (eq, ne)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">7.81 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">8.08 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">12.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">13.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">18.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">6.72 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">7.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">10.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">11.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">17.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">Comparisons (ge, gt, le, lt)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">9.61 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">13.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">17.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">22.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">29.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">8.18 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">11.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">15.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">19.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">26.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="220.0">Max / Min (max, min)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">17.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">21.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">28.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">39.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">59.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">14.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">19.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">25.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">36.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">56.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="260.0">Bitwise operations (&, |, ^)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">3.63 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">4.11 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">4.65 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">6.03 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">11.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">3.04 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">3.51 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">4.32 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">5.77 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">10.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="300.0">Div (/)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">28.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">41.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">83.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">214 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">664 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">24.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">38.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">81.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">222 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">701 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="340.0">Rem (%)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">56.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">80.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">149 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">351 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">1.04 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">50.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">72.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">140 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">342 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">1.08 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="380.0">Left / Right Shifts (<<, >>)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">3.63 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">4.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">4.63 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">6.03 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">11.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">3.04 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">3.51 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">4.33 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">5.79 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">10.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="420.0">Left / Right Rotations (left_rotate, right_rotate)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">3.63 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">4.11 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">4.64 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">6.03 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">11.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">3.05 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">3.53 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">4.34 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">5.81 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">10.9 ms</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@@ -15,83 +15,83 @@
|
||||
<rect x="0" y="40" width="300" height="520" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="520" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">Negation (-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">11.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">12.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">17.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">25.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">51.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">9.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">9.99 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">14.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">19.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">33.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">Add / Sub (+,-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">11.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">12.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">17.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">25.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">51.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">9.52 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">10.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">14.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">19.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">33.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">Mul (x)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">23.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">37.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">76.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">237 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">830 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">19.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">28.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">59.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">166 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">556 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">Equal / Not Equal (eq, ne)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">7.65 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">11.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">12.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">17.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">24.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">6.68 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">10.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">10.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">14.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">17.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="220.0">Comparisons (ge, gt, le, lt)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">11.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">15.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">20.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">26.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">38.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">10.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">13.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">17.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">21.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">28.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="260.0">Max / Min (max, min)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">18.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">24.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">30.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">43.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">68.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">16.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">20.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">25.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">32.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">46.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="300.0">Bitwise operations (&, |, ^)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">3.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">4.01 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">4.58 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">5.97 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">11.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">3.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">3.12 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">3.59 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">4.49 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">6.04 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="340.0">Div / Rem (/, %)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">154 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">318 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">763 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">2.05 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">6.35 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">218 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">456 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">1.02 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">2.43 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">6.28 s</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="380.0">Left / Right Shifts (<<, >>)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">22.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">30.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">43.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">86.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">162 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">18.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">24.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">32.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">49.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">98.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="420.0">Left / Right Rotations (left_rotate, right_rotate)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">22.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">30.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">43.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">86.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">162 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">18.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">24.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">32.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">49.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">98.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="460.0">Leading / Trailing zeros/ones</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="460.0">25.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="460.0">33.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="460.0">44.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="460.0">62.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="460.0">105 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="460.0">21.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="460.0">27.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="460.0">36.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="460.0">51.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="460.0">93.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="500.0">Log2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="500.0">35.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="500.0">48.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="500.0">55.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="500.0">73.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="500.0">113 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="500.0">37.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="500.0">50.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="500.0">91.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="500.0">275 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="500.0">992 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="540.0">Select</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="540.0">7.76 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="540.0">8.72 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="540.0">10.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="540.0">17.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="540.0">30.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="540.0">6.21 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="540.0">6.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="540.0">8.25 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="540.0">10.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="540.0">17.8 ms</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
@@ -15,65 +15,65 @@
|
||||
<rect x="0" y="40" width="300" height="400" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="400" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">Add / Sub (+,-)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">11.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">11.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">16.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">22.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">36.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="60.0">9.58 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="60.0">10.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="60.0">14.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="60.0">19.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="60.0">33.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">Mul (x)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">18.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">24.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">41.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">93.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">271 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="100.0">15.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="100.0">21.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="100.0">38.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="100.0">89.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="100.0">273 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">Equal / Not Equal (eq, ne)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">8.26 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">8.53 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">12.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">13.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">18.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="140.0">6.99 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="140.0">7.57 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="140.0">10.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="140.0">11.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="140.0">16.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">Comparisons (ge, gt, le, lt)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">9.95 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">13.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">17.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">21.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">27.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="180.0">8.85 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="180.0">11.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="180.0">15.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="180.0">19.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="180.0">24.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="220.0">Max / Min (max, min)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">17.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">21.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">26.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">33.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">46.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="220.0">15.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="220.0">19.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="220.0">23.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="220.0">30.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="220.0">42.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="260.0">Bitwise operations (&, |, ^)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">3.64 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">3.79 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">4.36 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">4.91 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">6.54 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="260.0">3.12 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="260.0">3.24 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="260.0">3.74 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="260.0">4.63 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="260.0">6.14 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="300.0">Div (/)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">26.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">39.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">71.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">176 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">544 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="300.0">23.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="300.0">36.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="300.0">68.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="300.0">171 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="300.0">553 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="340.0">Rem (%)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">56.9 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">77.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">131 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">292 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">839 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="340.0">48.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="340.0">67.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="340.0">118 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="340.0">284 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="340.0">850 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="380.0">Left / Right Shifts (<<, >>)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">3.55 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">3.7 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">4.28 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">4.82 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">6.45 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="380.0">3.05 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="380.0">3.14 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="380.0">3.65 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="380.0">4.55 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="380.0">6.06 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="420.0">Left / Right Rotations (left_rotate, right_rotate)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">3.55 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">3.71 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">4.28 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">4.82 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">6.46 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="342.0" y="420.0">3.05 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="426.0" y="420.0">3.15 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="510.0" y="420.0">3.66 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="594.0" y="420.0">4.57 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="678.0" y="420.0">6.08 ms</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
46
tfhe/docs/_static/gpu_pbs_benchmark_tuniform_2m128.svg
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" ?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 200" preserveAspectRatio="meet" width="100%" height="200">
|
||||
<rect x="0" y="0" width="720" height="40" fill="black"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="6" y="20.0">Operation \ Precision (bits)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="29.666666666666668">2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="29.666666666666668">4</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="29.666666666666668">6</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="29.666666666666668">8</text>
|
||||
<rect x="0" y="40" width="300" height="160" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="160" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="60.0">9.98 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="60.0">13.4 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="60.0">239 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="60.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">KS - PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="100.0">10.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="100.0">13.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="100.0">241 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="100.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="140.0">2.14 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="140.0">2.5 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="140.0">13.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="140.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">KS - MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="180.0">2.28 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="180.0">2.68 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="180.0">14.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="180.0">N/A</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="120" x2="720" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="160" x2="720" y2="160"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="405.0" y1="0" x2="405.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="510.0" y1="0" x2="510.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="615.0" y1="0" x2="615.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="200"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
@@ -1,30 +1,46 @@
|
||||
<?xml version="1.0" ?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 120" preserveAspectRatio="meet" width="100%" height="120">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 200" preserveAspectRatio="meet" width="100%" height="200">
|
||||
<rect x="0" y="0" width="720" height="40" fill="black"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="6" y="20.0">Operation \ Precision (bits)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="20.0">2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="20.0">4</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="20.0">6</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="20.0">8</text>
|
||||
<rect x="0" y="40" width="300" height="80" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="80" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="60.0">3.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="60.0">4.03 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="60.0">22.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="29.666666666666668">2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="29.666666666666668">4</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="29.666666666666668">6</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="29.666666666666668">8</text>
|
||||
<rect x="0" y="40" width="300" height="160" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="160" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="60.0">6.74 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="60.0">10.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="60.0">57.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="60.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">KS - MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="100.0">3.22 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="100.0">4.02 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="100.0">22.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">KS - PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="100.0">7.13 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="100.0">11.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="100.0">57.8 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="100.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="140.0">1.75 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="140.0">2.06 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="140.0">6.34 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="140.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">KS - MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="180.0">1.84 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="180.0">2.24 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="180.0">6.93 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="180.0">N/A</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="405.0" y1="0" x2="405.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="510.0" y1="0" x2="510.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="615.0" y1="0" x2="615.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="120" x2="720" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="160" x2="720" y2="160"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="405.0" y1="0" x2="405.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="510.0" y1="0" x2="510.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="615.0" y1="0" x2="615.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="200"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -1,30 +1,46 @@
|
||||
<?xml version="1.0" ?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 120" preserveAspectRatio="meet" width="100%" height="120">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 200" preserveAspectRatio="meet" width="100%" height="200">
|
||||
<rect x="0" y="0" width="720" height="40" fill="black"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="6" y="20.0">Operation \ Precision (bits)</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="20.0">2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="20.0">4</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="20.0">6</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="20.0">8</text>
|
||||
<rect x="0" y="40" width="300" height="80" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="80" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="60.0">3.38 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="60.0">4.22 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="60.0">23.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="352.5" y="29.666666666666668">2</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="457.5" y="29.666666666666668">4</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="562.5" y="29.666666666666668">6</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="13.333333333333334">FheUint</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="bold" fill="white" x="667.5" y="29.666666666666668">8</text>
|
||||
<rect x="0" y="40" width="300" height="160" fill="#fbbc04"/>
|
||||
<rect x="300" y="40" width="420" height="160" fill="#f3f3f3"/>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="60.0">PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="60.0">8.53 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="60.0">11.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="60.0">60.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="60.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">KS - MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="100.0">3.38 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="100.0">4.22 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="100.0">23.1 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="100.0">KS - PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="100.0">8.64 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="100.0">11.6 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="100.0">61.0 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="100.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="140.0">MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="140.0">2.06 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="140.0">2.31 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="140.0">12.3 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="140.0">N/A</text>
|
||||
<text dominant-baseline="middle" text-anchor="start" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="6" y="180.0">KS - MB-PBS</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="352.5" y="180.0">2.17 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="457.5" y="180.0">2.49 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="562.5" y="180.0">13.2 ms</text>
|
||||
<text dominant-baseline="middle" text-anchor="middle" font-family="Arial" font-size="14" font-weight="normal" fill="black" x="667.5" y="180.0">N/A</text>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="720" y2="0"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="40" x2="720" y2="40"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="80" x2="720" y2="80"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="405.0" y1="0" x2="405.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="510.0" y1="0" x2="510.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="615.0" y1="0" x2="615.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="120" x2="720" y2="120"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="160" x2="720" y2="160"/>
|
||||
<line stroke="white" stroke-width="2" x1="0" y1="0" x2="0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="300.0" y1="0" x2="300.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="405.0" y1="0" x2="405.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="510.0" y1="0" x2="510.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="615.0" y1="0" x2="615.0" y2="200"/>
|
||||
<line stroke="white" stroke-width="2" x1="720.0" y1="0" x2="720.0" y2="200"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 5.7 KiB |
76
tfhe/docs/configuration/gpu_acceleration/array_type.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Array types
|
||||
This document explains how to use array types on GPU, just as [on CPU](../../fhe-computation/types/array.md).
|
||||
|
||||
Here is an example:
|
||||
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClearArray, ClientKey, CompressedServerKey};
|
||||
use tfhe::array::GpuFheUint32Array;
|
||||
use tfhe::prelude::*;
|
||||
|
||||
fn main() {
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let cks = ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&cks);
|
||||
|
||||
let gpu_key = compressed_server_key.decompress_to_gpu();
|
||||
set_server_key(gpu_key);
|
||||
|
||||
let num_elems = 4 * 4;
|
||||
let clear_xs = (0..num_elems as u32).collect::<Vec<_>>();
|
||||
let clear_ys = vec![1u32; num_elems];
|
||||
|
||||
// Encrypted 2D array with values
|
||||
// [[ 0, 1, 2, 3]
|
||||
// [ 4, 5, 6, 7]
|
||||
// [ 8, 9, 10, 11]
|
||||
// [ 12, 13, 14, 15]]
|
||||
let xs = GpuFheUint32Array::try_encrypt((clear_xs.as_slice(), vec![4, 4]), &cks).unwrap();
|
||||
// Encrypted 2D array with values
|
||||
// [[ 1, 1, 1, 1]
|
||||
// [ 1, 1, 1, 1]
|
||||
// [ 1, 1, 1, 1]
|
||||
// [ 1, 1, 1, 1]]
|
||||
let ys = GpuFheUint32Array::try_encrypt((clear_ys.as_slice(), vec![4, 4]), &cks).unwrap();
|
||||
|
||||
assert_eq!(xs.num_dim(), 2);
|
||||
assert_eq!(xs.shape(), &[4, 4]);
|
||||
assert_eq!(ys.num_dim(), 2);
|
||||
assert_eq!(ys.shape(), &[4, 4]);
|
||||
|
||||
// Take a sub slice
|
||||
// [[ 10, 11]
|
||||
// [ 14, 15]]
|
||||
let xss = xs.slice(&[2..4, 2..4]);
|
||||
// Take a sub slice
|
||||
// [[ 1, 1]
|
||||
// [ 1, 1]]
|
||||
let yss = ys.slice(&[2..4, 2..4]);
|
||||
|
||||
assert_eq!(xss.num_dim(), 2);
|
||||
assert_eq!(xss.shape(), &[2, 2]);
|
||||
assert_eq!(yss.num_dim(), 2);
|
||||
assert_eq!(yss.shape(), &[2, 2]);
|
||||
|
||||
let r = &xss + &yss;
|
||||
|
||||
// Result is
|
||||
// [[ 11, 12]
|
||||
// [ 15, 16]]
|
||||
let result: Vec<u32> = r.decrypt(&cks);
|
||||
assert_eq!(result, vec![11, 12, 15, 16]);
|
||||
|
||||
// Clear 2D array with values
|
||||
// [[ 10, 20]
|
||||
// [ 30, 40]]
|
||||
let clear_array = ClearArray::new(vec![10u32, 20u32, 30u32, 40u32], vec![2, 2]);
|
||||
let r = &xss + &clear_array;
|
||||
|
||||
// Result is
|
||||
// [[ 20, 31]
|
||||
// [ 44, 55]]
|
||||
let r: Vec<u32> = r.decrypt(&cks);
|
||||
assert_eq!(r, vec![20, 31, 44, 55]);
|
||||
}
|
||||
```
|
||||
7
tfhe/docs/configuration/gpu_acceleration/benchmark.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Benchmarks
|
||||
|
||||
Please refer to the [GPU benchmarks](../../getting_started/benchmarks/gpu/README.md) for detailed performance benchmark results.
|
||||
|
||||
{% hint style="warning" %}
|
||||
When measuring GPU times on your own on Linux, set the environment variable `CUDA_MODULE_LOADING=EAGER` to avoid CUDA API overheads during the first kernel execution.
|
||||
{% endhint %}
|
||||
@@ -0,0 +1,71 @@
|
||||
# Compressing ciphertexts
|
||||
|
||||
This document explains how to compress ciphertexts using the GPU - even after homomorphic computations - just like on the [CPU](../../fhe-computation/data-handling/compress.md#compression-ciphertexts-after-some-homomorphic-computation).
|
||||
|
||||
Compressing ciphertexts after computation using GPU is very similar to how it's done on the CPU. The following example shows how to compress and decompress a list containing 4 messages:
|
||||
|
||||
* One 32-bits integer
|
||||
* One 64-bit integer
|
||||
* One Boolean
|
||||
* One 2-bit integer
|
||||
|
||||
```rust
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::shortint::parameters::{
|
||||
COMP_PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS, PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS,
|
||||
};
|
||||
use tfhe::{
|
||||
set_server_key, CompressedCiphertextList, CompressedCiphertextListBuilder, FheBool,
|
||||
FheInt64, FheUint16, FheUint2, FheUint32,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
let config =
|
||||
tfhe::ConfigBuilder::with_custom_parameters(PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS)
|
||||
.enable_compression(COMP_PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS)
|
||||
.build();
|
||||
|
||||
let ck = tfhe::ClientKey::generate(config);
|
||||
let compressed_server_key = tfhe::CompressedServerKey::new(&ck);
|
||||
let gpu_key = compressed_server_key.decompress_to_gpu();
|
||||
|
||||
set_server_key(gpu_key);
|
||||
|
||||
let ct1 = FheUint32::encrypt(17_u32, &ck);
|
||||
|
||||
let ct2 = FheInt64::encrypt(-1i64, &ck);
|
||||
|
||||
let ct3 = FheBool::encrypt(false, &ck);
|
||||
|
||||
let ct4 = FheUint2::encrypt(3u8, &ck);
|
||||
|
||||
let compressed_list = CompressedCiphertextListBuilder::new()
|
||||
.push(ct1)
|
||||
.push(ct2)
|
||||
.push(ct3)
|
||||
.push(ct4)
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let serialized = bincode::serialize(&compressed_list).unwrap();
|
||||
|
||||
println!("Serialized size: {} bytes", serialized.len());
|
||||
|
||||
let compressed_list: CompressedCiphertextList = bincode::deserialize(&serialized).unwrap();
|
||||
|
||||
let a: FheUint32 = compressed_list.get(0).unwrap().unwrap();
|
||||
let b: FheInt64 = compressed_list.get(1).unwrap().unwrap();
|
||||
let c: FheBool = compressed_list.get(2).unwrap().unwrap();
|
||||
let d: FheUint2 = compressed_list.get(3).unwrap().unwrap();
|
||||
|
||||
let a: u32 = a.decrypt(&ck);
|
||||
assert_eq!(a, 17);
|
||||
let b: i64 = b.decrypt(&ck);
|
||||
assert_eq!(b, -1);
|
||||
let c = c.decrypt(&ck);
|
||||
assert!(!c);
|
||||
let d: u8 = d.decrypt(&ck);
|
||||
assert_eq!(d, 3);
|
||||
|
||||
}
|
||||
```
|
||||
39
tfhe/docs/configuration/gpu_acceleration/gpu_operations.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# 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 | `-` | :heavy\_check\_mark: | N/A |
|
||||
| Add | `+` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Sub | `-` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Mul | `*` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Div | `/` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Rem | `%` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Not | `!` | :heavy\_check\_mark: | N/A |
|
||||
| BitAnd | `&` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| BitOr | `\|` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| BitXor | `^` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Shr | `>>` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Shl | `<<` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Rotate right | `rotate_right` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Rotate left | `rotate_left` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Min | `min` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Max | `max` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Greater than | `gt` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Greater or equal than | `ge` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Lower than | `lt` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Lower or equal than | `le` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Equal | `eq` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Not Equal | `ne` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Cast (into dest type) | `cast_into` | :heavy\_check\_mark: | N/A |
|
||||
| Cast (from src type) | `cast_from` | :heavy\_check\_mark: | N/A |
|
||||
| Ternary operator | `select` | :heavy\_check\_mark: | :heavy\_multiplication\_x: |
|
||||
| Integer logarithm | `ilog2` | :heavy\_check\_mark: | N/A |
|
||||
| Count trailing/leading zeros/ones | `count_leading_zeros` | :heavy\_check\_mark: | N/A |
|
||||
| Oblivious Pseudo Random Generation | `oprf` | :heavy\_check\_mark: | N/A |
|
||||
|
||||
{% hint style="info" %}
|
||||
All operations follow the same syntax as the one described in [here](../../fhe-computation/operations/README.md).
|
||||
{% endhint %}
|
||||
227
tfhe/docs/configuration/gpu_acceleration/multi_gpu.md
Normal file
@@ -0,0 +1,227 @@
|
||||
# Multi-GPU support
|
||||
This guide explains the multi GPU support of TFHE-rs, and walks through a practical example of performing a large batch of encrypted 64-bit additions using manual GPU
|
||||
dispatching to improve the performance.
|
||||
|
||||
## Multi-GPU support overview
|
||||
|
||||
TFHE-rs supports platforms with multiple GPUs. There is **nothing to change in the code to execute on such platforms**. To keep the API as user-friendly as possible, the configuration is automatically set, i.e., the user has no fine-grained control over the number of GPUs to be used.
|
||||
However, you can decide to have operations be executed on a single GPU of your choice.
|
||||
In many cases this provides better throughput than using all the available GPUs to perform the operation.
|
||||
Indeed, except for integer precisions above 64 bits and for the multiplication, which involves many bootstrap computations in parallel, most operations on up to 64 bits do not necessitate the full power of a GPU.
|
||||
You will then be able to maximize throughput on multiple GPUs with TFHE-rs.
|
||||
|
||||
## Improving throughput on multiple-GPUs
|
||||
|
||||
By default, when multiple GPUs are available on the machine, TFHE-rs automatically uses them all
|
||||
to perform encrypted operations. Under the hood, it includes a hard-coded logic to dispatch work across all the GPUs and to copy essential data—like the server key—to each GPU.
|
||||
This approach is efficient for operations that load the GPU extensively (e.g. the 64-bit multiplication),
|
||||
but not so much for smaller operations like the encrypted addition or comparison on 64-bits.
|
||||
To address this, TFHE-rs also provides a mechanism to manually select which GPU to operate on.
|
||||
|
||||
### Dispatch operations on the GPUs of your choice
|
||||
|
||||
When selecting a specific GPU to execute on, there are two essential requirements that are different from a default GPU execution:
|
||||
- You must create a GPU server key on each GPU individually.
|
||||
- The batch of operations must be distributed on all the GPUs manually.
|
||||
|
||||
#### Step 1: Decompress the server key to each GPU
|
||||
Instead of a single server key being used across all GPUs automatically, you’ll need specifically decompress the server key to each GPU, so that the key is available in memory.
|
||||
For example, by default, the GPU server key is decompressed and loaded onto all available GPUs automatically as follows:
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey};
|
||||
use tfhe::prelude::*;
|
||||
use rayon::prelude::*;
|
||||
fn main() {
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key = ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let sks = compressed_server_key.decompress_to_gpu();
|
||||
}
|
||||
```
|
||||
|
||||
However, to use the multi-GPU selection feature, you can create a vector of server keys, each on a specific GPU:
|
||||
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey, GpuIndex};
|
||||
use tfhe::prelude::*;
|
||||
use rayon::prelude::*;
|
||||
use tfhe::core_crypto::gpu::get_number_of_gpus;
|
||||
fn main() {
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key = ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let num_gpus = get_number_of_gpus();
|
||||
let sks_vec = (0..num_gpus)
|
||||
.map(|i| compressed_server_key.decompress_to_specific_gpu(GpuIndex::new(i)))
|
||||
.collect::<Vec<_>>();
|
||||
}
|
||||
```
|
||||
#### Step 2: Define the inputs to operate on
|
||||
We will be doing 100 additions in parallel on each GPU:
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey, FheUint64, GpuIndex};
|
||||
use tfhe::prelude::*;
|
||||
use rayon::prelude::*;
|
||||
use tfhe::core_crypto::gpu::get_number_of_gpus;
|
||||
use rand::{thread_rng, Rng};
|
||||
fn main() {
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key = ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let num_gpus = get_number_of_gpus();
|
||||
let sks_vec = (0..num_gpus)
|
||||
.map(|i| compressed_server_key.decompress_to_specific_gpu(GpuIndex::new(i)))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let batch_size = num_gpus * 100;
|
||||
|
||||
let mut rng = thread_rng();
|
||||
let left_inputs = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
let right_inputs = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
}
|
||||
```
|
||||
At this stage, the left and right inputs reside on the CPU. They have not yet been copied to the GPU.
|
||||
|
||||
#### Step3: Dispatch the workloads
|
||||
Now you need to split the calculation into as many chunks as there are GPUs.
|
||||
TFHE-rs allows you to execute additions in parallel across multiple GPUs by leveraging [CUDA streams](https://developer.nvidia.com/blog/gpu-pro-tip-cuda-7-streams-simplify-concurrency/).
|
||||
CUDA stream management is not explicit in the High-Level(HL) API of TFHE-rs: streams are implicitly
|
||||
created through calls to `set_server_key` in a CPU thread.
|
||||
As a result, when you use `.par_iter()` on encrypted data within the HL API, and that computation is dispatched to a GPU, it behaves as expected—executing in parallel using CUDA streams.
|
||||
We’ll take advantage of this behavior to maximize throughput on a multi-GPU machine. In the following example, we split a large batch of encrypted 64-bit additions across multiple GPUs. Each GPU processes its own chunk of data in parallel, thanks to the creation of CUDA streams under the hood:
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey, FheUint64, GpuIndex};
|
||||
use tfhe::prelude::*;
|
||||
use rayon::prelude::*;
|
||||
use tfhe::core_crypto::gpu::get_number_of_gpus;
|
||||
use rand::{thread_rng, Rng};
|
||||
fn main() {
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key = ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let num_gpus = get_number_of_gpus();
|
||||
let sks_vec = (0..num_gpus)
|
||||
.map(|i| compressed_server_key.decompress_to_specific_gpu(GpuIndex::new(i)))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let batch_size = num_gpus * 100;
|
||||
|
||||
let mut rng = thread_rng();
|
||||
let left_inputs = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
let right_inputs = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let chunk_size = (batch_size / num_gpus) as usize;
|
||||
left_inputs
|
||||
.par_chunks(chunk_size)
|
||||
.zip(
|
||||
right_inputs
|
||||
.par_chunks(chunk_size)
|
||||
)
|
||||
.enumerate()
|
||||
.for_each(
|
||||
|(i, (left_inputs_on_gpu_i, right_inputs_on_gpu_i))| {
|
||||
left_inputs_on_gpu_i
|
||||
.par_iter()
|
||||
.zip(right_inputs_on_gpu_i.par_iter())
|
||||
.for_each(|(left_input, right_input)| {
|
||||
set_server_key(sks_vec[i].clone());
|
||||
let _ = left_input + right_input;
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
```
|
||||
In this example, `par_chunks` divides the input vectors into `num_gpus` chunks—one per GPU. Each chunk is then processed in parallel using `.par_iter()`. Inside the inner loop, calling `set_server_key(sks_vec[i].clone())` sets the context for the GPU `i` and implicitly creates a new CUDA stream for GPU `i`. This enables parallel execution on each device.
|
||||
It’s important to note that, in this example, when using the `+` operator on encrypted inputs, data is first transferred from the CPU to the GPU before computation, the result then resides on the GPU `i`.
|
||||
You can learn more about how to inspect on which GPU a piece of data resides from the examples in this file: `tfhe/src/high_level_api/tests/gpu_selection.rs`.
|
||||
|
||||
### Going beyond: Restrict the number of CUDA streams
|
||||
|
||||
While the behavior of `.par_iter()` in TFHE-rs' HL API aligns with expectations and provides parallelism over encrypted data, it can become a performance bottleneck in some cases. This is due to the way CUDA streams are managed.
|
||||
CUDA streams allow for parallel execution on the GPU, but when too many are created, scheduling becomes inefficient. Instead of running in parallel, operations may fall back to sequential execution. In practice, having more than 10 streams already starts to negatively impact throughput.
|
||||
To address this, we can limit the number of streams used per GPU. The optimal number depends on the type of operation, but the general rule is: use as few streams as possible while still fully utilizing the GPU.
|
||||
For example, in the case of 64-bit encrypted additions, using 4 streams per GPU offers a good balance. Each GPU processes inputs in chunks of 4 operations in parallel, repeating this in batches until all inputs are handled.
|
||||
Here’s how this approach looks in code:
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClientKey, CompressedServerKey, FheUint64, GpuIndex};
|
||||
use tfhe::prelude::*;
|
||||
use rayon::prelude::*;
|
||||
use tfhe::core_crypto::gpu::get_number_of_gpus;
|
||||
use rand::{thread_rng, Rng};
|
||||
|
||||
fn main() {
|
||||
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key= ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let num_gpus = get_number_of_gpus();
|
||||
let sks_vec = (0..num_gpus)
|
||||
.map(|i| compressed_server_key.decompress_to_specific_gpu(GpuIndex::new(i)))
|
||||
.collect::<Vec<_>>();
|
||||
let batch_size = num_gpus * 100;
|
||||
|
||||
let mut rng = thread_rng();
|
||||
let left_inputs = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
let right_inputs = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
let amounts = (0..batch_size)
|
||||
.map(|_| FheUint64::encrypt(rng.gen::<u64>(), &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let chunk_size = (batch_size / num_gpus) as usize;
|
||||
let num_streams_per_gpu = 4;
|
||||
left_inputs
|
||||
.par_chunks(chunk_size)
|
||||
.zip(
|
||||
right_inputs
|
||||
.par_chunks(chunk_size)
|
||||
.zip(amounts.par_chunks(chunk_size)),
|
||||
)
|
||||
.enumerate()
|
||||
.for_each(
|
||||
|(i, (left_inputs_gpu_i, (right_inputs_gpu_i, amount_gpu_i)))| {
|
||||
let stream_chunk_size = left_inputs_gpu_i.len() / num_streams_per_gpu;
|
||||
left_inputs_gpu_i
|
||||
.par_chunks(stream_chunk_size)
|
||||
.zip(right_inputs_gpu_i.par_chunks(stream_chunk_size))
|
||||
.zip(amount_gpu_i.par_chunks(stream_chunk_size))
|
||||
.for_each(
|
||||
|((left_inputs_chunk, right_inputs_chunk), amount_chunk)| {
|
||||
set_server_key(sks_vec[i].clone());
|
||||
left_inputs_chunk
|
||||
.iter()
|
||||
.zip(right_inputs_chunk.iter().zip(amount_chunk.iter()))
|
||||
.for_each(|(left_input, (right_input, amount))| {
|
||||
let _ = left_input + right_input;
|
||||
});
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
```
|
||||
In this version, we:
|
||||
- Define a number of streams per GPU
|
||||
- Split the load between the streams by calling `par_chunks()` on the batch assigned to each GPU.
|
||||
This method provides a more fine-controlled form of parallelism, reaching an optimal performance on multiple GPUs with TFHE-rs.
|
||||
124
tfhe/docs/configuration/gpu_acceleration/run_on_gpu.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# GPU acceleration
|
||||
|
||||
This guide explains how to update your existing program to leverage GPU acceleration, or to start a new program using GPU.
|
||||
|
||||
**TFHE-rs** now supports a GPU backend with CUDA implementation, enabling integer arithmetic operations on encrypted data.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Cuda version >= 10
|
||||
* Compute Capability >= 3.0
|
||||
* [gcc](https://gcc.gnu.org/) >= 8.0 - check this [page](https://gist.github.com/ax3l/9489132) for more details about nvcc/gcc compatible versions
|
||||
* [cmake](https://cmake.org/) >= 3.24
|
||||
* libclang, to match Rust bingen [requirements](https://rust-lang.github.io/rust-bindgen/requirements.html) >= 9.0
|
||||
* Rust version - check this [page](../rust_configuration.md)
|
||||
|
||||
## Importing to your project
|
||||
|
||||
To use the **TFHE-rs** GPU backend in your project, add the following dependency in your `Cargo.toml`.
|
||||
|
||||
```toml
|
||||
tfhe = { version = "~1.1.3", features = ["boolean", "shortint", "integer", "gpu"] }
|
||||
```
|
||||
|
||||
{% hint style="success" %}
|
||||
For optimal performance when using **TFHE-rs**, run your code in release mode with the `--release` flag.
|
||||
{% endhint %}
|
||||
|
||||
### Supported platforms
|
||||
|
||||
**TFHE-rs** GPU backend is supported on Linux (x86, aarch64).
|
||||
|
||||
| OS | x86 | aarch64 |
|
||||
| ------- | ----------- | ------------- |
|
||||
| Linux | Supported | Supported\* |
|
||||
| macOS | Unsupported | Unsupported\* |
|
||||
| Windows | Unsupported | Unsupported |
|
||||
|
||||
## A first example
|
||||
|
||||
### Configuring and creating keys.
|
||||
|
||||
Comparing to the [CPU example](../../getting_started/quick_start.md), GPU set up differs in the key creation, as detailed [here](run\_on\_gpu.md#setting-the-keys)
|
||||
|
||||
Here is a full example (combining the client and server parts):
|
||||
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, FheUint8, ClientKey, CompressedServerKey};
|
||||
use tfhe::prelude::*;
|
||||
|
||||
fn main() {
|
||||
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key= ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let gpu_key = compressed_server_key.decompress_to_gpu();
|
||||
|
||||
let clear_a = 27u8;
|
||||
let clear_b = 128u8;
|
||||
|
||||
let a = FheUint8::encrypt(clear_a, &client_key);
|
||||
let b = FheUint8::encrypt(clear_b, &client_key);
|
||||
|
||||
//Server-side
|
||||
|
||||
set_server_key(gpu_key);
|
||||
let result = a + b;
|
||||
|
||||
//Client-side
|
||||
let decrypted_result: u8 = result.decrypt(&client_key);
|
||||
|
||||
let clear_result = clear_a + clear_b;
|
||||
|
||||
assert_eq!(decrypted_result, clear_result);
|
||||
}
|
||||
```
|
||||
|
||||
Beware that when the GPU feature is activated, when calling: `let config = ConfigBuilder::default().build();`, the cryptographic parameters differ from the CPU ones, used when the GPU feature is not activated. Indeed, TFHE-rs uses dedicated parameters for the GPU in order to achieve better performance.
|
||||
|
||||
### Setting the keys
|
||||
|
||||
The configuration of the key is different from the CPU. More precisely, if both client and server keys are still generated by the client (which is assumed to run on a CPU), the server key has then to be decompressed by the server to be converted into the right format. To do so, the server should run this function: `decompressed_to_gpu()`.
|
||||
|
||||
Once decompressed, the operations between CPU and GPU are identical.
|
||||
|
||||
### Encryption
|
||||
|
||||
On the client-side, the method to encrypt the data is exactly the same than the CPU one, as shown in the following example:
|
||||
|
||||
```Rust
|
||||
let clear_a = 27u8;
|
||||
let clear_b = 128u8;
|
||||
|
||||
let a = FheUint8::encrypt(clear_a, &client_key);
|
||||
let b = FheUint8::encrypt(clear_b, &client_key);
|
||||
```
|
||||
|
||||
### Computation
|
||||
|
||||
The server first need to set up its keys with `set_server_key(gpu_key)`.
|
||||
|
||||
Then, homomorphic computations are performed using the same approach as the [CPU operations](../../fhe-computation/operations/README.md).
|
||||
|
||||
```Rust
|
||||
//Server-side
|
||||
set_server_key(gpu_key);
|
||||
let result = a + b;
|
||||
|
||||
//Client-side
|
||||
let decrypted_result: u8 = result.decrypt(&client_key);
|
||||
|
||||
let clear_result = clear_a + clear_b;
|
||||
|
||||
assert_eq!(decrypted_result, clear_result);
|
||||
```
|
||||
|
||||
### Decryption
|
||||
|
||||
Finally, the client decrypts the results using:
|
||||
|
||||
```Rust
|
||||
let decrypted_result: u8 = result.decrypt(&client_key);
|
||||
```
|
||||
@@ -1,319 +0,0 @@
|
||||
# GPU acceleration
|
||||
|
||||
This guide explains how to update your existing program to leverage GPU acceleration, or to start a new program using GPU.
|
||||
|
||||
**TFHE-rs** now supports a GPU backend with CUDA implementation, enabling integer arithmetic operations on encrypted data.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* Cuda version >= 10
|
||||
* Compute Capability >= 3.0
|
||||
* [gcc](https://gcc.gnu.org/) >= 8.0 - check this [page](https://gist.github.com/ax3l/9489132) for more details about nvcc/gcc compatible versions
|
||||
* [cmake](https://cmake.org/) >= 3.24
|
||||
* libclang, to match Rust bingen [requirements](https://rust-lang.github.io/rust-bindgen/requirements.html) >= 9.0
|
||||
* Rust version - check this [page](rust_configuration.md)
|
||||
|
||||
## Importing to your project
|
||||
|
||||
To use the **TFHE-rs** GPU backend in your project, add the following dependency in your `Cargo.toml`.
|
||||
|
||||
```toml
|
||||
tfhe = { version = "~1.1.0", features = ["boolean", "shortint", "integer", "gpu"] }
|
||||
```
|
||||
|
||||
{% hint style="success" %}
|
||||
For optimal performance when using **TFHE-rs**, run your code in release mode with the `--release` flag.
|
||||
{% endhint %}
|
||||
|
||||
### Supported platforms
|
||||
|
||||
**TFHE-rs** GPU backend is supported on Linux (x86, aarch64).
|
||||
|
||||
| OS | x86 | aarch64 |
|
||||
| ------- | ----------- | ------------- |
|
||||
| Linux | Supported | Supported\* |
|
||||
| macOS | Unsupported | Unsupported\* |
|
||||
| Windows | Unsupported | Unsupported |
|
||||
|
||||
## A first example
|
||||
|
||||
### Configuring and creating keys.
|
||||
|
||||
Comparing to the [CPU example](../getting_started/quick_start.md), GPU set up differs in the key creation, as detailed [here](run\_on\_gpu.md#setting-the-keys)
|
||||
|
||||
Here is a full example (combining the client and server parts):
|
||||
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, FheUint8, ClientKey, CompressedServerKey};
|
||||
use tfhe::prelude::*;
|
||||
|
||||
fn main() {
|
||||
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let client_key= ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&client_key);
|
||||
|
||||
let gpu_key = compressed_server_key.decompress_to_gpu();
|
||||
|
||||
let clear_a = 27u8;
|
||||
let clear_b = 128u8;
|
||||
|
||||
let a = FheUint8::encrypt(clear_a, &client_key);
|
||||
let b = FheUint8::encrypt(clear_b, &client_key);
|
||||
|
||||
//Server-side
|
||||
|
||||
set_server_key(gpu_key);
|
||||
let result = a + b;
|
||||
|
||||
//Client-side
|
||||
let decrypted_result: u8 = result.decrypt(&client_key);
|
||||
|
||||
let clear_result = clear_a + clear_b;
|
||||
|
||||
assert_eq!(decrypted_result, clear_result);
|
||||
}
|
||||
```
|
||||
|
||||
Beware that when the GPU feature is activated, when calling: `let config = ConfigBuilder::default().build();`, the cryptographic parameters differ from the CPU ones, used when the GPU feature is not activated. Indeed, TFHE-rs uses dedicated parameters for the GPU in order to achieve better performance.
|
||||
|
||||
### Setting the keys
|
||||
|
||||
The configuration of the key is different from the CPU. More precisely, if both client and server keys are still generated by the client (which is assumed to run on a CPU), the server key has then to be decompressed by the server to be converted into the right format. To do so, the server should run this function: `decompressed_to_gpu()`.
|
||||
|
||||
Once decompressed, the operations between CPU and GPU are identical.
|
||||
|
||||
### Encryption
|
||||
|
||||
On the client-side, the method to encrypt the data is exactly the same than the CPU one, as shown in the following example:
|
||||
|
||||
```Rust
|
||||
let clear_a = 27u8;
|
||||
let clear_b = 128u8;
|
||||
|
||||
let a = FheUint8::encrypt(clear_a, &client_key);
|
||||
let b = FheUint8::encrypt(clear_b, &client_key);
|
||||
```
|
||||
|
||||
### Computation
|
||||
|
||||
The server first need to set up its keys with `set_server_key(gpu_key)`.
|
||||
|
||||
Then, homomorphic computations are performed using the same approach as the [CPU operations](../fhe-computation/operations/README.md).
|
||||
|
||||
```Rust
|
||||
//Server-side
|
||||
set_server_key(gpu_key);
|
||||
let result = a + b;
|
||||
|
||||
//Client-side
|
||||
let decrypted_result: u8 = result.decrypt(&client_key);
|
||||
|
||||
let clear_result = clear_a + clear_b;
|
||||
|
||||
assert_eq!(decrypted_result, clear_result);
|
||||
```
|
||||
|
||||
### Decryption
|
||||
|
||||
Finally, the client decrypts the results using:
|
||||
|
||||
```Rust
|
||||
let decrypted_result: u8 = result.decrypt(&client_key);
|
||||
```
|
||||
|
||||
## List of available operations
|
||||
|
||||
The GPU backend includes the following operations for both signed and unsigned encrypted integers:
|
||||
|
||||
| name | symbol | `Enc`/`Enc` | `Enc`/ `Int` |
|
||||
| --------------------- | -------------- | -------------------------- | -------------------------- |
|
||||
| Neg | `-` | :heavy\_check\_mark: | N/A |
|
||||
| Add | `+` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Sub | `-` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Mul | `*` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Div | `/` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Rem | `%` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Not | `!` | :heavy\_check\_mark: | N/A |
|
||||
| BitAnd | `&` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| BitOr | `\|` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| BitXor | `^` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Shr | `>>` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Shl | `<<` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Rotate right | `rotate_right` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Rotate left | `rotate_left` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Min | `min` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Max | `max` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Greater than | `gt` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Greater or equal than | `ge` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Lower than | `lt` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Lower or equal than | `le` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Equal | `eq` | :heavy\_check\_mark: | :heavy\_check\_mark: |
|
||||
| Cast (into dest type) | `cast_into` | :heavy\_multiplication\_x: | N/A |
|
||||
| Cast (from src type) | `cast_from` | :heavy\_multiplication\_x: | N/A |
|
||||
| Ternary operator | `select` | :heavy\_check\_mark: | :heavy\_multiplication\_x: |
|
||||
|
||||
{% hint style="info" %}
|
||||
All operations follow the same syntax than the one described in [here](../fhe-computation/operations/README.md).
|
||||
{% endhint %}
|
||||
|
||||
## Multi-GPU support
|
||||
|
||||
TFHE-rs supports platforms with multiple GPUs. There is **nothing to change in the code to execute on such platforms**. To keep the API as user-friendly as possible, the configuration is automatically set, i.e., the user has no fine-grained control over the number of GPUs to be used.
|
||||
|
||||
## Benchmark
|
||||
|
||||
Please refer to the [GPU benchmarks](../getting_started/benchmarks/gpu/README.md) for detailed performance benchmark results.
|
||||
|
||||
## Warning
|
||||
|
||||
When measuring GPU times on your own on Linux, set the environment variable `CUDA_MODULE_LOADING=EAGER` to avoid CUDA API overheads during the first kernel execution.
|
||||
|
||||
## Compressing ciphertexts after some homomorphic computation on the GPU
|
||||
|
||||
You can compress ciphertexts using the GPU, even after computations, just like on the [CPU](../fhe-computation/data-handling/compress.md#compression-ciphertexts-after-some-homomorphic-computation).
|
||||
|
||||
The way to do it is very similar to how it's done on the CPU. The following example shows how to compress and decompress a list containing 4 messages:
|
||||
|
||||
* One 32-bits integer
|
||||
* One 64-bit integer
|
||||
* One Boolean
|
||||
* One 2-bit integer
|
||||
|
||||
```rust
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::shortint::parameters::{
|
||||
COMP_PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS, PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS,
|
||||
};
|
||||
use tfhe::{
|
||||
set_server_key, CompressedCiphertextList, CompressedCiphertextListBuilder, FheBool,
|
||||
FheInt64, FheUint16, FheUint2, FheUint32,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
let config =
|
||||
tfhe::ConfigBuilder::with_custom_parameters(PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS)
|
||||
.enable_compression(COMP_PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS)
|
||||
.build();
|
||||
|
||||
let ck = tfhe::ClientKey::generate(config);
|
||||
let compressed_server_key = tfhe::CompressedServerKey::new(&ck);
|
||||
let gpu_key = compressed_server_key.decompress_to_gpu();
|
||||
|
||||
set_server_key(gpu_key);
|
||||
|
||||
let ct1 = FheUint32::encrypt(17_u32, &ck);
|
||||
|
||||
let ct2 = FheInt64::encrypt(-1i64, &ck);
|
||||
|
||||
let ct3 = FheBool::encrypt(false, &ck);
|
||||
|
||||
let ct4 = FheUint2::encrypt(3u8, &ck);
|
||||
|
||||
let compressed_list = CompressedCiphertextListBuilder::new()
|
||||
.push(ct1)
|
||||
.push(ct2)
|
||||
.push(ct3)
|
||||
.push(ct4)
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let serialized = bincode::serialize(&compressed_list).unwrap();
|
||||
|
||||
println!("Serialized size: {} bytes", serialized.len());
|
||||
|
||||
let compressed_list: CompressedCiphertextList = bincode::deserialize(&serialized).unwrap();
|
||||
|
||||
let a: FheUint32 = compressed_list.get(0).unwrap().unwrap();
|
||||
let b: FheInt64 = compressed_list.get(1).unwrap().unwrap();
|
||||
let c: FheBool = compressed_list.get(2).unwrap().unwrap();
|
||||
let d: FheUint2 = compressed_list.get(3).unwrap().unwrap();
|
||||
|
||||
let a: u32 = a.decrypt(&ck);
|
||||
assert_eq!(a, 17);
|
||||
let b: i64 = b.decrypt(&ck);
|
||||
assert_eq!(b, -1);
|
||||
let c = c.decrypt(&ck);
|
||||
assert!(!c);
|
||||
let d: u8 = d.decrypt(&ck);
|
||||
assert_eq!(d, 3);
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
## Array types
|
||||
|
||||
It is possible to use array types on GPU, just as [on CPU](../fhe-computation/types/array.md). Here is an example showing how to do it:
|
||||
|
||||
```rust
|
||||
use tfhe::{ConfigBuilder, set_server_key, ClearArray, ClientKey, CompressedServerKey};
|
||||
use tfhe::array::GpuFheUint32Array;
|
||||
use tfhe::prelude::*;
|
||||
|
||||
fn main() {
|
||||
let config = ConfigBuilder::default().build();
|
||||
|
||||
let cks = ClientKey::generate(config);
|
||||
let compressed_server_key = CompressedServerKey::new(&cks);
|
||||
|
||||
let gpu_key = compressed_server_key.decompress_to_gpu();
|
||||
set_server_key(gpu_key);
|
||||
|
||||
let num_elems = 4 * 4;
|
||||
let clear_xs = (0..num_elems as u32).collect::<Vec<_>>();
|
||||
let clear_ys = vec![1u32; num_elems];
|
||||
|
||||
// Encrypted 2D array with values
|
||||
// [[ 0, 1, 2, 3]
|
||||
// [ 4, 5, 6, 7]
|
||||
// [ 8, 9, 10, 11]
|
||||
// [ 12, 13, 14, 15]]
|
||||
let xs = GpuFheUint32Array::try_encrypt((clear_xs.as_slice(), vec![4, 4]), &cks).unwrap();
|
||||
// Encrypted 2D array with values
|
||||
// [[ 1, 1, 1, 1]
|
||||
// [ 1, 1, 1, 1]
|
||||
// [ 1, 1, 1, 1]
|
||||
// [ 1, 1, 1, 1]]
|
||||
let ys = GpuFheUint32Array::try_encrypt((clear_ys.as_slice(), vec![4, 4]), &cks).unwrap();
|
||||
|
||||
assert_eq!(xs.num_dim(), 2);
|
||||
assert_eq!(xs.shape(), &[4, 4]);
|
||||
assert_eq!(ys.num_dim(), 2);
|
||||
assert_eq!(ys.shape(), &[4, 4]);
|
||||
|
||||
// Take a sub slice
|
||||
// [[ 10, 11]
|
||||
// [ 14, 15]]
|
||||
let xss = xs.slice(&[2..4, 2..4]);
|
||||
// Take a sub slice
|
||||
// [[ 1, 1]
|
||||
// [ 1, 1]]
|
||||
let yss = ys.slice(&[2..4, 2..4]);
|
||||
|
||||
assert_eq!(xss.num_dim(), 2);
|
||||
assert_eq!(xss.shape(), &[2, 2]);
|
||||
assert_eq!(yss.num_dim(), 2);
|
||||
assert_eq!(yss.shape(), &[2, 2]);
|
||||
|
||||
let r = &xss + &yss;
|
||||
|
||||
// Result is
|
||||
// [[ 11, 12]
|
||||
// [ 15, 16]]
|
||||
let result: Vec<u32> = r.decrypt(&cks);
|
||||
assert_eq!(result, vec![11, 12, 15, 16]);
|
||||
|
||||
// Clear 2D array with values
|
||||
// [[ 10, 20]
|
||||
// [ 30, 40]]
|
||||
let clear_array = ClearArray::new(vec![10u32, 20u32, 30u32, 40u32], vec![2, 2]);
|
||||
let r = &xss + &clear_array;
|
||||
|
||||
// Result is
|
||||
// [[ 20, 31]
|
||||
// [ 44, 55]]
|
||||
let r: Vec<u32> = r.decrypt(&cks);
|
||||
assert_eq!(r, vec![20, 31, 44, 55]);
|
||||
}
|
||||
```
|
||||
@@ -16,7 +16,7 @@ You can load serialized data with the `unversionize` function, even in newer ver
|
||||
|
||||
[dependencies]
|
||||
# ...
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
tfhe-versionable = "0.5.0"
|
||||
bincode = "1.3.3"
|
||||
```
|
||||
|
||||
@@ -161,7 +161,7 @@ In the following example, we use [bincode](https://crates.io/crates/bincode) for
|
||||
|
||||
[dependencies]
|
||||
# ...
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
bincode = "1.3.3"
|
||||
```
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Homomorphic integer types (`FheUint` and `FheInt`) support the following arithme
|
||||
Specifications for operations with zero:
|
||||
|
||||
* **Division by zero**: returns modulus - 1.
|
||||
* Example: for FheUint8 (modulus = $$2^8=256$$), dividing by zero returns an ecryption of 255.
|
||||
* Example: for FheUint8 (modulus = $$2^8=256$$), dividing by zero returns an encryption of 255.
|
||||
* **Remainder operator**: returns the first input unchanged.
|
||||
* Example: if `ct1 = FheUint8(63)` and `ct2 = FheUint8(0)`, then ct1 % ct2 returns FheUint8(63).
|
||||
|
||||
|
||||
37
tfhe/docs/fhe-computation/operations/dot-product.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Dot Product
|
||||
|
||||
This document details the dot product operations supported by **TFHE-rs**.
|
||||
|
||||
|
||||
| name | symbol | type |
|
||||
|---------------|----------------| ------ |
|
||||
| Dot Product | `dot_product` | Binary |
|
||||
|
||||
|
||||
Currently, the dot product supports the following case:
|
||||
- One operand is a slice of `FheBool`
|
||||
- The other operand is a slice of clear values (e.g., `u64`)
|
||||
- Both slices must be of the same length
|
||||
|
||||
The following example shows how to perform dot product:
|
||||
|
||||
```rust
|
||||
use tfhe::prelude::*;
|
||||
use tfhe::{generate_keys, set_server_key, ConfigBuilder, FheBool, FheUint8};
|
||||
|
||||
fn main() {
|
||||
let (client_key, server_key) = generate_keys(ConfigBuilder::default());
|
||||
set_server_key(server_key);
|
||||
|
||||
let a = [true, false, true]
|
||||
.into_iter()
|
||||
.map(|b| FheBool::encrypt(b, &client_key))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let b = [2u8, 3u8, 4u8];
|
||||
|
||||
let result = FheUint8::dot_product(&a, &b);
|
||||
let decrypted: u8 = result.decrypt(&client_key);
|
||||
assert_eq!(decrypted, 6u8);
|
||||
}
|
||||
```
|
||||
@@ -49,6 +49,21 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let clear_res: i32 = encrypted_res.decrypt(&client_key);
|
||||
assert_eq!(clear_res, clear_a);
|
||||
|
||||
// Ternary conditional also supports operands that are in clear (except for the condition)
|
||||
// with the `scalar` prefix
|
||||
let encrypted_res = &encrypted_comp.scalar_select(&encrypted_a, clear_b);
|
||||
let clear_res: i32 = encrypted_res.decrypt(&client_key);
|
||||
assert_eq!(clear_res, clear_a);
|
||||
|
||||
let encrypted_res = &encrypted_comp.scalar_select(clear_a, &encrypted_b);
|
||||
let clear_res: i32 = encrypted_res.decrypt(&client_key);
|
||||
assert_eq!(clear_res, clear_a);
|
||||
|
||||
// When both possible results are in clear the form to be used is
|
||||
let encrypted_res = FheInt32::select(encrypted_comp, clear_a, clear_b);
|
||||
let clear_res: i32 = encrypted_res.decrypt(&client_key);
|
||||
assert_eq!(clear_res, clear_a);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
@@ -19,7 +19,7 @@ The following example shows a complete workflow of working with encrypted arrays
|
||||
# Cargo.toml
|
||||
|
||||
[dependencies]
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
```
|
||||
|
||||
```rust
|
||||
|
||||
@@ -29,7 +29,7 @@ Here is an example:
|
||||
# Cargo.toml
|
||||
|
||||
[dependencies]
|
||||
tfhe = { version = "~1.1.0", features = ["integer", "strings"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer", "strings"] }
|
||||
```
|
||||
|
||||
```rust
|
||||
|
||||
@@ -12,4 +12,8 @@ make print_doc_bench_parameters
|
||||
|
||||
### Operation time over FheUint 64
|
||||
|
||||
{% hint style="info" %}
|
||||
All CPU benchmarks in the Table below were launched on an `AWS hpc7a.96xlarge` instance equipped with a 96-core `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM, while all GPU benchmarks were launched on 1xH100 GPU, and rely on the multithreaded PBS algorithm.
|
||||
{% endhint %}
|
||||
|
||||

|
||||
|
||||
@@ -5,7 +5,7 @@ This document details the CPU performance benchmarks of homomorphic operations u
|
||||
By their nature, homomorphic operations run slower than their cleartext equivalents.
|
||||
|
||||
{% hint style="info" %}
|
||||
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with an `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
|
||||
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with a 96-core `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
|
||||
{% endhint %}
|
||||
|
||||
* [Integer operations](cpu_integer_operations.md)
|
||||
|
||||
@@ -5,7 +5,7 @@ This document details the CPU performance benchmarks of homomorphic operations o
|
||||
By their nature, homomorphic operations run slower than their cleartext equivalents.
|
||||
|
||||
{% hint style="info" %}
|
||||
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with an `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
|
||||
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with a 96-core `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
|
||||
{% endhint %}
|
||||
|
||||
The following tables benchmark the execution time of some operation sets using `FheUint` (unsigned integers). The `FheInt` (signed integers) performs similarly.
|
||||
@@ -32,7 +32,7 @@ The next table shows the operation timings on CPU when the left input is encrypt
|
||||
|
||||
All timings are based on parallelized Radix-based integer operations where each block is encrypted using the default parameters `PARAM_MESSAGE_2_CARRY_2_KS_PBS`. To ensure predictable timings, we perform operations in the `default` mode, which ensures that the input and output encoding are similar (i.e., the carries are always emptied).
|
||||
|
||||
You can minimize operational costs by selecting from 'unchecked', 'checked', or 'smart' modes from [the fine-grained APIs](../../../references/fine-grained-apis/quick_start.md), each balancing performance and correctness differently. For more details about parameters, see [here](../../../references/fine-grained-apis/shortint/parameters.md). You can find the benchmark results on GPU for all these operations [here](../../../configuration/run_on_gpu.md#benchmark).
|
||||
You can minimize operational costs by selecting from 'unchecked', 'checked', or 'smart' modes from [the fine-grained APIs](../../../references/fine-grained-apis/quick_start.md), each balancing performance and correctness differently. For more details about parameters, see [here](../../../references/fine-grained-apis/shortint/parameters.md). You can find the benchmark results on GPU for all these operations [here](../../../configuration/gpu_acceleration/benchmark.md).
|
||||
|
||||
## Reproducing TFHE-rs benchmarks
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
This document details the CPU performance benchmarks of programmable bootstrapping and keyswitch operations using **TFHE-rs**.
|
||||
|
||||
{% hint style="info" %}
|
||||
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with an `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
|
||||
All CPU benchmarks were launched on an `AWS hpc7a.96xlarge` instance equipped with a 96-core `AMD EPYC 9R14 CPU @ 2.60GHz` and 740GB of RAM.
|
||||
{% endhint %}
|
||||
|
||||
The next tables show the execution time of a single programmable bootstrapping as well as keyswitch followed by a programmable bootstrapping depending on the precision of the input message. The associated parameters set are given. The configuration is tfhe-fft + AVX-512.
|
||||
|
||||
@@ -8,26 +8,27 @@ All GPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS
|
||||
|
||||
The cryptographic parameters `PARAM_GPU_MULTI_BIT_GROUP_4_MESSAGE_2_CARRY_2_KS_PBS` were used.
|
||||
|
||||
## 1xH100
|
||||
## Pfail: $$2^{-128}$$
|
||||
### 1xH100
|
||||
Below come the results for the execution on a single H100.
|
||||
The following table shows the performance when the inputs of the benchmarked operation are encrypted:
|
||||
|
||||

|
||||

|
||||
|
||||
The following table shows the performance when the left input of the benchmarked operation is encrypted and the other is a clear scalar of the same size:
|
||||
|
||||

|
||||

|
||||
|
||||
## 2xH100
|
||||
### 2xH100
|
||||
|
||||
Below come the results for the execution on two H100's.
|
||||
The following table shows the performance when the inputs of the benchmarked operation are encrypted:
|
||||
|
||||

|
||||

|
||||
|
||||
The following table shows the performance when the left input of the benchmarked operation is encrypted and the other is a clear scalar of the same size:
|
||||
|
||||

|
||||

|
||||
|
||||
## Reproducing TFHE-rs benchmarks
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
This document details the GPU performance benchmarks of programmable bootstrapping and keyswitch operations using **TFHE-rs**.
|
||||
|
||||
{% hint style="info" %}
|
||||
All GPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS algorithm with a grouping factor set to 3.
|
||||
All GPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS algorithm with a grouping factor set to 4.
|
||||
{% endhint %}
|
||||
|
||||
## P-fail: $$2^{-40}$$
|
||||
@@ -14,6 +14,10 @@ All GPU benchmarks were launched on H100 GPUs, and rely on the multithreaded PBS
|
||||
|
||||

|
||||
|
||||
## P-fail: $$2^{-128}$$
|
||||
|
||||

|
||||
|
||||
## Reproducing TFHE-rs benchmarks
|
||||
|
||||
**TFHE-rs** benchmarks can be easily reproduced from the [source](https://github.com/zama-ai/tfhe-rs).
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
This document details the performance benchmarks of [zero-knowledge proofs](../../fhe-computation/advanced-features/zk-pok.md) for [compact public key encryption](../../fhe-computation/advanced-features/public_key.md) using **TFHE-rs**.
|
||||
|
||||
Benchmarks for the zero-knowledge proofs have been run on a `m6i.4xlarge` with 16 cores to simulate an usual client configuration. The verification are done on a `hpc7a.96xlarge` AWS instances to mimic a powerful server.
|
||||
Benchmarks for the zero-knowledge proofs have been run on a `m6i.4xlarge` with 16 cores to simulate a usual client configuration. The verifications are done on an `hpc7a.96xlarge` AWS instance to mimic a powerful server.
|
||||
|
||||
{% embed url="https://docs.google.com/spreadsheets/d/1x12I7Tkdx63Q6sNllygg6urSd5KC1sj1wj4L9jWiET4/edit?usp=sharing" %}
|
||||
|
||||
@@ -7,7 +7,7 @@ This document provides instructions to set up **TFHE-rs** in your project.
|
||||
First, add **TFHE-rs** as a dependency in your `Cargo.toml`.
|
||||
|
||||
```toml
|
||||
tfhe = { version = "~1.1.0", features = ["boolean", "shortint", "integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["boolean", "shortint", "integer"] }
|
||||
```
|
||||
|
||||
{% hint style="info" %}
|
||||
@@ -35,5 +35,5 @@ By default, **TFHE-rs** makes the assumption that hardware AES features are enab
|
||||
To add support for older CPU, import **TFHE-rs** with the `software-prng` feature in your `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
tfhe = { version = "~1.1.0", features = ["boolean", "shortint", "integer", "software-prng"] }
|
||||
tfhe = { version = "~1.1.3", features = ["boolean", "shortint", "integer", "software-prng"] }
|
||||
```
|
||||
|
||||
@@ -59,7 +59,7 @@ edition = "2021"
|
||||
Then add the following configuration to include **TFHE-rs**:
|
||||
|
||||
```toml
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
```
|
||||
|
||||
Your updated `Cargo.toml` file should look like this:
|
||||
@@ -71,7 +71,7 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
```
|
||||
|
||||
If you are on a different platform please refer to the [installation documentation](installation.md) for configuration options of other supported platforms.
|
||||
|
||||
@@ -9,7 +9,7 @@ Welcome to this tutorial about `TFHE-rs` `core_crypto` module.
|
||||
To use `TFHE-rs`, it first has to be added as a dependency in the `Cargo.toml`:
|
||||
|
||||
```toml
|
||||
tfhe = { version = "~1.1.0" }
|
||||
tfhe = { version = "~1.1.3" }
|
||||
```
|
||||
|
||||
### Commented code to double a 2-bit message in a leveled fashion and using a PBS with the `core_crypto` module.
|
||||
|
||||
@@ -107,7 +107,7 @@ fn main() {
|
||||
match ops() {
|
||||
Ok(_) => (),
|
||||
Err(e) => {
|
||||
println!("correctness of operations is not guaranteed due to error: {}", e);
|
||||
println!("correctness of operations is not guaranteed due to error: {e}");
|
||||
return;
|
||||
},
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ To use the `FheUint8` type, enable the `integer` feature:
|
||||
# Cargo.toml
|
||||
|
||||
[dependencies]
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
```
|
||||
|
||||
The `MyFheString::encrypt` function performs data validation to ensure the input string contains only ASCII characters.
|
||||
@@ -167,7 +167,7 @@ First, add the feature in your `Cargo.toml`
|
||||
# Cargo.toml
|
||||
|
||||
[dependencies]
|
||||
tfhe = { version = "~1.1.0", features = ["strings"] }
|
||||
tfhe = { version = "~1.1.3", features = ["strings"] }
|
||||
```
|
||||
|
||||
The `FheAsciiString` type allows to simply do homomorphic case changing of encrypted strings (and much more!):
|
||||
|
||||
@@ -17,7 +17,7 @@ This function returns a Boolean (`true` or `false`) so that the total count of `
|
||||
```toml
|
||||
# Cargo.toml
|
||||
|
||||
tfhe = { version = "~1.1.0", features = ["integer"] }
|
||||
tfhe = { version = "~1.1.3", features = ["integer"] }
|
||||
```
|
||||
|
||||
First, define the verification function.
|
||||
@@ -135,14 +135,14 @@ fn main() {
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
|
||||
let mode = ParityMode::Even;
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
}
|
||||
```
|
||||
@@ -348,7 +348,7 @@ fn main() {
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
assert_eq!(decrypted_parity_bit, clear_parity_bit);
|
||||
|
||||
@@ -357,7 +357,7 @@ fn main() {
|
||||
let fhe_parity_bit = compute_parity_bit(&fhe_bits, mode);
|
||||
let decrypted_parity_bit = fhe_parity_bit.decrypt(&client_key);
|
||||
let is_parity_bit_valid = check_parity_bit_validity(&clear_bits, mode, decrypted_parity_bit);
|
||||
println!("Parity bit is set: {} for mode: {:?}", decrypted_parity_bit, mode);
|
||||
println!("Parity bit is set: {decrypted_parity_bit} for mode: {mode:?}");
|
||||
assert!(is_parity_bit_valid);
|
||||
assert_eq!(decrypted_parity_bit, clear_parity_bit);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fn build_branches(
|
||||
re: &RegExpr,
|
||||
c_pos: usize,
|
||||
) -> Vec<(LazyExecution, usize)> {
|
||||
trace!("program pointer: regex={:?}, content pos={}", re, c_pos);
|
||||
trace!("program pointer: regex={re:?}, content pos={c_pos}");
|
||||
match re {
|
||||
RegExpr::Sof => {
|
||||
if c_pos == 0 {
|
||||
|
||||
@@ -241,7 +241,7 @@ impl std::fmt::Debug for Executed {
|
||||
1 => write!(f, "t"),
|
||||
_ => write!(f, "{}", u8_to_char(*c)),
|
||||
},
|
||||
Self::CtPos { at } => write!(f, "ct_{}", at),
|
||||
Self::CtPos { at } => write!(f, "ct_{at}"),
|
||||
Self::And { a, b } => {
|
||||
write!(f, "(")?;
|
||||
a.fmt(f)?;
|
||||
|
||||
@@ -119,7 +119,7 @@ impl fmt::Debug for RegExpr {
|
||||
at_most,
|
||||
} => {
|
||||
let stringify_opt_n = |opt_n: &Option<usize>| -> String {
|
||||
opt_n.map_or("*".to_string(), |n| format!("{:?}", n))
|
||||
opt_n.map_or("*".to_string(), |n| format!("{n:?}"))
|
||||
};
|
||||
repeat_re.fmt(f)?;
|
||||
write!(
|
||||
|
||||
@@ -33,7 +33,7 @@ fn main() {
|
||||
|
||||
input = input.trim_end_matches('\n').to_string();
|
||||
|
||||
println!("You entered: \"{}\"", input);
|
||||
println!("You entered: \"{input}\"");
|
||||
|
||||
// CLIENT PADS DATA AND ENCRYPTS IT
|
||||
|
||||
@@ -52,7 +52,7 @@ fn main() {
|
||||
let output = decrypt_bools(&encrypted_output, &ck);
|
||||
let outhex = bools_to_hex(output);
|
||||
|
||||
println!("{}", outhex);
|
||||
println!("{outhex}");
|
||||
}
|
||||
|
||||
fn encrypt_bools(bools: &Vec<bool>, ck: &ClientKey) -> Vec<Ciphertext> {
|
||||
|
||||
@@ -12,7 +12,7 @@ pub fn pad_sha256_input(input: &str) -> Vec<bool> {
|
||||
// hex value can be converted to bytes
|
||||
no_prefix.to_string()
|
||||
} else {
|
||||
format!("0{}", no_prefix) // pad hex value to ensure a correct conversion to bytes
|
||||
format!("0{no_prefix}") // pad hex value to ensure a correct conversion to bytes
|
||||
};
|
||||
hex_input
|
||||
.as_bytes()
|
||||
|
||||
@@ -158,7 +158,7 @@ pub fn bools_to_hex(bools: Vec<bool>) -> String {
|
||||
counter += 1;
|
||||
|
||||
if counter == 8 {
|
||||
hex_string.push_str(&format!("{:02x}", byte));
|
||||
hex_string.push_str(&format!("{byte:02x}"));
|
||||
byte = 0;
|
||||
counter = 0;
|
||||
}
|
||||
@@ -167,7 +167,7 @@ pub fn bools_to_hex(bools: Vec<bool>) -> String {
|
||||
// Handle any remaining bits in case the bools vector length is not a multiple of 8
|
||||
if counter > 0 {
|
||||
byte <<= 8 - counter;
|
||||
hex_string.push_str(&format!("{:02x}", byte));
|
||||
hex_string.push_str(&format!("{byte:02x}"));
|
||||
}
|
||||
|
||||
hex_string
|
||||
|
||||
@@ -78,7 +78,7 @@ pub fn cpk_and_cctl_sizes(results_file: &Path) {
|
||||
.build();
|
||||
let cctl_size = bincode::serialize(&encrypted_inputs).unwrap().len();
|
||||
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {} bytes", cctl_size);
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {cctl_size} bytes");
|
||||
|
||||
write_result(&mut file, &test_name, cctl_size);
|
||||
write_to_json::<u64, _>(
|
||||
@@ -124,7 +124,7 @@ pub fn cpk_and_cctl_sizes(results_file: &Path) {
|
||||
.build();
|
||||
let cctl_size = bincode::serialize(&encrypted_inputs).unwrap().len();
|
||||
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {} bytes", cctl_size);
|
||||
println!("Compact CT list for {NB_CTXT} CTs: {cctl_size} bytes");
|
||||
|
||||
write_result(&mut file, &test_name, cctl_size);
|
||||
write_to_json::<u64, _>(
|
||||
|
||||
@@ -351,14 +351,14 @@ fn write_all_params_in_file<U: UnsignedInteger, T: ParamDetails<U> + Copy + Name
|
||||
let (ref_param, ref_param_name) = &group[0];
|
||||
let formatted_param = match key.parameters_format {
|
||||
ParametersFormat::Lwe => {
|
||||
param_names_augmented.push(format!("{}_LWE", ref_param_name));
|
||||
param_names_augmented.push(format!("{ref_param_name}_LWE"));
|
||||
format_lwe_parameters_to_lattice_estimator(
|
||||
(ref_param, ref_param_name.as_str()),
|
||||
&similar_params,
|
||||
)
|
||||
}
|
||||
ParametersFormat::Glwe => {
|
||||
param_names_augmented.push(format!("{}_GLWE", ref_param_name));
|
||||
param_names_augmented.push(format!("{ref_param_name}_GLWE"));
|
||||
format_glwe_parameters_to_lattice_estimator(
|
||||
(ref_param, ref_param_name.as_str()),
|
||||
&similar_params,
|
||||
|
||||
@@ -139,7 +139,7 @@ fn measure_serialized_size<T: serde::Serialize, P: Into<CryptoParametersRecord<u
|
||||
) {
|
||||
let serialized = bincode::serialize(to_serialize).unwrap();
|
||||
let size = serialized.len();
|
||||
let test_name = format!("shortint_key_sizes_{}_{}", param_name, test_name_suffix);
|
||||
let test_name = format!("shortint_key_sizes_{param_name}_{test_name_suffix}");
|
||||
write_result(file, &test_name, size);
|
||||
write_to_json::<u64, _>(
|
||||
&test_name,
|
||||
@@ -151,10 +151,7 @@ fn measure_serialized_size<T: serde::Serialize, P: Into<CryptoParametersRecord<u
|
||||
vec![],
|
||||
);
|
||||
|
||||
println!(
|
||||
"{} {} -> size: {} bytes",
|
||||
test_name_suffix, param_name, size,
|
||||
);
|
||||
println!("{test_name_suffix} {param_name} -> size: {size} bytes",);
|
||||
}
|
||||
|
||||
fn tuniform_key_set_sizes(results_file: &Path) {
|
||||
|
||||
@@ -55,7 +55,7 @@ pub fn parse_wasm_benchmarks(results_file: &Path, raw_results_file: &Path) {
|
||||
let name_parts = full_name.split("_mean_").collect::<Vec<_>>();
|
||||
let bench_name = name_parts[0];
|
||||
let params: PBSParameters = params_from_name(name_parts[1]).into();
|
||||
println!("{:?}", name_parts);
|
||||
println!("{name_parts:?}");
|
||||
if bench_name.contains("_size") {
|
||||
write_result(&mut file, &prefixed_full_name, *val as usize);
|
||||
} else {
|
||||
|
||||
@@ -257,7 +257,7 @@ pub trait ContiguousEntityContainer: AsRef<[Self::Element]> {
|
||||
let entity_view_pod_size = self.get_entity_view_pod_size();
|
||||
self.as_ref()
|
||||
.par_chunks_exact(entity_view_pod_size)
|
||||
.zip(rayon::iter::repeatn(meta, entity_count))
|
||||
.zip(rayon::iter::repeat_n(meta, entity_count))
|
||||
.map(|(elt, meta)| Self::EntityView::<'this>::create_from(elt, meta))
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ pub trait ContiguousEntityContainer: AsRef<[Self::Element]> {
|
||||
let meta = self.get_self_view_creation_metadata();
|
||||
self.as_ref()
|
||||
.par_chunks(pod_chunk_size)
|
||||
.zip(rayon::iter::repeatn(meta, entity_count))
|
||||
.zip(rayon::iter::repeat_n(meta, entity_count))
|
||||
.map(|(elt, meta)| Self::SelfView::<'_>::create_from(elt, meta))
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ pub trait ContiguousEntityContainer: AsRef<[Self::Element]> {
|
||||
let meta = self.get_self_view_creation_metadata();
|
||||
self.as_ref()
|
||||
.par_chunks_exact(pod_chunk_size)
|
||||
.zip(rayon::iter::repeatn(meta, entity_count))
|
||||
.zip(rayon::iter::repeat_n(meta, entity_count))
|
||||
.map(|(elt, meta)| Self::SelfView::<'_>::create_from(elt, meta))
|
||||
}
|
||||
}
|
||||
@@ -471,7 +471,7 @@ pub trait ContiguousEntityContainerMut: ContiguousEntityContainer + AsMut<[Self:
|
||||
let entity_view_pod_size = self.get_entity_view_pod_size();
|
||||
self.as_mut()
|
||||
.par_chunks_exact_mut(entity_view_pod_size)
|
||||
.zip(rayon::iter::repeatn(meta, entity_count))
|
||||
.zip(rayon::iter::repeat_n(meta, entity_count))
|
||||
.map(|(elt, meta)| Self::EntityMutView::<'this>::create_from(elt, meta))
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ pub trait ContiguousEntityContainerMut: ContiguousEntityContainer + AsMut<[Self:
|
||||
let meta = self.get_self_view_creation_metadata();
|
||||
self.as_mut()
|
||||
.par_chunks_mut(pod_chunk_size)
|
||||
.zip(rayon::iter::repeatn(meta, entity_count))
|
||||
.zip(rayon::iter::repeat_n(meta, entity_count))
|
||||
.map(|(elt, meta)| Self::SelfMutView::<'_>::create_from(elt, meta))
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ pub trait ContiguousEntityContainerMut: ContiguousEntityContainer + AsMut<[Self:
|
||||
let meta = self.get_self_view_creation_metadata();
|
||||
self.as_mut()
|
||||
.par_chunks_exact_mut(pod_chunk_size)
|
||||
.zip(rayon::iter::repeatn(meta, entity_count))
|
||||
.zip(rayon::iter::repeat_n(meta, entity_count))
|
||||
.map(|(elt, meta)| Self::SelfMutView::<'_>::create_from(elt, meta))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ pub unsafe fn programmable_bootstrap_async<T: UnsignedInteger>(
|
||||
lwe_array_in.as_c_ptr(0),
|
||||
lwe_in_indexes.as_c_ptr(0),
|
||||
bootstrapping_key.as_c_ptr(0),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
pbs_buffer,
|
||||
lwe_dimension.0 as u32,
|
||||
glwe_dimension.0 as u32,
|
||||
@@ -219,7 +219,7 @@ pub unsafe fn programmable_bootstrap_128_async<T: UnsignedInteger>(
|
||||
test_vector.as_c_ptr(0),
|
||||
lwe_array_in.as_c_ptr(0),
|
||||
bootstrapping_key.as_c_ptr(0),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
pbs_buffer,
|
||||
lwe_dimension.0 as u32,
|
||||
glwe_dimension.0 as u32,
|
||||
@@ -608,9 +608,9 @@ pub unsafe fn add_lwe_ciphertext_vector_async<T: UnsignedInteger>(
|
||||
cuda_add_lwe_ciphertext_vector_64(
|
||||
streams.ptr[0],
|
||||
streams.gpu_indexes[0].get(),
|
||||
&mut lwe_array_out_data,
|
||||
&lwe_array_in_1_data,
|
||||
&lwe_array_in_2_data,
|
||||
&raw mut lwe_array_out_data,
|
||||
&raw const lwe_array_in_1_data,
|
||||
&raw const lwe_array_in_2_data,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -650,9 +650,9 @@ pub unsafe fn add_lwe_ciphertext_vector_assign_async<T: UnsignedInteger>(
|
||||
cuda_add_lwe_ciphertext_vector_64(
|
||||
streams.ptr[0],
|
||||
streams.gpu_indexes[0].get(),
|
||||
&mut lwe_array_out_data,
|
||||
&lwe_array_out_data,
|
||||
&lwe_array_in_data,
|
||||
&raw mut lwe_array_out_data,
|
||||
&raw const lwe_array_out_data,
|
||||
&raw const lwe_array_in_data,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,17 +51,17 @@ where
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct KeyCache {
|
||||
u32_multi_bit_cache: KeyCacheCoreImpl<MultiBitTestParams<u32>, MultiBitBootstrapKeys<u32>>,
|
||||
u64_multi_bit_cache: KeyCacheCoreImpl<MultiBitTestParams<u64>, MultiBitBootstrapKeys<u64>>,
|
||||
u32_classic_cache: KeyCacheCoreImpl<ClassicTestParams<u32>, ClassicBootstrapKeys<u32>>,
|
||||
u64_classic_cache: KeyCacheCoreImpl<ClassicTestParams<u64>, ClassicBootstrapKeys<u64>>,
|
||||
u128_classic_cache: KeyCacheCoreImpl<ClassicTestParams<u128>, ClassicBootstrapKeys<u128>>,
|
||||
u32_fft_cache: KeyCacheCoreImpl<FftTestParams<u32>, FftBootstrapKeys<u32>>,
|
||||
u64_fft_cache: KeyCacheCoreImpl<FftTestParams<u64>, FftBootstrapKeys<u64>>,
|
||||
u128_fft_cache: KeyCacheCoreImpl<FftTestParams<u128>, FftBootstrapKeys<u128>>,
|
||||
u64_fft_wopbs_cache: KeyCacheCoreImpl<FftWopPbsTestParams<u64>, FftWopPbsKeys<u64>>,
|
||||
u32_pksk_cache: KeyCacheCoreImpl<PackingKeySwitchTestParams<u32>, PackingKeySwitchKeys<u32>>,
|
||||
u64_pksk_cache: KeyCacheCoreImpl<PackingKeySwitchTestParams<u64>, PackingKeySwitchKeys<u64>>,
|
||||
u32_multi_bit: KeyCacheCoreImpl<MultiBitTestParams<u32>, MultiBitBootstrapKeys<u32>>,
|
||||
u64_multi_bit: KeyCacheCoreImpl<MultiBitTestParams<u64>, MultiBitBootstrapKeys<u64>>,
|
||||
u32_classic: KeyCacheCoreImpl<ClassicTestParams<u32>, ClassicBootstrapKeys<u32>>,
|
||||
u64_classic: KeyCacheCoreImpl<ClassicTestParams<u64>, ClassicBootstrapKeys<u64>>,
|
||||
u128_classic: KeyCacheCoreImpl<ClassicTestParams<u128>, ClassicBootstrapKeys<u128>>,
|
||||
u32_fft: KeyCacheCoreImpl<FftTestParams<u32>, FftBootstrapKeys<u32>>,
|
||||
u64_fft: KeyCacheCoreImpl<FftTestParams<u64>, FftBootstrapKeys<u64>>,
|
||||
u128_fft: KeyCacheCoreImpl<FftTestParams<u128>, FftBootstrapKeys<u128>>,
|
||||
u64_fft_wopbs: KeyCacheCoreImpl<FftWopPbsTestParams<u64>, FftWopPbsKeys<u64>>,
|
||||
u32_pksk: KeyCacheCoreImpl<PackingKeySwitchTestParams<u32>, PackingKeySwitchKeys<u32>>,
|
||||
u64_pksk: KeyCacheCoreImpl<PackingKeySwitchTestParams<u64>, PackingKeySwitchKeys<u64>>,
|
||||
}
|
||||
|
||||
impl KeyCache {
|
||||
@@ -93,7 +93,7 @@ impl KeyCacheAccess for MultiBitTestParams<u32> {
|
||||
type Keys = MultiBitBootstrapKeys<u32>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u32_multi_bit_cache
|
||||
&keycache.u32_multi_bit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ impl KeyCacheAccess for MultiBitTestParams<u64> {
|
||||
type Keys = MultiBitBootstrapKeys<u64>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u64_multi_bit_cache
|
||||
&keycache.u64_multi_bit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ impl KeyCacheAccess for ClassicTestParams<u32> {
|
||||
type Keys = ClassicBootstrapKeys<u32>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u32_classic_cache
|
||||
&keycache.u32_classic
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ impl KeyCacheAccess for ClassicTestParams<u64> {
|
||||
type Keys = ClassicBootstrapKeys<u64>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u64_classic_cache
|
||||
&keycache.u64_classic
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ impl KeyCacheAccess for ClassicTestParams<u128> {
|
||||
type Keys = ClassicBootstrapKeys<u128>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u128_classic_cache
|
||||
&keycache.u128_classic
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ impl KeyCacheAccess for FftTestParams<u32> {
|
||||
type Keys = FftBootstrapKeys<u32>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u32_fft_cache
|
||||
&keycache.u32_fft
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ impl KeyCacheAccess for FftTestParams<u64> {
|
||||
type Keys = FftBootstrapKeys<u64>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u64_fft_cache
|
||||
&keycache.u64_fft
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ impl KeyCacheAccess for FftTestParams<u128> {
|
||||
type Keys = FftBootstrapKeys<u128>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u128_fft_cache
|
||||
&keycache.u128_fft
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ impl KeyCacheAccess for FftWopPbsTestParams<u64> {
|
||||
type Keys = FftWopPbsKeys<u64>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u64_fft_wopbs_cache
|
||||
&keycache.u64_fft_wopbs
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ impl KeyCacheAccess for PackingKeySwitchTestParams<u32> {
|
||||
type Keys = PackingKeySwitchKeys<u32>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u32_pksk_cache
|
||||
&keycache.u32_pksk
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ impl KeyCacheAccess for PackingKeySwitchTestParams<u64> {
|
||||
type Keys = PackingKeySwitchKeys<u64>;
|
||||
|
||||
fn access(keycache: &KeyCache) -> &KeyCacheCoreImpl<Self, Self::Keys> {
|
||||
&keycache.u64_pksk_cache
|
||||
&keycache.u64_pksk
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ impl Display for InvalidRangeError {
|
||||
"The upper bound of the range is greater than the size of the integer"
|
||||
),
|
||||
Self::WrongOrder => {
|
||||
write!(f, "The upper gound is smaller than the lower bound")
|
||||
write!(f, "The upper bound is smaller than the lower bound")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,12 @@ impl ServerKey {
|
||||
self.key.cpk_casting_key()
|
||||
}
|
||||
|
||||
pub fn noise_squashing_key(
|
||||
&self,
|
||||
) -> Option<&crate::integer::noise_squashing::NoiseSquashingKey> {
|
||||
self.key.noise_squashing_key.as_ref()
|
||||
}
|
||||
|
||||
pub(in crate::high_level_api) fn message_modulus(&self) -> MessageModulus {
|
||||
self.key.message_modulus()
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ pub unsafe fn scalar_addition_integer_radix_assign_async<T: UnsignedInteger>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_lwe_array,
|
||||
&raw mut cuda_ffi_lwe_array,
|
||||
scalar_input.as_c_ptr(0),
|
||||
h_scalar_input.as_ptr().cast::<std::ffi::c_void>(),
|
||||
num_scalars,
|
||||
@@ -371,13 +371,13 @@ pub unsafe fn unchecked_scalar_mul_integer_radix_kb_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_lwe_array,
|
||||
&raw mut cuda_ffi_lwe_array,
|
||||
decomposed_scalar.as_ptr().cast::<u64>(),
|
||||
has_at_least_one_set.as_ptr().cast::<u64>(),
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
polynomial_size.0 as u32,
|
||||
message_modulus.0 as u32,
|
||||
num_scalars,
|
||||
@@ -628,9 +628,9 @@ pub unsafe fn unchecked_add_integer_radix_assign_async(
|
||||
cuda_add_lwe_ciphertext_vector_64(
|
||||
streams.ptr[0],
|
||||
streams.gpu_indexes[0].get(),
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
);
|
||||
update_noise_degree(radix_lwe_left, &cuda_ffi_radix_lwe_left);
|
||||
}
|
||||
@@ -764,14 +764,14 @@ pub unsafe fn unchecked_mul_integer_radix_kb_assign_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
is_boolean_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
is_boolean_right,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
mem_ptr,
|
||||
polynomial_size.0 as u32,
|
||||
num_blocks,
|
||||
@@ -914,13 +914,13 @@ pub unsafe fn unchecked_bitop_integer_radix_kb_assign_async<T: UnsignedInteger,
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_bitop(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -1033,15 +1033,15 @@ pub unsafe fn unchecked_scalar_bitop_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe,
|
||||
&cuda_ffi_radix_lwe,
|
||||
&raw mut cuda_ffi_radix_lwe,
|
||||
&raw const cuda_ffi_radix_lwe,
|
||||
clear_blocks.as_c_ptr(0),
|
||||
h_clear_blocks.as_ptr().cast::<std::ffi::c_void>(),
|
||||
min(clear_blocks.len() as u32, num_blocks),
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_bitop(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -1205,13 +1205,13 @@ pub unsafe fn unchecked_comparison_integer_radix_kb_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
|
||||
cleanup_cuda_integer_comparison(
|
||||
@@ -1358,14 +1358,14 @@ pub unsafe fn unchecked_scalar_comparison_integer_radix_kb_async<T: UnsignedInte
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
scalar_blocks.as_c_ptr(0),
|
||||
h_scalar_blocks.as_ptr().cast::<std::ffi::c_void>(),
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
num_scalar_blocks,
|
||||
);
|
||||
|
||||
@@ -1471,10 +1471,10 @@ pub unsafe fn full_propagate_assign_async<T: UnsignedInteger, B: Numeric>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_input,
|
||||
&raw mut cuda_ffi_radix_lwe_input,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_blocks,
|
||||
);
|
||||
@@ -1611,13 +1611,13 @@ pub(crate) unsafe fn propagate_single_carry_assign_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_input,
|
||||
&mut cuda_ffi_carry_out,
|
||||
&cuda_ffi_carry_in,
|
||||
&raw mut cuda_ffi_radix_lwe_input,
|
||||
&raw mut cuda_ffi_carry_out,
|
||||
&raw const cuda_ffi_carry_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
requested_flag as u32,
|
||||
uses_carry,
|
||||
);
|
||||
@@ -1781,14 +1781,14 @@ pub(crate) unsafe fn add_and_propagate_single_carry_assign_async<T: UnsignedInte
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_lhs_input,
|
||||
&cuda_ffi_rhs_input,
|
||||
&mut cuda_ffi_carry_out,
|
||||
&cuda_ffi_carry_in,
|
||||
&raw mut cuda_ffi_lhs_input,
|
||||
&raw const cuda_ffi_rhs_input,
|
||||
&raw mut cuda_ffi_carry_out,
|
||||
&raw const cuda_ffi_carry_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
requested_flag as u32,
|
||||
uses_carry,
|
||||
);
|
||||
@@ -1893,12 +1893,12 @@ pub unsafe fn unchecked_scalar_left_shift_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_logical_scalar_shift(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2000,12 +2000,12 @@ pub unsafe fn unchecked_scalar_logical_right_shift_integer_radix_kb_assign_async
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_logical_scalar_shift(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2106,12 +2106,12 @@ pub unsafe fn unchecked_scalar_arithmetic_right_shift_integer_radix_kb_assign_as
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_arithmetic_scalar_shift(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2241,12 +2241,12 @@ pub unsafe fn unchecked_right_shift_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2373,12 +2373,12 @@ pub unsafe fn unchecked_left_shift_integer_radix_kb_assign_async<T: UnsignedInte
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2513,12 +2513,12 @@ pub unsafe fn unchecked_rotate_right_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2653,12 +2653,12 @@ pub unsafe fn unchecked_rotate_left_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_shift,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_shift,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_shift_and_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2858,14 +2858,14 @@ pub unsafe fn unchecked_cmux_integer_radix_kb_async<T: UnsignedInteger, B: Numer
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_condition,
|
||||
&cuda_ffi_radix_lwe_true,
|
||||
&cuda_ffi_radix_lwe_false,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_condition,
|
||||
&raw const cuda_ffi_radix_lwe_true,
|
||||
&raw const cuda_ffi_radix_lwe_false,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_cmux(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -2972,12 +2972,12 @@ pub unsafe fn unchecked_scalar_rotate_left_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
n,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_scalar_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3084,12 +3084,12 @@ pub unsafe fn unchecked_scalar_rotate_right_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
n,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_scalar_rotate(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3204,12 +3204,12 @@ pub unsafe fn unchecked_partial_sum_ciphertexts_integer_radix_kb_assign_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_result,
|
||||
&mut cuda_ffi_radix_list,
|
||||
&raw mut cuda_ffi_result,
|
||||
&raw mut cuda_ffi_radix_list,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_radix_partial_sum_ciphertexts_vec(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3323,11 +3323,11 @@ pub unsafe fn apply_univariate_lut_kb_async<T: UnsignedInteger, B: Numeric>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&cuda_ffi_input,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw const cuda_ffi_input,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
);
|
||||
cleanup_cuda_apply_univariate_lut_kb_64(
|
||||
@@ -3443,11 +3443,11 @@ pub unsafe fn apply_many_univariate_lut_kb_async<T: UnsignedInteger, B: Numeric>
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&cuda_ffi_input,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw const cuda_ffi_input,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_many_lut,
|
||||
lut_stride,
|
||||
@@ -3579,12 +3579,12 @@ pub unsafe fn apply_bivariate_lut_kb_async<T: UnsignedInteger, B: Numeric>(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&cuda_ffi_input_1,
|
||||
&cuda_ffi_input_2,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw const cuda_ffi_input_1,
|
||||
&raw const cuda_ffi_input_2,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_blocks,
|
||||
shift,
|
||||
@@ -3741,15 +3741,15 @@ pub unsafe fn unchecked_div_rem_integer_radix_kb_assign_async<T: UnsignedInteger
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_quotient,
|
||||
&mut cuda_ffi_remainder,
|
||||
&cuda_ffi_numerator,
|
||||
&cuda_ffi_divisor,
|
||||
&raw mut cuda_ffi_quotient,
|
||||
&raw mut cuda_ffi_remainder,
|
||||
&raw const cuda_ffi_numerator,
|
||||
&raw const cuda_ffi_divisor,
|
||||
is_signed,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_div_rem(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -3867,11 +3867,11 @@ pub unsafe fn compute_prefix_sum_hillis_steele_async<T: UnsignedInteger, B: Nume
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_output,
|
||||
&mut cuda_ffi_generates_or_propagates,
|
||||
&raw mut cuda_ffi_output,
|
||||
&raw mut cuda_ffi_generates_or_propagates,
|
||||
mem_ptr,
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
num_blocks,
|
||||
);
|
||||
@@ -3927,7 +3927,7 @@ pub unsafe fn reverse_blocks_inplace_async(
|
||||
.collect::<Vec<u32>>()
|
||||
.as_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_output,
|
||||
&raw mut cuda_ffi_radix_lwe_output,
|
||||
);
|
||||
update_noise_degree(radix_lwe_output, &cuda_ffi_radix_lwe_output);
|
||||
}
|
||||
@@ -4082,14 +4082,14 @@ pub(crate) unsafe fn unchecked_unsigned_overflowing_sub_integer_radix_kb_assign_
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_left,
|
||||
&cuda_ffi_radix_lwe_right,
|
||||
&mut cuda_ffi_carry_out,
|
||||
&cuda_ffi_carry_in,
|
||||
&raw mut cuda_ffi_radix_lwe_left,
|
||||
&raw const cuda_ffi_radix_lwe_right,
|
||||
&raw mut cuda_ffi_carry_out,
|
||||
&raw const cuda_ffi_carry_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
compute_overflow as u32,
|
||||
uses_input_borrow,
|
||||
);
|
||||
@@ -4184,12 +4184,12 @@ pub unsafe fn unchecked_signed_abs_radix_kb_assign_async<T: UnsignedInteger, B:
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_ct,
|
||||
&raw mut cuda_ffi_ct,
|
||||
mem_ptr,
|
||||
true,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
);
|
||||
cleanup_cuda_integer_abs_inplace(
|
||||
streams.ptr.as_ptr(),
|
||||
@@ -4323,12 +4323,12 @@ pub unsafe fn unchecked_is_at_least_one_comparisons_block_true_integer_radix_kb_
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
radix_lwe_in.d_blocks.lwe_ciphertext_count().0 as u32,
|
||||
);
|
||||
|
||||
@@ -4465,12 +4465,12 @@ pub unsafe fn unchecked_are_all_comparisons_block_true_integer_radix_kb_async<
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
mem_ptr,
|
||||
bootstrapping_key.ptr.as_ptr(),
|
||||
keyswitch_key.ptr.as_ptr(),
|
||||
&ms_noise_reduction_key_ffi,
|
||||
&raw const ms_noise_reduction_key_ffi,
|
||||
radix_lwe_in.d_blocks.lwe_ciphertext_count().0 as u32,
|
||||
);
|
||||
|
||||
@@ -4536,8 +4536,8 @@ pub unsafe fn unchecked_negate_integer_radix_async(
|
||||
streams.ptr.as_ptr(),
|
||||
streams.gpu_indexes_ptr(),
|
||||
streams.len() as u32,
|
||||
&mut cuda_ffi_radix_lwe_out,
|
||||
&cuda_ffi_radix_lwe_in,
|
||||
&raw mut cuda_ffi_radix_lwe_out,
|
||||
&raw const cuda_ffi_radix_lwe_in,
|
||||
message_modulus,
|
||||
carry_modulus,
|
||||
radix_lwe_in.d_blocks.lwe_ciphertext_count().0 as u32,
|
||||
|
||||
@@ -159,7 +159,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_add(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 + msg2, clear);
|
||||
|
||||
@@ -120,7 +120,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_bitand(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 & msg2, clear);
|
||||
@@ -306,7 +306,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_bitor(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 | msg2, clear);
|
||||
@@ -495,7 +495,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_bitxor(&ct1, &ct2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg1 ^ msg2, clear);
|
||||
|
||||
@@ -191,7 +191,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_neg(&ctxt);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(255, clear);
|
||||
|
||||
@@ -178,7 +178,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_small_scalar_mul(&ct, scalar);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(msg * scalar, clear);
|
||||
|
||||
@@ -175,7 +175,7 @@ impl ServerKey {
|
||||
/// let ct_res = sks.checked_sub(&ctxt_1, &ctxt_2);
|
||||
///
|
||||
/// match ct_res {
|
||||
/// Err(x) => panic!("{:?}", x),
|
||||
/// Err(x) => panic!("{x:?}"),
|
||||
/// Ok(y) => {
|
||||
/// let clear: u64 = cks.decrypt(&y);
|
||||
/// assert_eq!(0, clear);
|
||||
|
||||
@@ -81,6 +81,7 @@ pub(crate) struct KeySwitchingKeyBuildHelper<'keys> {
|
||||
/// sends it to the server so it can cast from one set of parameters to another.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Versionize)]
|
||||
#[versionize(KeySwitchingKeyVersions)]
|
||||
#[allow(clippy::struct_field_names)]
|
||||
pub struct KeySwitchingKey {
|
||||
pub(crate) key_switching_key_material: KeySwitchingKeyMaterial,
|
||||
pub(crate) dest_server_key: ServerKey,
|
||||
|
||||
@@ -55,4 +55,26 @@ impl NoiseSquashingPrivateKey {
|
||||
pub fn noise_squashing_parameters(&self) -> NoiseSquashingParameters {
|
||||
self.params
|
||||
}
|
||||
|
||||
pub fn from_raw_parts(
|
||||
post_noise_squashing_secret_key: GlweSecretKeyOwned<u128>,
|
||||
params: NoiseSquashingParameters,
|
||||
) -> Self {
|
||||
assert_eq!(
|
||||
post_noise_squashing_secret_key.polynomial_size(),
|
||||
params.polynomial_size
|
||||
);
|
||||
assert_eq!(
|
||||
post_noise_squashing_secret_key.glwe_dimension(),
|
||||
params.glwe_dimension
|
||||
);
|
||||
Self {
|
||||
post_noise_squashing_secret_key,
|
||||
params,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_raw_parts(self) -> (GlweSecretKeyOwned<u128>, NoiseSquashingParameters) {
|
||||
(self.post_noise_squashing_secret_key, self.params)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +127,48 @@ impl NoiseSquashingKey {
|
||||
client_key.new_noise_squashing_key(noise_squashing_private_key)
|
||||
}
|
||||
|
||||
pub fn from_raw_parts(
|
||||
bootstrapping_key: Fourier128LweBootstrapKeyOwned,
|
||||
modulus_switch_noise_reduction_key: Option<ModulusSwitchNoiseReductionKey>,
|
||||
message_modulus: MessageModulus,
|
||||
carry_modulus: CarryModulus,
|
||||
output_ciphertext_modulus: CoreCiphertextModulus<u128>,
|
||||
) -> Self {
|
||||
Self {
|
||||
bootstrapping_key,
|
||||
modulus_switch_noise_reduction_key,
|
||||
message_modulus,
|
||||
carry_modulus,
|
||||
output_ciphertext_modulus,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_raw_parts(
|
||||
self,
|
||||
) -> (
|
||||
Fourier128LweBootstrapKeyOwned,
|
||||
Option<ModulusSwitchNoiseReductionKey>,
|
||||
MessageModulus,
|
||||
CarryModulus,
|
||||
CoreCiphertextModulus<u128>,
|
||||
) {
|
||||
let Self {
|
||||
bootstrapping_key,
|
||||
modulus_switch_noise_reduction_key,
|
||||
message_modulus,
|
||||
carry_modulus,
|
||||
output_ciphertext_modulus,
|
||||
} = self;
|
||||
|
||||
(
|
||||
bootstrapping_key,
|
||||
modulus_switch_noise_reduction_key,
|
||||
message_modulus,
|
||||
carry_modulus,
|
||||
output_ciphertext_modulus,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn squash_ciphertext_noise(
|
||||
&self,
|
||||
ciphertext: &Ciphertext,
|
||||
|
||||
@@ -12,6 +12,7 @@ use tfhe_versionable::Versionize;
|
||||
/// A structure containing a public key.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Versionize)]
|
||||
#[versionize(PublicKeyVersions)]
|
||||
#[allow(clippy::struct_field_names)]
|
||||
pub struct PublicKey {
|
||||
pub(crate) lwe_public_key: LwePublicKeyOwned<u64>,
|
||||
pub parameters: ShortintParameterSet,
|
||||
|
||||
@@ -5,7 +5,7 @@ mod test_cpu_doc {
|
||||
// README
|
||||
doctest!("../../README.md", readme);
|
||||
|
||||
// CONGFIGURATION
|
||||
// CONFIGURATION
|
||||
doctest!(
|
||||
"../docs/configuration/parallelized_pbs.md",
|
||||
configuration_parallelized_pbs
|
||||
@@ -109,6 +109,10 @@ mod test_cpu_doc {
|
||||
"../docs/fhe-computation/operations/string-operations.md",
|
||||
operations_string_operations
|
||||
);
|
||||
doctest!(
|
||||
"../docs/fhe-computation/operations/dot-product.md",
|
||||
operations_dot_product
|
||||
);
|
||||
|
||||
// TOOLING
|
||||
doctest!("../docs/fhe-computation/tooling/debug.md", tooling_debug);
|
||||
@@ -212,7 +216,27 @@ mod test_gpu_doc {
|
||||
use doc_comment::doctest;
|
||||
|
||||
doctest!(
|
||||
"../docs/configuration/run_on_gpu.md",
|
||||
configuration_run_on_gpu
|
||||
"../docs/configuration/gpu_acceleration/run_on_gpu.md",
|
||||
configuration_gpu_acceleration_run_on_gpu
|
||||
);
|
||||
doctest!(
|
||||
"../docs/configuration/gpu_acceleration/gpu_operations.md",
|
||||
configuration_gpu_acceleration_gpu_operations
|
||||
);
|
||||
doctest!(
|
||||
"../docs/configuration/gpu_acceleration/compressing_ciphertexts.md",
|
||||
configuration_gpu_acceleration_compressing_ciphertexts
|
||||
);
|
||||
doctest!(
|
||||
"../docs/configuration/gpu_acceleration/array_type.md",
|
||||
configuration_gpu_acceleration_array_type
|
||||
);
|
||||
doctest!(
|
||||
"../docs/configuration/gpu_acceleration/benchmark.md",
|
||||
configuration_gpu_acceleration_benchmark
|
||||
);
|
||||
doctest!(
|
||||
"../docs/configuration/gpu_acceleration/multi_gpu.md",
|
||||
configuration_gpu_acceleration_multi_gpu_device_selection
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
nightly-2025-02-20
|
||||
nightly-2025-04-28
|
||||
|
||||
@@ -62,8 +62,7 @@ impl AssociatedType for DispatchType {
|
||||
return Err(syn::Error::new(
|
||||
lt.lifetime.span(),
|
||||
format!(
|
||||
"Lifetime name {} conflicts with the one used by macro `Version`",
|
||||
LIFETIME_NAME
|
||||
"Lifetime name {LIFETIME_NAME} conflicts with the one used by macro `Version`"
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -61,8 +61,7 @@ impl AssociatedType for VersionType {
|
||||
return Err(syn::Error::new(
|
||||
lt.lifetime.span(),
|
||||
format!(
|
||||
"Lifetime name {} conflicts with the one used by macro `Version`",
|
||||
LIFETIME_NAME
|
||||
"Lifetime name {LIFETIME_NAME} conflicts with the one used by macro `Version`",
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ use crate::{
|
||||
pub(crate) enum VersionizeImplementor {
|
||||
Classic(ClassicVersionizeAttribute),
|
||||
Convert(ConvertVersionizeAttribute),
|
||||
Transparent(TransparentStruct),
|
||||
Transparent(Box<TransparentStruct>),
|
||||
}
|
||||
|
||||
impl VersionizeImplementor {
|
||||
@@ -33,9 +33,9 @@ impl VersionizeImplementor {
|
||||
match attributes {
|
||||
VersionizeAttribute::Classic(classic) => Ok(Self::Classic(classic)),
|
||||
VersionizeAttribute::Convert(convert) => Ok(Self::Convert(convert)),
|
||||
VersionizeAttribute::Transparent => {
|
||||
Ok(Self::Transparent(TransparentStruct::new(decla, base_span)?))
|
||||
}
|
||||
VersionizeAttribute::Transparent => Ok(Self::Transparent(Box::new(
|
||||
TransparentStruct::new(decla, base_span)?,
|
||||
))),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ impl VersionizeImplementor {
|
||||
add_trait_where_clause(
|
||||
&mut generics,
|
||||
[&parse_quote!(#dispatch_enum_path #dispatch_ty_generics)],
|
||||
&[format!("{}<Self>", DISPATCH_TRAIT_NAME,)],
|
||||
&[format!("{DISPATCH_TRAIT_NAME}<Self>")],
|
||||
)?;
|
||||
}
|
||||
Self::Convert(convert_attr) => {
|
||||
@@ -220,7 +220,7 @@ impl VersionizeImplementor {
|
||||
[&parse_quote!(#convert_type_path)],
|
||||
&[
|
||||
VERSIONIZE_OWNED_TRAIT_NAME,
|
||||
&format!("{}<Self>", FROM_TRAIT_NAME),
|
||||
&format!("{FROM_TRAIT_NAME}<Self>"),
|
||||
],
|
||||
)?;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ impl VersionizeImplementor {
|
||||
let mut generics = input_generics.clone();
|
||||
let convert_type_path = &convert_attr.conversion_target;
|
||||
let into_trait = match convert_attr.conversion_type {
|
||||
ConversionType::Direct => format!("{}<Self>", INTO_TRAIT_NAME),
|
||||
ConversionType::Direct => format!("{INTO_TRAIT_NAME}<Self>"),
|
||||
ConversionType::Try => {
|
||||
// Doing a TryFrom requires that the error
|
||||
// impl Error + Send + Sync + 'static
|
||||
@@ -268,7 +268,7 @@ impl VersionizeImplementor {
|
||||
&[STATIC_LIFETIME_NAME],
|
||||
)?;
|
||||
|
||||
format!("{}<Self>", TRY_INTO_TRAIT_NAME)
|
||||
format!("{TRY_INTO_TRAIT_NAME}<Self>")
|
||||
}
|
||||
};
|
||||
add_trait_where_clause(
|
||||
@@ -276,7 +276,7 @@ impl VersionizeImplementor {
|
||||
[&parse_quote!(#convert_type_path)],
|
||||
&[
|
||||
UNVERSIONIZE_TRAIT_NAME,
|
||||
&format!("{}<Self>", FROM_TRAIT_NAME),
|
||||
&format!("{FROM_TRAIT_NAME}<Self>"),
|
||||
&into_trait,
|
||||
],
|
||||
)?;
|
||||
|
||||