Files
icicle/examples/c++/mont_vec_ops/README.md
2024-08-04 06:19:10 +00:00

822 B

#Icicle example : Montgomery vector operations(mul, add, sub) for allpossible options: is_a_on_device is_b_on_device is_result_on_device is_in_montgomery_form (is_async isn't checked)

Key-Takeaway

Icicle accelerates multiplication operation * using Karatsuba algorithm

Concise Usage Explanation

Define field to be used, e. g.:

#include "api/bn254.h"
using namespace bn254;
typedef scalar_t T;

Running the example

  • cd to your example directory
  • compile with ./compile.sh
  • run with ./run.sh

What's in the example

  1. Define the parameters for the example such as vector size
  2. Generate random vectors on-host
  3. Copy them on-device
  4. Execute element-wise vector multiplication on-device
  5. Copy results on-host