Skip to content

Commit

Permalink
[Snippets][CPU] Fixed build on non-x64 platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Dec 23, 2024
1 parent 2b536b7 commit f2523ef
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "snippets/lowered/loop_manager.hpp"
#include "snippets/utils/utils.hpp"

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
# include "transformations/snippets/x64/pass/lowered/brgemm_copy_b_loop_ports_adjuster.hpp"
# include "transformations/snippets/x64/pass/lowered/external_repacking_adjuster.hpp"
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "emitters/snippets/jit_snippets_call_args.hpp"

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
# include "emitters/snippets/x64/kernel_executors/brgemm_copy_b.hpp"
#endif

Expand All @@ -27,7 +27,7 @@ class CPURuntimeConfig : public ov::snippets::RuntimeConfig {
std::string to_string() const override;
#endif

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
struct RepackedInput {
RepackedInput() = default;
RepackedInput(CpuBlockedMemoryDescPtr desc_,
Expand All @@ -52,7 +52,7 @@ class CPURuntimeConfig : public ov::snippets::RuntimeConfig {
SEPARATE, // should be separathy from kernel executed
};
RepackingImplType repacking_impl_type = RepackingImplType::NONE;
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64

std::vector<jit_snippets_call_args::loop_args_t> loop_args = {};
};
Expand Down
28 changes: 14 additions & 14 deletions src/plugins/intel_cpu/src/nodes/subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ class SubgraphStaticExecutor : public Subgraph::SubgraphExecutor {
};

auto caller = [&](jit_snippets_call_args& call_args, const std::vector<size_t>& indexes, size_t ithr) {
#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
if (should_repacking_be_in_parallel())
in_parallel_repack_inputs(inMemPtrs, indexes, ithr, call_args);
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
callable(&call_args, indexes.data());
};

Expand Down Expand Up @@ -171,10 +171,10 @@ class SubgraphDynamicSpecializedExecutor : public Subgraph::SubgraphExecutor {

auto caller = [&](jit_snippets_call_args& call_args, const std::vector<size_t>& indexes, size_t ithr) {
update_ptrs(call_args, src_ptrs, dst_ptrs, indexes);
#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
if (should_repacking_be_in_parallel())
in_parallel_repack_inputs(inMemPtrs, indexes, ithr, call_args);
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
callable(&call_args);
};

Expand Down Expand Up @@ -982,7 +982,7 @@ Subgraph::SubgraphExecutor::SubgraphExecutor(const std::shared_ptr<Subgraph::Sub
"Undefined buffer scratchpad size!");
m_internal_buffer_size = static_cast<size_t>(m_nthreads) * m_buffer_scratchpad_size;

#if defined(OPENVINO_ARCH_X86_64)
#ifndef OPENVINO_ARCH_ARM64
m_repacking_impl_type = snippet_config->repacking_impl_type;
m_repacked_inputs = snippet_config->repacked_inputs;

Expand All @@ -1007,7 +1007,7 @@ Subgraph::SubgraphExecutor::SubgraphExecutor(const std::shared_ptr<Subgraph::Sub

#else
const auto external_buffer_size = 0lu;
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
m_buffer_scratchpad = allocator(m_internal_buffer_size + external_buffer_size);

#if defined(__linux__) && defined(OPENVINO_ARCH_X86_64) && defined(SNIPPETS_DEBUG_CAPS)
Expand All @@ -1017,7 +1017,7 @@ Subgraph::SubgraphExecutor::SubgraphExecutor(const std::shared_ptr<Subgraph::Sub
#endif
}

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
std::vector<MemoryPtr> Subgraph::SubgraphExecutor::separately_repack_inputs(const dnnl::stream& strm,
const std::vector<MemoryPtr>& srcMemPtrs) {
auto get_batch_stride = [](const std::vector<size_t> strides) {
Expand Down Expand Up @@ -1093,7 +1093,7 @@ void Subgraph::SubgraphExecutor::in_parallel_repack_inputs(const std::vector<Mem
call_args.src_ptrs[in_idx] = repacked_ptr;
}
}
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64

#if defined(__linux__) && defined(OPENVINO_ARCH_X86_64) && defined(SNIPPETS_DEBUG_CAPS)
void Subgraph::SubgraphExecutor::segfault_detector() {
Expand Down Expand Up @@ -1155,9 +1155,9 @@ void Subgraph::SubgraphExecutor::parallel_for6d(
dom[4]);
}

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
clean_repacked_offsets(ithr);
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
});
}

Expand Down Expand Up @@ -1188,21 +1188,21 @@ void Subgraph::SubgraphExecutor::parallel_forNd(
caller(call_args, indexes, ithr);
}

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
clean_repacked_offsets(ithr);
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
});
}

void Subgraph::SubgraphExecutor::execute(const dnnl::stream& strm,
const std::vector<MemoryPtr>& inMemPtrs,
const std::vector<MemoryPtr>& outMemPtrs) {
#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
if (should_repacking_be_separately()) {
exec_impl(separately_repack_inputs(strm, inMemPtrs), outMemPtrs);
return;
}
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
exec_impl(inMemPtrs, outMemPtrs);
}

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_cpu/src/nodes/subgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Subgraph::SubgraphExecutor {
inline void segfault_detector();
#endif

#ifdef OPENVINO_ARCH_X86_64
#ifndef OPENVINO_ARCH_ARM64
std::vector<MemoryPtr> separately_repack_inputs(const dnnl::stream& strm, const std::vector<MemoryPtr>& srcMemPtrs);
void in_parallel_repack_inputs(const std::vector<MemoryPtr>& inMemPtrs,
const std::vector<size_t>& indexes,
Expand Down Expand Up @@ -214,7 +214,7 @@ class Subgraph::SubgraphExecutor {

private:
CPURuntimeConfig::RepackingImplType m_repacking_impl_type = CPURuntimeConfig::RepackingImplType::NONE;
#endif // OPENVINO_ARCH_X86_64
#endif // OPENVINO_ARCH_ARM64
};

} // namespace node
Expand Down

0 comments on commit f2523ef

Please sign in to comment.