E3SM-Project / EKAT

Tools and libraries for writing Kokkos-enabled HPC C++ in E3SM ecosystem
Other
15 stars 6 forks source link

Vectorization inconsistency between packed min/max #38

Open bartgol opened 4 years ago

bartgol commented 4 years ago

Describe the bug I cannot understand why min and max have different vectorization macros (one has vector_disabled, while the other has vector_simd). It appears to me as a potential bug.

To Reproduce Take a look at the two pairs of max/min implementation (masked and unmasked) around this line.

Expected behavior Either both vector_simd or both vector_disabled.

@jgfouca might know more about this, and either confirm or deny that this is a bug.

jgfouca commented 4 years ago

@bartgol , the other couple places where vector_disabled is used has a comment indicating that Intel18 has a problem. I'm pretty sure @ambrad put those there, so he may know why min also has disabled vectorization.

ambrad commented 4 years ago

What Jim writes is true: a compiler bug in a specific Intel version affects the default min op.

ambrad commented 4 years ago

We probably need to start doing things like this rather than turn off an optimization completely, i.e., regardless of compiler.

bartgol commented 4 years ago

I was gonna say, we should probably micro-tune this kind of behaviors, so not to leave performance on the table everywhere else.