Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
chenhu-wang committed Sep 8, 2023
1 parent ee6b575 commit ac97b6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ using namespace dnnl::impl::cpu::x64;
using namespace Xbyak;
using namespace Xbyak::util;

// if CHRONO_CALL is defined, use std::chrono::high_resolution_clock as timer, otherwise read tsc as cycle counters
#define CHRONO_CALL

namespace ov {
namespace intel_cpu {

Expand Down
12 changes: 10 additions & 2 deletions src/plugins/intel_cpu/src/emitters/x64/jit_perf_count_emitters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include "jit_emitter.hpp"
#include <cpu/x64/jit_generator.hpp>

// if CHRONO_CALL is defined, use std::chrono::high_resolution_clock as timer
// otherwise uncomment below line to read tsc as cycle counters
#define CHRONO_CALL

namespace ov {
namespace intel_cpu {

Expand All @@ -18,9 +22,11 @@ class jit_perf_count_start_emitter : public jit_emitter {

private:
void emit_impl(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs) const override;

#ifdef CHRONO_CALL
mutable std::chrono::high_resolution_clock::time_point* m_current_time = nullptr;
#else
mutable uint64_t* m_current_count = nullptr;
#endif
};

class jit_perf_count_end_emitter : public jit_emitter {
Expand All @@ -32,9 +38,11 @@ class jit_perf_count_end_emitter : public jit_emitter {
private:
// use start in emit_impl
void emit_impl(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs) const override;

#ifdef CHRONO_CALL
mutable std::chrono::high_resolution_clock::time_point* m_start = nullptr;
#else
mutable uint64_t* m_start_count = nullptr;
#endif
mutable uint64_t* m_accumulation = nullptr;
mutable uint32_t* m_iteration = nullptr;
};
Expand Down

0 comments on commit ac97b6e

Please sign in to comment.