Mercurial > hg > orthanc-stone
diff OrthancStone/Sources/Toolbox/SimdIncludes.h @ 2069:5956d7357098 deep-learning
macro ORTHANC_HAS_WASM_SIMD has to be manually defined
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 19 May 2023 17:00:17 +0200 |
parents | 22a83fb9dd23 |
children |
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/SimdIncludes.h Wed May 17 17:30:52 2023 +0200 +++ b/OrthancStone/Sources/Toolbox/SimdIncludes.h Fri May 19 17:00:17 2023 +0200 @@ -41,10 +41,19 @@ # define ORTHANC_HAS_WASM_SIMD 0 # define ORTHANC_MEMORY_ALIGNMENT 16 #elif defined(__EMSCRIPTEN__) +# if !defined(ORTHANC_HAS_WASM_SIMD) +# error ORTHANC_HAS_WASM_SIMD must be defined to use this file +# endif # define ORTHANC_HAS_AVX2 0 # define ORTHANC_HAS_SSE2 0 -# define ORTHANC_HAS_WASM_SIMD 1 -# define ORTHANC_MEMORY_ALIGNMENT 16 +# if ORTHANC_HAS_WASM_SIMD == 1 +// Setting macro "ORTHANC_HAS_WASM_SIMD" to "1" means that +// "-msimd128" has been provided to Emscripten (there doesn't seem +// to exist a predefined macro to automatically check this) +# define ORTHANC_MEMORY_ALIGNMENT 16 +# else +# define ORTHANC_MEMORY_ALIGNMENT 8 +# endif #elif defined(_MSC_VER) # if _M_IX86_FP >= 2 // https://stackoverflow.com/a/18563988 # define ORTHANC_HAS_AVX2 0