Skip to content

Commit 1b81f45

Browse files
committed
refactor: replace PCM_CPU_FAMILY_MODEL macro with constexpr function
Change-Id: Ifcebbed44cc78a8e35728fe6cdb7a2610f926f8a
1 parent 377c87a commit 1b81f45

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cpucounters.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ typedef SimpleCounterState IDXCounterState;
584584

585585
typedef std::vector<uint64> eventGroup_t;
586586

587+
inline constexpr int PCM_CPU_FAMILY_MODEL(int family_, int model_)
588+
{
589+
return ((family_) << 8) + (model_);
590+
}
591+
587592
class PerfVirtualControlRegister;
588593

589594
/*!
@@ -1896,8 +1901,6 @@ class PCM_API PCM
18961901
*/
18971902
static int getCPUFamilyModelFromCPUID();
18981903

1899-
#define PCM_CPU_FAMILY_MODEL(family_, model_) (((family_) << 8) + (model_))
1900-
19011904
//! \brief Identifiers of supported CPU models
19021905
enum SupportedCPUModels
19031906
{

0 commit comments

Comments
 (0)