mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-02 03:55:34 +00:00
Fix LARCH64 compile error (#22759)
### Description Currently loongarch has not implemented AIsSigned qgemm, so I added bypass for it
This commit is contained in:
parent
75a44582ba
commit
fd5b1a18ee
3 changed files with 8 additions and 3 deletions
|
|
@ -867,7 +867,7 @@ MlasGemmQuantGetDispatch(
|
|||
{
|
||||
const MLAS_GEMM_QUANT_DISPATCH* GemmQuantDispatch = &MlasGemmQuantDispatchDefault;
|
||||
|
||||
#if defined(MLAS_TARGET_AMD64_IX86) || defined(MLAS_TARGET_LARCH64)
|
||||
#if defined(MLAS_TARGET_AMD64_IX86)
|
||||
if (AIsSigned) {
|
||||
GemmQuantDispatch =
|
||||
BIsSigned ? GetMlasPlatform().GemmS8S8Dispatch : GetMlasPlatform().GemmS8U8Dispatch;
|
||||
|
|
@ -895,6 +895,11 @@ MlasGemmQuantGetDispatch(
|
|||
if (GetMlasPlatform().GemmU8X8Dispatch == &MlasGemm8X8DispatchPOWER10) {
|
||||
GemmQuantDispatch = GetMlasPlatform().GemmU8X8Dispatch;
|
||||
}
|
||||
#elif defined(MLAS_TARGET_LARCH64)
|
||||
if (!AIsSigned) {
|
||||
GemmQuantDispatch =
|
||||
BIsSigned ? GetMlasPlatform().GemmU8S8Dispatch : GetMlasPlatform().GemmU8U8Dispatch;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (nullptr == GemmQuantDispatch) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ TEST(AllocatorTest, CPUAllocatorTest) {
|
|||
EXPECT_EQ(cpu_arena->Info().id, 0);
|
||||
|
||||
// arena is disabled for CPUExecutionProvider on x86 and JEMalloc
|
||||
#if (defined(__amd64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(_M_ARM64)) && !defined(USE_JEMALLOC) && !defined(USE_MIMALLOC) && !defined(ABSL_HAVE_ADDRESS_SANITIZER)
|
||||
#if (defined(__amd64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(__loongarch__) || defined(_M_ARM64)) && !defined(USE_JEMALLOC) && !defined(USE_MIMALLOC) && !defined(ABSL_HAVE_ADDRESS_SANITIZER)
|
||||
EXPECT_EQ(cpu_arena->Info().alloc_type, OrtAllocatorType::OrtArenaAllocator);
|
||||
#else
|
||||
EXPECT_EQ(cpu_arena->Info().alloc_type, OrtAllocatorType::OrtDeviceAllocator);
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ TEST(TensorTest, EmptyTensorTest) {
|
|||
EXPECT_EQ(location.id, 0);
|
||||
|
||||
// arena is disabled for CPUExecutionProvider on x86 and JEMalloc
|
||||
#if (defined(__amd64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(_M_ARM64)) && !defined(USE_JEMALLOC) && !defined(USE_MIMALLOC) && !defined(ABSL_HAVE_ADDRESS_SANITIZER)
|
||||
#if (defined(__amd64__) || defined(_M_AMD64) || defined(__aarch64__) || defined(__loongarch__) || defined(_M_ARM64)) && !defined(USE_JEMALLOC) && !defined(USE_MIMALLOC) && !defined(ABSL_HAVE_ADDRESS_SANITIZER)
|
||||
EXPECT_EQ(location.alloc_type, OrtAllocatorType::OrtArenaAllocator);
|
||||
#else
|
||||
EXPECT_EQ(location.alloc_type, OrtAllocatorType::OrtDeviceAllocator);
|
||||
|
|
|
|||
Loading…
Reference in a new issue