Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions onnxruntime/core/providers/cpu/nn/conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "core/common/safeint.h"
#include "core/util/math_cpuonly.h"

#if defined(USE_KLEIDIAI) && defined(__aarch64__) && defined(__linux__)
#if defined(USE_KLEIDIAI) && defined(__aarch64__)
#include "core/mlas/lib/kleidiai/mlasi_kleidiai.h"
#endif

Expand Down Expand Up @@ -191,7 +191,7 @@ Status Conv<T>::Compute(OpKernelContext* context) const {
return Status::OK();
}

#if defined(USE_KLEIDIAI) && defined(__aarch64__) && defined(__linux__)
#if defined(USE_KLEIDIAI) && defined(__aarch64__)
Status Conv<float>::EnsurePackedChannelsLastFilter(concurrency::ThreadPool* thread_pool,
size_t filter_count_per_group,
size_t input_channels_per_group,
Expand Down Expand Up @@ -329,7 +329,7 @@ Status Conv<float>::Compute(OpKernelContext* context) const {
narrow<size_t>(M / conv_attrs_.group),
/*Beta*/ 0.0f);

#if defined(USE_KLEIDIAI) && defined(__aarch64__) && defined(__linux__)
#if defined(USE_KLEIDIAI) && defined(__aarch64__)
if (nhwc_fastpath && can_cache_packed_filter_) {
ORT_RETURN_IF_ERROR(EnsurePackedChannelsLastFilter(thread_pool,
narrow<size_t>(M / conv_attrs_.group),
Expand Down Expand Up @@ -385,7 +385,7 @@ Status Conv<float>::Compute(OpKernelContext* context) const {
nhwc_fastpath ? 0.0f : Beta,
thread_pool);

#if defined(USE_KLEIDIAI) && defined(__aarch64__) && defined(__linux__)
#if defined(USE_KLEIDIAI) && defined(__aarch64__)
if (nhwc_fastpath && packed_filter_ != nullptr) {
Parameters.FilterIsPacked = true;
Parameters.PackedFilter = packed_filter_.get();
Expand Down
4 changes: 2 additions & 2 deletions onnxruntime/core/providers/cpu/nn/conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Conv<float> : public OpKernel {
activation_.ActivationKind = MlasIdentityActivation;
SetupMlasBackendKernelSelectorFromConfigOptions(mlas_backend_kernel_selector_config_, info.GetConfigOptions());

#if defined(USE_KLEIDIAI) && defined(__aarch64__) && defined(__linux__)
#if defined(USE_KLEIDIAI) && defined(__aarch64__)
if (channels_last_) {
const auto& input_defs = info.node().InputDefs();
const bool has_bias_input = input_defs.size() >= 3 && input_defs[2] != nullptr;
Expand All @@ -56,7 +56,7 @@ class Conv<float> : public OpKernel {
ConvAttributes conv_attrs_;
bool channels_last_{false};

#if defined(USE_KLEIDIAI) && defined(__aarch64__) && defined(__linux__)
#if defined(USE_KLEIDIAI) && defined(__aarch64__)
private:
Status EnsurePackedChannelsLastFilter(concurrency::ThreadPool* thread_pool,
size_t filter_count_per_group,
Expand Down