Skip to content

Commit

Permalink
Merge pull request #86 from abhi-agg/wasm-preprocessor-cleanup
Browse files Browse the repository at this point in the history
Replaced __EMSCRIPTEN__ with WASM preprocessor directive
  • Loading branch information
kpu authored Apr 6, 2021
2 parents d365768 + ed88137 commit 47ab01a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ if (USE_OPENMP)
target_link_libraries(intgemm PUBLIC OpenMP::OpenMP_CXX)
endif()

if (COMPILE_WASM)
# A compile defintion to compile intgemm on WASM platform
target_compile_definitions(intgemm PUBLIC WASM)
endif()

option(WORMHOLE "Use WASM wormhole https://bugzilla.mozilla.org/show_bug.cgi?id=1672160" OFF)
if (WORMHOLE)
target_compile_definitions(intgemm PUBLIC INTGEMM_WORMHOLE)
Expand Down
8 changes: 4 additions & 4 deletions intgemm/intgemm.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include "avx512_gemm.h"
#include "avx512vnni_gemm.h"

#if defined(__EMSCRIPTEN__)
#if defined(WASM)
// No header for CPUID since it's hard-coded.
#elif defined(__INTEL_COMPILER)
#include <immintrin.h>
Expand Down Expand Up @@ -171,15 +171,15 @@ template <class T> T ChooseCPU(T
avx2
#endif
, T ssse3, T
#ifndef __EMSCRIPTEN__
#ifndef WASM
sse2
#endif
, T
#ifndef __EMSCRIPTEN__
#ifndef WASM
unsupported
#endif
) {
#if defined(__EMSCRIPTEN__)
#if defined(WASM)
// emscripten does SSE4.1 but we only use up to SSSE3.
return ssse3;
#elif defined(__INTEL_COMPILER)
Expand Down

0 comments on commit 47ab01a

Please sign in to comment.