Skip to content

Commit

Permalink
Apply formating
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDuplensky committed Dec 14, 2024
1 parent 97d0240 commit 4bd7cfc
Show file tree
Hide file tree
Showing 65 changed files with 3,665 additions and 3,016 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:
- name: Install clang-format-15
run: |
sudo apt update
sudo apt --assume-yes install clang-format-15
sudo apt --assume-yes install binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu scons clang-format-15
# Run cmake with -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT in order to enable codestyle check for ITT collector
- name: CMake configure
run: cmake -DENABLE_PYTHON=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/clang-aarch64.toolchain.cmake -B build_aarch64
run: cmake -DENABLE_CLANG_FORMAT=ON -DENABLE_TESTS=ON -DENABLE_PROFILING_ITT=ON -DSELECTIVE_BUILD=COLLECT -DCMAKE_TOOLCHAIN_FILE=cmake/clang-aarch64.toolchain.cmake -B build_aarch64

- name: Create code style diff
run: cmake --build build_aarch64 --target clang_format_fix_all -j8
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,47 @@ namespace aarch64 {

class jit_convert_emitter : public jit_emitter {
public:
jit_convert_emitter(dnnl::impl::cpu::aarch64::jit_generator *host, dnnl::impl::cpu::aarch64::cpu_isa_t host_isa,
const std::shared_ptr<ov::Node>& n, ov::element::Type exec_prc = ov::element::f32);
jit_convert_emitter(dnnl::impl::cpu::aarch64::jit_generator* host,
dnnl::impl::cpu::aarch64::cpu_isa_t host_isa,
const std::shared_ptr<ov::Node>& n,
ov::element::Type exec_prc = ov::element::f32);

size_t get_inputs_count() const override;

protected:
void emit_data() const override;
void validate_types() const;
template <typename TReg>
void jit_convert_process(const TReg &src, const TReg &dst, ov::element::Type input_type, ov::element::Type output_type,
void jit_convert_process(const TReg& src,
const TReg& dst,
ov::element::Type input_type,
ov::element::Type output_type,
bool is_saturated) const;

ov::element::Type input_type;
ov::element::Type output_type;

private:
template <typename TReg>
inline void cvt_f16_to_f32(const TReg &src, const TReg &dst) const;
inline void cvt_f16_to_f32(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_f32_to_f16(const TReg &src, const TReg &dst) const;
inline void cvt_f32_to_f16(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_f32_to_i32(const TReg &src, const TReg &dst) const;
inline void cvt_f32_to_i32(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_i32_to_f32(const TReg &src, const TReg &dst) const;
inline void cvt_i32_to_f32(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_i32_to_i16(const TReg &src, const TReg &dst, bool is_saturated) const;
inline void cvt_i32_to_i16(const TReg& src, const TReg& dst, bool is_saturated) const;
template <typename TReg>
inline void cvt_i16_to_i32(const TReg &src, const TReg &dst) const;
inline void cvt_i16_to_i32(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_f16_to_i16(const TReg &src, const TReg &dst) const;
inline void cvt_f16_to_i16(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_i16_to_f16(const TReg &src, const TReg &dst) const;
inline void cvt_i16_to_f16(const TReg& src, const TReg& dst) const;
template <typename TReg>
inline void cvt_i16_to_byte(const TReg &src, const TReg &dst, bool is_signed, bool is_saturated) const;
inline void cvt_i16_to_byte(const TReg& src, const TReg& dst, bool is_signed, bool is_saturated) const;
template <typename TReg>
inline void cvt_byte_to_i16(const TReg &src, const TReg &dst, bool is_signed) const;
inline void cvt_byte_to_i16(const TReg& src, const TReg& dst, bool is_signed) const;
};

// This emitter is covered by specification of "Convert" operation. The implementation uses a "warp-around" conversion.
Expand All @@ -56,13 +61,15 @@ class jit_convert_emitter : public jit_emitter {
// 129 -> -127
class jit_convert_truncation_emitter : public jit_convert_emitter {
public:
jit_convert_truncation_emitter(dnnl::impl::cpu::aarch64::jit_generator *host, dnnl::impl::cpu::aarch64::cpu_isa_t host_isa,
const std::shared_ptr<ov::Node>& n, ov::element::Type exec_prc = ov::element::f32);
jit_convert_truncation_emitter(dnnl::impl::cpu::aarch64::jit_generator* host,
dnnl::impl::cpu::aarch64::cpu_isa_t host_isa,
const std::shared_ptr<ov::Node>& n,
ov::element::Type exec_prc = ov::element::f32);

private:
void emit_impl(const std::vector<size_t>& in_idxs, const std::vector<size_t>& out_idxs) const override;
template <dnnl::impl::cpu::aarch64::cpu_isa_t isa>
void emit_isa(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs) const;
void emit_isa(const std::vector<size_t>& in_idxs, const std::vector<size_t>& out_idxs) const;
};

// This emitter is covered by the common dnnl behavior. The implementation uses a "saturation" conversion.
Expand All @@ -71,15 +78,17 @@ class jit_convert_truncation_emitter : public jit_convert_emitter {
// 129 -> 127
class jit_convert_saturation_emitter : public jit_convert_emitter {
public:
jit_convert_saturation_emitter(dnnl::impl::cpu::aarch64::jit_generator *host, dnnl::impl::cpu::aarch64::cpu_isa_t host_isa,
const std::shared_ptr<ov::Node>& n, ov::element::Type exec_prc = ov::element::f32);
jit_convert_saturation_emitter(dnnl::impl::cpu::aarch64::jit_generator* host,
dnnl::impl::cpu::aarch64::cpu_isa_t host_isa,
const std::shared_ptr<ov::Node>& n,
ov::element::Type exec_prc = ov::element::f32);

private:
void emit_impl(const std::vector<size_t>& in_idxs, const std::vector<size_t>& out_idxs) const override;
template <dnnl::impl::cpu::aarch64::cpu_isa_t isa>
void emit_isa(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs) const;
void emit_isa(const std::vector<size_t>& in_idxs, const std::vector<size_t>& out_idxs) const;
};

} // namespace aarch64
} // namespace intel_cpu
} // namespace ov
} // namespace aarch64
} // namespace intel_cpu
} // namespace ov
Loading

0 comments on commit 4bd7cfc

Please sign in to comment.