-
Notifications
You must be signed in to change notification settings - Fork 151
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
Vector: add constructor taking an element reference #286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I am still not sure however, if there could be any implications. Having this ctor seems so straight forward to me, that there might have been a reason to not include it. I would like to have a second opinion before merging this.
Shouldn't this come with a unit test before merging? |
Absolutely right! @amyspark could you please add a small unit test as well? Something similar to the snippet you present here. Thank you! |
Hey! I'm trying to find which unit test location fits this case, but I've not been able to yet. |
I agree with Bernhard that there may have been a reason not to include the constructor, e.g. to avoid enabling automatic conversions that are detrimental to performance and/or ambiguities about which constructor to use. However, if it is added as explicit, it is probably ok. |
I see only passes at http://cdash.cern.ch/index.php?project=Vc, anyone knows what's going on with CI? |
We are looking into why the CI is showing the builds as failed. We should get this sorted out next week. |
@amadio any news as to CDash? |
We think it's an issue with GitHub Actions itself. Nothing has changed on the CI configuration on our side. If GitHub Actions shows failures but we know from CDash that the builds actually passed, we can go ahead and merge the changes. I restarted the jobs to see if it will make any difference. |
It seems it's a known issue with CTest: https://gitlab.kitware.com/cmake/cmake/-/issues/20975 |
I've pushed a commit that should resolve those two warnings that appear on CDash. |
I think I have sorted out the CI issues: #297. You can rebase once the fix is merged. |
@amyspark please rebase on 1.4 again. |
@amyspark I think we might also need to add the new overload to |
df4ae99
to
0da0cce
Compare
@@ -119,8 +119,7 @@ namespace AVX | |||
{ | |||
#ifdef Vc_IMPL_AVX2 | |||
#if defined Vc_ICC || defined Vc_MSVC | |||
__m256i allone; | |||
allone = _mm256_cmpeq_epi8(allone, allone); | |||
__m256i allone = _mm256_set1_epi64x(~0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we go with this for all compilers and remove the ifdefs? I think it should be optimal in all cases, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends. I read somewhere that sometimes generating the constant is faster than reading a value from static memory. So we would need to check the generated code whether ~0
is stored in the static data or computed. But then, you are the expert on such matter, so I take your recommendation ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's computed for the other compilers, and I think that's actually ok, because at most that takes a few cycles, so it's like loading from L1. Loading from memory can be fast, or not, depending on where you're loading from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use this implementation on all compilers now, but in a separate PR: #299.
Hi again!
This MR fixes #256. Tested with the following example under MSVC 19.29.30038.1: