Skip to content

Commit d7ed1a6

Browse files
author
Vahid Tavanashad
committed
fix warnings generated at compile time
1 parent 0820b9b commit d7ed1a6

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ if(WIN32)
4545
string(CONCAT PRECISION_FLAGS
4646
"/fp:fast=2 "
4747
"/Qimf-precision=high "
48-
"/Qprec-sqrt "
4948
"/Qprotect-parens "
5049
)
5150
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox ${WARNING_FLAGS} ${SDL_FLAGS} ${PRECISION_FLAGS}")
@@ -82,7 +81,6 @@ elseif(UNIX)
8281
"${SDL_FLAGS}"
8382
)
8483
string(CONCAT PRECISION_FLAGS
85-
"-prec-sqrt "
8684
"-fprotect-parens "
8785
"-fimf-precision=high "
8886
"-fp-model fast=2 "

mkl_umath/src/mkl_umath_loops.c.src

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@
7474
type *in1p = (type *) (in1); \
7575
type *op1p = (type *) (op1); \
7676
while (_n_ > _chunk_size) { \
77-
vml_func((MKL_INT) _chunk_size, in1p, op1p); \
78-
_n_ -= _chunk_size; \
79-
in1p += _chunk_size; \
80-
op1p += _chunk_size; \
77+
npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \
78+
vml_func((MKL_INT) _current_chunk, in1p, op1p); \
79+
_n_ -= _current_chunk; \
80+
in1p += _current_chunk; \
81+
op1p += _current_chunk; \
8182
} \
8283
if (_n_) { \
8384
vml_func((MKL_INT) _n_, in1p, op1p); \
@@ -92,11 +93,12 @@
9293
type *in2p = (type *) (in2); \
9394
type *op1p = (type *) (op1); \
9495
while (_n_ > _chunk_size) { \
95-
vml_func((MKL_INT) _chunk_size, in1p, in2p, op1p); \
96-
_n_ -= _chunk_size; \
97-
in1p += _chunk_size; \
98-
in2p += _chunk_size; \
99-
op1p += _chunk_size; \
96+
npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \
97+
vml_func((MKL_INT) _current_chunk, in1p, in2p, op1p); \
98+
_n_ -= _current_chunk; \
99+
in1p += _current_chunk; \
100+
in2p += _current_chunk; \
101+
op1p += _current_chunk; \
100102
} \
101103
if (_n_) { \
102104
vml_func((MKL_INT)_n_, in1p, in2p, op1p); \
@@ -115,10 +117,11 @@
115117
const type _scaleB = (scaleB); \
116118
const type _shiftB = (shiftB); \
117119
while (_n_ > _chunk_size) { \
118-
vml_func(_chunk_size, in1p, in1p, _scaleA, _shiftA, _scaleB, _shiftB, op1p); \
119-
_n_ -= _chunk_size; \
120-
in1p += _chunk_size; \
121-
op1p += _chunk_size; \
120+
npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \
121+
vml_func(_current_chunk, in1p, in1p, _scaleA, _shiftA, _scaleB, _shiftB, op1p); \
122+
_n_ -= _current_chunk; \
123+
in1p += _current_chunk; \
124+
op1p += _current_chunk; \
122125
} \
123126
if (_n_) { \
124127
vml_func((MKL_INT)_n_, in1p, in1p, _scaleA, _shiftA, _scaleB, _shiftB, op1p); \

0 commit comments

Comments
 (0)