JishinMaster / simd_utils

A header only library implementing common mathematical functions using SIMD intrinsics
BSD 2-Clause "Simplified" License
93 stars 21 forks source link

Multiple definitions regression #6

Open XapaJIaMnu opened 1 year ago

XapaJIaMnu commented 1 year ago

Trying to upgrade I have some multiple definition issue:

In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:74:22: error: redefinition of ‘__m128i _mm_aesdec_si128(__m128i, __m128i)’
   74 | FORCE_INLINE __m128i _mm_aesdec_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon.h:8969:22: note: ‘__m128i _mm_aesdec_si128(__m128i, __m128i)’ previously defined here
 8969 | FORCE_INLINE __m128i _mm_aesdec_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:79:22: error: redefinition of ‘__m128i _mm_aesdeclast_si128(__m128i, __m128i)’
   79 | FORCE_INLINE __m128i _mm_aesdeclast_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon.h:8989:22: note: ‘__m128i _mm_aesdeclast_si128(__m128i, __m128i)’ previously defined here
 8989 | FORCE_INLINE __m128i _mm_aesdeclast_si128(__m128i a, __m128i RoundKey)
      |                      ^~~~~~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:84:16: error: redefinition of ‘__m128i _mm_aesimc_si128(__m128i)’
   84 | inline __m128i _mm_aesimc_si128(__m128i a)
      |                ^~~~~~~~~~~~~~~~
In file included from /home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon_wrapper.h:11,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils_constants.h:19,
                 from /home/nik/marian-dev/src/3rd_party/simd_utils/simd_utils.h:27,
                 from /home/nik/marian-dev/src/3rd_party/faiss/VectorTransform.cpp:23:
/home/nik/marian-dev/src/3rd_party/simd_utils/sse2neon.h:8998:22: note: ‘__m128i _mm_aesimc_si128(__m128i)’ previously defined here
 8998 | FORCE_INLINE __m128i _mm_aesimc_si128(__m128i a)

However when using 6960362584481c977cdae9f6a8f7061a37c766cb this problem doesn't appear. Ideas?

JishinMaster commented 1 year ago

The latest commit should fix this (Thanks to @JoachimSchurig). sse2neon now inlcudes aes intrinsics. I do not see the link between that and the _mm_stream_pd function. It seems @jerinphilip did not propose this patch to sse2neon directly yet. I have reapplied the fix.

XapaJIaMnu commented 1 year ago

Do those patches need to be proposed to the sse2neon project explicitly?

JishinMaster commented 1 year ago

For the AES ones they are now included in the sse2neon project. The _mm_stream_pd patch could be directly proposed to sse2neon.