Skip to content

Conversation

@G-071
Copy link
Member

@G-071 G-071 commented Apr 20, 2020

There is a compilation error when building datadriven with ARCH=avx512 on a skylake CPU (tested with Xeon(R) Gold 6140 CPU).

            error: '_mm512_set_1to8_pd' was not declared in this scope

Fixing the compilation is simple enough: Switch from this instruction _mm512_set_1to8_pd to _mm512_set1_pd.
Unlike 1to8 this instruction actually also shows up in the Intel Intrinsics Guide.

I assume the 1to8 instruction is left over from the original KNC MIC implementation. This would also coincide with the git history of that file (and with the fact that is hard to come by any information about this instruction). For legacy/reproducibility purposes I have left it in there for builds with MICs and use set1 for all other builds!

@G-071 G-071 requested a review from leiterrl April 20, 2020 22:43
@spc90
Copy link
Member

spc90 commented Apr 21, 2020

@G-071 If you look for other instances of this intrinsic you will find it in another 3 files, in all of which you have it defined based on _mm512_set1_pd already for MIC:

#define _mm512_set1_pd(A) _mm512_set_1to8_pd(A)

It should be part of a block of definitions for MIC specifically, which seems to be lacking in this particular file only, as it exists in the other 3. I haven't checked the history to confirm whether this is something someone deleted at some point, or it wasn't there to begin with. Anyway, I would think it is more appropriate to replicate those defines in this file as well, instead of the change you propose, if you want to keep the "spirit" of the original code :) Plus that block with defines in the other files covers more than this 1 intrinsic.

@G-071
Copy link
Member Author

G-071 commented Apr 21, 2020

Fair enough, I have added it to the MIC definition block.

There was actually one in the file already, it was just missing this one definition - the usual results of duplicating code across multiple files and modifying it later on. This MIC definition block should have been in its own header in the first place, but since I highly suspect we won't be writing any new MIC code in the future I don't think we need to bother about that!

@leiterrl Can you take a look at it? I'd like to add this patch to the spack package PR and it would be nice to have it in master before that!

Copy link
Member

@leiterrl leiterrl left a comment

Choose a reason for hiding this comment

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

LGTM

@G-071 G-071 merged commit f5aadbc into master Apr 22, 2020
@G-071 G-071 deleted the fix_datadriven_avx512_compilation branch April 22, 2020 13:08
@leiterrl leiterrl added this to the v3.4.0 milestone Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants