Skip to content

Commit

Permalink
spelling and format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
emirsoyturk committed Jan 23, 2025
1 parent 29bb229 commit b2cad08
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/versioned_docs/version-2.8.0/icicle/primitives/msm.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The MSM supports batch mode - running multiple MSMs in parallel. It's always bet
struct MSMConfig {
device_context::DeviceContext ctx; /**< Details related to the device such as its id and stream id. */
int points_size; /**< Number of points in the MSM. If a batch of MSMs needs to be computed, this should be
* a number of different points. So, if each MSM re-uses the same set of points, this
* a number of different points. So, if each MSM reuses the same set of points, this
* variable is set equal to the MSM size. And if every MSM uses a distinct set of
* points, it should be set to the product of MSM size and [batch_size](@ref
* batch_size). Default value: 0 (meaning it's equal to the MSM size). */
Expand Down
2 changes: 1 addition & 1 deletion examples/c++/polynomial-multiplication/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void incremental_values(scalar_t* res, uint32_t count)
}
}

// calcaulting polynomial multiplication A*B via NTT,pointwise-multiplication and INTT
// calculating polynomial multiplication A*B via NTT,pointwise-multiplication and INTT
// (1) allocate A,B on HOST. Randomize first half, zero second half
// (2) allocate A,B,Res on device
// (3) calc NTT for A and for B from host to device
Expand Down
3 changes: 1 addition & 2 deletions icicle/backend/cpu/src/field/cpu_vec_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,7 @@ REGISTER_VECTOR_DIV_BACKEND("CPU", cpu_vector_div<scalar_t>);

/*********************************** INV ***********************************/
template <typename T>
eIcicleError cpu_vector_inv(
const Device& device, const T* vec_a, uint64_t size, const VecOpsConfig& config, T* output)
eIcicleError cpu_vector_inv(const Device& device, const T* vec_a, uint64_t size, const VecOpsConfig& config, T* output)
{
return cpu_2vectors_op(VecOperation::VECTOR_INV, vec_a, vec_a, size, config, output);
}
Expand Down
11 changes: 5 additions & 6 deletions icicle/include/icicle/backend/vec_ops_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,14 @@ namespace icicle {

void register_vector_inv(const std::string& deviceType, VectorReduceOpImpl impl);

#define REGISTER_VECTOR_INV_BACKEND(DEVICE_TYPE, FUNC) \
#define REGISTER_VECTOR_INV_BACKEND(DEVICE_TYPE, FUNC) \
namespace { \
static bool UNIQUE(_reg_vec_inv) = []() -> bool { \
register_vector_inv(DEVICE_TYPE, FUNC); \
static bool UNIQUE(_reg_vec_inv) = []() -> bool { \
register_vector_inv(DEVICE_TYPE, FUNC); \
return true; \
}(); \
}


void register_vector_sub(const std::string& deviceType, scalarVectorOpImpl impl);
#define REGISTER_VECTOR_SUB_BACKEND(DEVICE_TYPE, FUNC) \
namespace { \
Expand Down Expand Up @@ -318,8 +317,8 @@ namespace icicle {

#define REGISTER_VECTOR_INV_EXT_FIELD_BACKEND(DEVICE_TYPE, FUNC) \
namespace { \
static bool UNIQUE(_reg_vec_inv_ext_field) = []() -> bool { \
register_extension_vector_inv(DEVICE_TYPE, FUNC); \
static bool UNIQUE(_reg_vec_inv_ext_field) = []() -> bool { \
register_extension_vector_inv(DEVICE_TYPE, FUNC); \
return true; \
}(); \
}
Expand Down
10 changes: 4 additions & 6 deletions icicle/src/vec_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,14 @@ namespace icicle {
/*********************************** INV ***********************************/
ICICLE_DISPATCHER_INST(VectorInvDispatcher, vector_inv, VectorReduceOpImpl);

extern "C" eIcicleError CONCAT_EXPAND(FIELD, vector_inv)(
const scalar_t* vec_a, uint64_t size, const VecOpsConfig* config, scalar_t* output)
extern "C" eIcicleError
CONCAT_EXPAND(FIELD, vector_inv)(const scalar_t* vec_a, uint64_t size, const VecOpsConfig* config, scalar_t* output)
{
return VectorInvDispatcher::execute(vec_a, size, *config, output);
}

template <>
eIcicleError
vector_inv(const scalar_t* vec_a, uint64_t size, const VecOpsConfig& config, scalar_t* output)
eIcicleError vector_inv(const scalar_t* vec_a, uint64_t size, const VecOpsConfig& config, scalar_t* output)
{
return CONCAT_EXPAND(FIELD, vector_inv)(vec_a, size, &config, output);
}
Expand All @@ -270,8 +269,7 @@ namespace icicle {
}

template <>
eIcicleError vector_inv(
const extension_t* vec_a, uint64_t size, const VecOpsConfig& config, extension_t* output)
eIcicleError vector_inv(const extension_t* vec_a, uint64_t size, const VecOpsConfig& config, extension_t* output)
{
return CONCAT_EXPAND(FIELD, extension_vector_inv)(vec_a, vec_b, size, &config, output);
}
Expand Down
2 changes: 1 addition & 1 deletion wrappers/rust/icicle-core/src/msm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub trait MSM<C: Curve> {
/// * `scalars` - scalar values `s1, s2, ..., sn`.
///
/// * `bases` - bases `P1, P2, ..., Pn`. The number of bases can be smaller than the number of scalars
/// in the case of batch MSM. In this case bases are re-used periodically. Alternatively, there can be more bases
/// in the case of batch MSM. In this case bases are reused periodically. Alternatively, there can be more bases
/// than scalars if precomputation has been performed, you need to set `cfg.precompute_factor` in that case.
///
/// * `cfg` - config used to specify extra arguments of the MSM.
Expand Down

0 comments on commit b2cad08

Please sign in to comment.