Skip to content

fix warnings generated at compile time #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 7, 2025
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
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ if(WIN32)
string(CONCAT PRECISION_FLAGS
"/fp:fast=2 "
"/Qimf-precision=high "
"/Qprec-sqrt "
"/Qprotect-parens "
)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox ${WARNING_FLAGS} ${SDL_FLAGS} ${PRECISION_FLAGS}")
Expand Down Expand Up @@ -82,7 +81,6 @@ elseif(UNIX)
"${SDL_FLAGS}"
)
string(CONCAT PRECISION_FLAGS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were used previously with icc compiler. And they were kept during migration to icx since otherwise some tests are failing due to the precision issue.
But from the description of imf-precision=high option it sounds like it covers prec-sqrt and so it should be fine to remove that one rather than finding the replacement alternative.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know the tests which would fail? We can verify that this change won't reintroduce the failures

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be some scope in the internal CI. Hope @ekomarova can provide more insights on that.

"-prec-sqrt "
"-fprotect-parens "
"-fimf-precision=high "
"-fp-model fast=2 "
Expand Down
74 changes: 34 additions & 40 deletions mkl_umath/src/mkl_umath_loops.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -73,40 +73,36 @@

#define MKL_INT_MAX ((npy_intp) ((~((MKL_UINT) 0)) >> 1))

#define CHUNKED_VML_CALL2(vml_func, n, type, in1, op1) \
do { \
npy_intp _n_ = (n); \
const npy_intp _chunk_size = MKL_INT_MAX; \
type *in1p = (type *) (in1); \
type *op1p = (type *) (op1); \
while (_n_ > _chunk_size) { \
vml_func((MKL_INT) _chunk_size, in1p, op1p); \
_n_ -= _chunk_size; \
in1p += _chunk_size; \
op1p += _chunk_size; \
} \
if (_n_) { \
vml_func((MKL_INT) _n_, in1p, op1p); \
} \
#define CHUNKED_VML_CALL2(vml_func, n, type, in1, op1) \
do { \
npy_intp _n_ = (n); \
const npy_intp _chunk_size = MKL_INT_MAX; \
type *in1p = (type *) (in1); \
type *op1p = (type *) (op1); \
while (_n_ > 0) { \
npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \
vml_func((MKL_INT) _current_chunk, in1p, op1p); \
_n_ -= _current_chunk; \
in1p += _current_chunk; \
op1p += _current_chunk; \
} \
} while (0)

#define CHUNKED_VML_CALL3(vml_func, n, type, in1, in2, op1) \
do { \
npy_intp _n_ = (n); \
const npy_intp _chunk_size = MKL_INT_MAX; \
type *in1p = (type *) (in1); \
type *in2p = (type *) (in2); \
type *op1p = (type *) (op1); \
while (_n_ > _chunk_size) { \
vml_func((MKL_INT) _chunk_size, in1p, in2p, op1p); \
_n_ -= _chunk_size; \
in1p += _chunk_size; \
in2p += _chunk_size; \
op1p += _chunk_size; \
} \
if (_n_) { \
vml_func((MKL_INT)_n_, in1p, in2p, op1p); \
} \
#define CHUNKED_VML_CALL3(vml_func, n, type, in1, in2, op1) \
do { \
npy_intp _n_ = (n); \
const npy_intp _chunk_size = MKL_INT_MAX; \
type *in1p = (type *) (in1); \
type *in2p = (type *) (in2); \
type *op1p = (type *) (op1); \
while (_n_ > 0) { \
npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \
vml_func((MKL_INT) _current_chunk, in1p, in2p, op1p); \
_n_ -= _current_chunk; \
in1p += _current_chunk; \
in2p += _current_chunk; \
op1p += _current_chunk; \
} \
} while(0)


Expand All @@ -120,14 +116,12 @@
const type _shiftA = (shiftA); \
const type _scaleB = (scaleB); \
const type _shiftB = (shiftB); \
while (_n_ > _chunk_size) { \
vml_func(_chunk_size, in1p, in1p, _scaleA, _shiftA, _scaleB, _shiftB, op1p); \
_n_ -= _chunk_size; \
in1p += _chunk_size; \
op1p += _chunk_size; \
} \
if (_n_) { \
vml_func((MKL_INT)_n_, in1p, in1p, _scaleA, _shiftA, _scaleB, _shiftB, op1p); \
while (_n_ > 0) { \
npy_intp _current_chunk = (_n_ > _chunk_size) ? _chunk_size : _n_; \
vml_func(_current_chunk, in1p, in1p, _scaleA, _shiftA, _scaleB, _shiftB, op1p); \
_n_ -= _current_chunk; \
in1p += _current_chunk; \
op1p += _current_chunk; \
} \
} while(0)

Expand Down
Loading