Repository navigation
Fix vectorized version of bli_amaxv - #382
Conversation
To match Netlib, i?amax should return: - the lowest index among equal values - the first NaN if one is encountered
|
@fgvanzee I wrote this in the browser so someone should make sure it even compiles 😄. Also, it is not super pretty since the logic is rather complicated but I think this is about as good as it is going to get. |
|
OK, doesn't compile. Will fix tomorrow. |
|
Tested, and ref. kernel fixed too. Ready to merge after review. |
|
@devinamatthews @rvdg Okay, this would have taken me way longer than an hour. Thanks for this PR. It looks fine to me, although I haven't looked at the intrinsics code closely enough to know why it works. :) I'm assuming you re-enabled the use of the kernels while testing? (Dumb question, I know, but I'm just making sure since you didn't include the re-enabling of the kernels in this PR.) |
|
@devinamatthews Just to confirm (per this #385 (comment)): this commit should reenable the intrinsics |
|
@fgvanzee yes. |
Details: - Re-enabled the optimized, intrinsics-based amaxv kernels in the 'zen' kernel set for use in haswell, zen, zen2, knl, and skx subconfigs. These two kernels (for s and d datatypes) were temporarily disabled in e186d71 as part of issue #380. However, the key missing semantic properties that prompted the disabling of these kernels--returning the index of the *first* rather than of the last element with largest absolute value, and returning the index of the first NaN if one is encountered--were added as part of #382 thanks to Devin Matthews. Thus, now that the kernels are working as expected once more, this commit causes these kernels to once again be registered for the affected subconfigs, which effectively reverts all code changes included in e186d71. - Whitespace/formatting updates to new macros in bli_amaxv_zen_int.c.
To match Netlib, i?amax should return:
Fixes #380.