diff --git a/onnxruntime/contrib_ops/cpu/quantization/quant_gemm.cc b/onnxruntime/contrib_ops/cpu/quantization/quant_gemm.cc index 91aca25ede..2bd8c3ff6b 100644 --- a/onnxruntime/contrib_ops/cpu/quantization/quant_gemm.cc +++ b/onnxruntime/contrib_ops/cpu/quantization/quant_gemm.cc @@ -5,7 +5,7 @@ #include "core/providers/cpu/math/gemm_base.h" #include "core/providers/cpu/math/gemm_helper.h" #include "core/providers/cpu/math/matmul_integer_base.h" -#include "core/quantization/quant_util.h" +#include "core/quantization/quantization.h" #include "core/util/math_cpuonly.h" namespace onnxruntime { diff --git a/onnxruntime/core/providers/cpu/math/matmul_integer_base.h b/onnxruntime/core/providers/cpu/math/matmul_integer_base.h index 8cb66b9361..8010eae3a8 100644 --- a/onnxruntime/core/providers/cpu/math/matmul_integer_base.h +++ b/onnxruntime/core/providers/cpu/math/matmul_integer_base.h @@ -4,7 +4,7 @@ #include "core/framework/op_kernel.h" #include "core/mlas/inc/mlas.h" #include "core/providers/common.h" -#include "core/quantization/quant_util.h" +#include "core/quantization/quantization.h" namespace onnxruntime { diff --git a/onnxruntime/core/quantization/quant_util.h b/onnxruntime/core/quantization/quant_util.h deleted file mode 100644 index 7020fe2daa..0000000000 --- a/onnxruntime/core/quantization/quant_util.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -#pragma once - -#include "core/common/common.h" -#include "core/mlas/inc/mlas.h" -#include "core/framework/allocator.h" -#include "core/framework/buffer_deleter.h" - -namespace onnxruntime { -namespace quantization { -// Transpose the input and store it to a new allocated buffer -inline uint8_t* TransPoseInputData(const uint8_t* input, BufferUniquePtr& buffer_holder, AllocatorPtr& allocator, size_t M, size_t N) { - uint8_t* output = static_cast(allocator->Alloc(M * N * sizeof(uint8_t))); - MlasTranspose(input, output, M, N); - buffer_holder.reset(output); - return output; -} - -} // namespace quantization -} // namespace onnxruntime diff --git a/onnxruntime/core/quantization/quantization.h b/onnxruntime/core/quantization/quantization.h index 834ac76fff..eb6d640866 100644 --- a/onnxruntime/core/quantization/quantization.h +++ b/onnxruntime/core/quantization/quantization.h @@ -186,5 +186,17 @@ void Dequantize(const std::vector& values, Dequantize(values.data(), output.data(), params, values.size()); } +// Transpose the input and store it to a new allocated buffer. +inline uint8_t* TransPoseInputData(const uint8_t* input, + BufferUniquePtr& buffer_holder, + AllocatorPtr& allocator, + size_t M, + size_t N) { + uint8_t* output = static_cast(allocator->Alloc(M * N * sizeof(uint8_t))); + MlasTranspose(input, output, M, N); + buffer_holder.reset(output); + return output; +} + } // namespace quantization } // namespace onnxruntime