Skip to content

Commit

Permalink
random again (fix compiler error in JIT kernel)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrTimothyAldenDavis committed May 31, 2024
1 parent 728472c commit 7836fca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions experimental/test/test_Coarsen_Matching.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ char msg [LAGRAPH_MSG_LEN] ;
void test_Coarsen_Matching () {

OK (LAGraph_Init (msg)) ;
// GrB_set (GrB_GLOBAL, (int32_t) (true), GxB_BURBLE) ;
OK (LAGraph_Random_Init (msg)) ;

#if LAGRAPH_SUITESPARSE
Expand Down
9 changes: 4 additions & 5 deletions experimental/utility/LAGraph_Random.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,13 @@ void LG_rand_init_func (void *z, const void *x, GrB_Index i,
" state ^= state << 13 ; \n" \
" state ^= state >> 7 ; \n" \
" state ^= state << 17 ; \n" \
" seed = (*((uint64_t *) y)) ; \n" \
" uint64_t state += seed ; \n" \
" uint64_t seed = (*((uint64_t *) y)) ; \n" \
" state += seed ; \n" \
" uint64_t result = (state += 0x9E3779B97f4A7C15) ; \n" \
" result = (result ^ (result >> 30)) * 0xBF58476D1CE4E5B9 ; \n" \
" result = (result ^ (result >> 27)) * 0x94D049BB133111EB ; \n" \
" result = (result ^ (result >> 31)) ; \n" \
" #define LG_RAND_MARSAGLIA_SEED 88172645463325252LL \n" \
" if (result == 0) result = LG_RAND_MARSAGLIA_SEED ; \n" \
" if (result == 0) result = 88172645463325252LL ; \n" \
" (*((uint64_t *) z)) = result ; \n" \
"}"

Expand Down Expand Up @@ -211,7 +210,7 @@ int LAGraph_Random_Init (char *msg)
// using the generator from LAGraph v1.1
GRB_TRY (GxB_UnaryOp_new (&LG_rand_next_op, LG_rand_next_f1,
GrB_UINT64, GrB_UINT64,
"LG_rand_next_f1", LG_RAND_NEXT_F_DEFN)) ;
"LG_rand_next_f1", LG_RAND_NEXT_F1_DEFN)) ;
}
#else
{
Expand Down

0 comments on commit 7836fca

Please sign in to comment.