Skip to content

Fix vectorized version of bli_amaxv - #382

Merged
fgvanzee merged 5 commits into
masterfrom
vector-amaxv
Mar 24, 2020
Merged

fgvanzee merged 5 commits into
masterfrom
vector-amaxv

Conversation

@devinamatthews

@devinamatthews devinamatthews commented Mar 22, 2020 •

Copy link
Copy Markdown
Member

To match Netlib, i?amax should return:

  • the lowest index among equal values
  • the first NaN if one is encountered

Fixes #380.

To match Netlib, i?amax should return:
- the lowest index among equal values
- the first NaN if one is encountered
@devinamatthews

Copy link
Copy Markdown
Member Author

@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.

@devinamatthews

Copy link
Copy Markdown
Member Author

OK, doesn't compile. Will fix tomorrow.

@devinamatthews

Copy link
Copy Markdown
Member Author

Tested, and ref. kernel fixed too. Ready to merge after review.

@devinamatthews
devinamatthews requested a review from fgvanzee March 22, 2020 17:31
@fgvanzee

Copy link
Copy Markdown
Member

@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.)

@fgvanzee

Copy link
Copy Markdown
Member

@devinamatthews Just to confirm (per this #385 (comment)): this commit should reenable the intrinsics amaxv kernel disabled by e186d71? If so, I can push a commit to this PR and then squash-merge.

@devinamatthews

Copy link
Copy Markdown
Member Author

@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.
@fgvanzee
fgvanzee merged commit 492a736 into master Mar 24, 2020
@fgvanzee
fgvanzee deleted the vector-amaxv branch March 26, 2020 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect amaxv results

2 participants