Skip to content
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

cannot initialize a parameter of type 'float32x4_t' (vector of 4 'float32_t' values) with an lvalue of type '__m128d' (aka 'float64x2_t') #7

Open
XapaJIaMnu opened this issue Sep 19, 2023 · 5 comments

Comments

@XapaJIaMnu
Copy link

I am not quite sure where this error comes from tbh. I'm trying to compile this fork https://github.com/browsermt/marian-dev with the latest simd_utils and I suddenly get this regression. This is running on M1, if that makes any difference.

In file included from /Users/nick/marian-dev/src/common/binary.cpp:6:
In file included from /Users/nick/marian-dev/src/tensors/cpu/integer_common.h:4:
In file included from /Users/nick/marian-dev/src/tensors/tensor_operators.h:20:
In file included from /Users/nick/marian-dev/src/tensors/cpu/add.h:8:
In file included from /Users/nick/marian-dev/src/functional/functional.h:7:
In file included from /Users/nick/marian-dev/src/functional/operators.h:219:
In file included from /Users/nick/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27:
In file included from /Users/nick/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19:
In file included from /Users/nick/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11:
/Users/nick/marian-dev/src/3rd_party/simd_utils/sse2neon.h:5537:33: error: cannot initialize a parameter of type 'float32x4_t' (vector of 4 'float32_t' values) with an lvalue of type '__m128d' (aka 'float64x2_t')
    __builtin_nontemporal_store(a, (float32x4_t *) p);
                                ^
1 error generated.
make[2]: *** [src/CMakeFiles/marian.dir/common/binary.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/marian.dir/all] Error 2
make: *** [all] Error 2
@XapaJIaMnu
Copy link
Author

It seems to have been fixed by 72a657b and then reverted?

@JishinMaster
Copy link
Owner

Yes, my bad, @jerinphilip did not propose the fix to sse2neon, so pulling the latest version reintroduced the problem.
I have manually patched the sse2neon.h.

@JoachimSchurig
Copy link
Contributor

I have created a PR for sse2neon: https://github.com/DLTcollab/sse2neon/pull/614
My proposed fix is to cast to the derived type __m128d instead of one of the underlying types, as those would change depending on the platform.
The problem arises once -flax-vector-conversions is set to anything than the clang default. Marian-dev indeed sets -flax-vector-conversion and therefore triggers the issue.

@JoachimSchurig
Copy link
Contributor

@JishinMaster my PR for sse2neon has been accepted. It would be great if you could update sse2neon one more time.
Thank you very much!

@vrnmthr
Copy link
Contributor

vrnmthr commented Oct 26, 2023

@JishinMaster I have updated sse2neon to include @JoachimSchurig's fix here #8. please take a look when you get a chance.

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

No branches or pull requests

4 participants