Bug 1829798 - Activate gemmology on aarch64 r=yury

Differential Revision: https://phabricator.services.mozilla.com/D176394
This commit is contained in:
serge-sans-paille 2023-05-10 07:32:47 +00:00
parent 71e2c4ea64
commit 29fb09d2f1
5 changed files with 30 additions and 2 deletions

View File

@ -941,7 +941,7 @@ def wasm_moz_intgemm(value, target, no_experimental):
if no_experimental:
return
if value and target.cpu in ("x86", "x86_64"):
if value and target.cpu in ("x86", "x86_64", "aarch64"):
return True

View File

@ -27,6 +27,8 @@
# define SUPPORTED_ARCHS xsimd::arch_list<xsimd::ssse3, xsimd::sse2>
#elif defined(USE_SSE2)
# define SUPPORTED_ARCHS xsimd::arch_list<xsimd::sse2>
#elif defined(USE_NEON) and defined(XSIMD_WITH_NEON64)
# define SUPPORTED_ARCHS xsimd::arch_list<xsimd::neon64>
#else
# error no supported architecture
#endif

View File

@ -38,6 +38,13 @@ if CONFIG["INTEL_ARCHITECTURE"]:
"/third_party/gemmology/kernels/GemmologyEngineAVX2.cpp"
].flags += CONFIG["AVX2_FLAGS"]
if CONFIG["CPU_ARCH"] == "aarch64":
DEFINES["USE_NEON"] = True
SOURCES += ["/third_party/gemmology/kernels/GemmologyEngineNeon64.cpp"]
SOURCES["/third_party/gemmology/kernels/GemmologyEngineNeon64.cpp"].flags += CONFIG[
"NEON_FLAGS"
]
SOURCES += [
"IntegerGemmIntrinsic.cpp",
]

View File

@ -1 +1 @@
|jit-test| --wasm-moz-intgemm; skip-if: (!getBuildConfiguration().x64 && !getBuildConfiguration().x86) || getBuildConfiguration().simulator || !wasmMozIntGemmEnabled()
|jit-test| --wasm-moz-intgemm; skip-if: (!getBuildConfiguration().x64 && !getBuildConfiguration().x86 && !getBuildConfiguration().arm64) || getBuildConfiguration().simulator || !wasmMozIntGemmEnabled()

View File

@ -0,0 +1,19 @@
/* -*- mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* this source code form is subject to the terms of the mozilla public
* license, v. 2.0. if a copy of the mpl was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <gemmology.h>
namespace gemmology {
template struct Engine<xsimd::neon64>;
template void Engine<xsimd::neon64>::SelectColumnsB(int8_t const*, int8_t*,
size_t, uint32_t const*,
uint32_t const*);
template void Engine<xsimd::neon64>::Shift::Multiply(
uint8_t const*, int8_t const*, size_t, size_t, size_t,
gemmology::callbacks::UnquantizeAndAddBiasAndWrite);
template void Engine<xsimd::neon64>::Shift::PrepareBias(
int8_t const*, size_t, size_t,
gemmology::callbacks::UnquantizeAndAddBiasAndWrite);
} // namespace gemmology