Skip to content

Commit

Permalink
Make mi64_div_y32 source array const.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldesnogu committed Sep 8, 2024
1 parent 26e20f2 commit 12a97e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mi64.c
Original file line number Diff line number Diff line change
Expand Up @@ -8072,7 +8072,7 @@ In other words, these kinds of compiler warnings are expected:
#ifdef __CUDA_ARCH__
__device__
#endif
uint32 mi64_div_y32(uint64 x[], uint32 y, uint64 q[], uint32 len)
uint32 mi64_div_y32(const uint64 x[], uint32 y, uint64 q[], uint32 len)
{
int i;
uint64 cy, rem, xlomody, tsum;
Expand Down Expand Up @@ -8109,7 +8109,7 @@ uint32 mi64_div_y32(uint64 x[], uint32 y, uint64 q[], uint32 len)
rem = tsum%y;
}
if(rem == 0 && x != q) { // If overwrote input with quotient in above loop, skip this
ASSERT(mi64_is_div_by_scalar32((uint32 *)x, y, len), "Results of mi64_div_y32 and mi64_is_div_by_scalar32 differ!");
ASSERT(mi64_is_div_by_scalar32((const uint32 *)x, y, len), "Results of mi64_div_y32 and mi64_is_div_by_scalar32 differ!");
return 0;
}
return (uint32)rem;
Expand Down
2 changes: 1 addition & 1 deletion src/mi64.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ DEV int mi64_is_div_by_scalar64 (const uint64 x[], uint64 a, uint32 len);
DEV int mi64_is_div_by_scalar64_x4(const uint64 x[], uint64 q0, uint64 q1, uint64 q2, uint64 q3, uint32 len);
DEV int mi64_is_div_by_scalar64_u2 (const uint64 x[], uint64 a, uint32 len); // 2-way interleaved-|| loop
DEV int mi64_is_div_by_scalar64_u4 (const uint64 x[], uint64 a, uint32 len); // 4-way interleaved-|| loop
DEV uint32 mi64_div_y32 (uint64 x[], uint32 y, uint64 q[], uint32 len);
DEV uint32 mi64_div_y32 (const uint64 x[], uint32 y, uint64 q[], uint32 len);

/* Basic I/O routines: */
/* This is an arbitrary-string-length core routine which can be called directly, requires caller to supply allocated-length of input string: */
Expand Down

0 comments on commit 12a97e8

Please sign in to comment.