From d7945b5ad49d80cac14b865849fe231a2cfebead Mon Sep 17 00:00:00 2001 From: Hanting Zhang Date: Wed, 10 Jan 2024 18:50:16 +0000 Subject: [PATCH] add npoints --- msm/pippenger.cuh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/msm/pippenger.cuh b/msm/pippenger.cuh index af04526..c8f5e58 100644 --- a/msm/pippenger.cuh +++ b/msm/pippenger.cuh @@ -784,6 +784,7 @@ template struct msm_context_t { T *d_points; + size_t npoints; }; template @@ -802,6 +803,7 @@ static RustError mult_pippenger_init(const affine_t points[], size_t npoints, { msm_t msm{points, npoints, false}; msm_context->d_points = msm.get_d_points(); + msm_context->npoints = npoints; return RustError{cudaSuccess}; } catch (const cuda_error &e) @@ -839,15 +841,15 @@ static RustError mult_pippenger(point_t *out, const affine_t points[], size_t np template -static RustError mult_pippenger_with(point_t *out, msm_context_t *msm_context, size_t npoints, +static RustError mult_pippenger_with(point_t *out, msm_context_t *msm_context, const scalar_t scalars[], bool mont = true, size_t ffi_affine_sz = sizeof(affine_t)) { try { - msm_t msm{nullptr, npoints, false}; + msm_t msm{nullptr, msm_context->npoints, false}; msm.set_d_points(msm_context->d_points); - return msm.invoke(*out, nullptr, npoints, + return msm.invoke(*out, nullptr, msm_context->npoints, scalars, mont, ffi_affine_sz); } catch (const cuda_error &e)