Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/fglm/fglm_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<unistd.h>
#include<time.h>
/* for timing functions */
Expand Down Expand Up @@ -504,15 +505,15 @@ static inline void sparse_mat_fglm_mult_vec(CF_t *res, sp_matfglm_t *mat,
nmod_t mod;
uint64_t pow2_precomp;
nmod_init(&mod, (uint64_t)prime);
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);

_avx512_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
ncols, nrows, mod, pow2_precomp, st);
#elif defined(HAVE_AVX2)
nmod_t mod;
uint64_t pow2_precomp;
nmod_init(&mod, (uint64_t)prime);
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);

_avx2_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
ncols, nrows, mod, pow2_precomp, st);
Expand Down Expand Up @@ -565,15 +566,15 @@ static inline void sparse_mat_fglm_colon_mult_vec(CF_t *res, sp_matfglmcol_t *ma
nmod_t mod;
uint64_t pow2_precomp;
nmod_init(&mod, (uint64_t)prime);
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);

_avx512_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
ncols, nrows, mod, pow2_precomp, st);
#elif defined(HAVE_AVX2)
nmod_t mod;
uint64_t pow2_precomp;
nmod_init(&mod, (uint64_t)prime);
NMOD_RED(pow2_precomp, (UWORD(1) << __DOT_SPLIT_BITS), mod);
NMOD_RED(pow2_precomp, (UINT64_C(1) << __DOT_SPLIT_BITS), mod);

_avx2_matrix_vector_product(vres, mat->dense_mat, vec, mat->dst,
ncols, nrows, mod, pow2_precomp, st);
Expand Down Expand Up @@ -2208,4 +2209,3 @@ param_t *nmod_fglm_guess_colon(sp_matfglmcol_t *matrix,
return param;
}


2 changes: 1 addition & 1 deletion src/fglm/linalg-fglm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

// parameters for splitting
#define __DOT_SPLIT_BITS 56
#define __DOT_SPLIT_MASK 72057594037927935UL // (1UL << __DOT_SPLIT_BITS) - 1
#define __DOT_SPLIT_MASK UINT64_C(72057594037927935) // (UINT64_C(1) << __DOT_SPLIT_BITS) - 1

/*--------------------------------------*/
/* non-vectorized matrix vector product */
Expand Down
4 changes: 2 additions & 2 deletions src/msolve/msolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,12 +912,12 @@ static inline void normalize_nmod_param(param_t *nmod_param) {

for (long i = 1; i < nmod_param->elim->length; i++) {
nmod_param->denom->coeffs[i - 1] =
(i * nmod_param->elim->coeffs[i]) % prime;
(uint64_t)i * (uint64_t)nmod_param->elim->coeffs[i] % (uint64_t)prime;
}

for (long i = 0; i < nmod_param->elim->length - 1; i++) {
nmod_param->denom->coeffs[i] =
(inv * nmod_param->denom->coeffs[i]) % prime;
(uint64_t)inv * (uint64_t)nmod_param->denom->coeffs[i] % (uint64_t)prime;
}

for (int j = 0; j < nmod_param->nvars - 1; j++) {
Expand Down
Loading