Skip to content

Commit

Permalink
Add support for AMD Zen2 (Trento) (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTheBear authored Oct 20, 2023
1 parent 206fbfa commit f50ee71
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/access-daemon/accessDaemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,7 @@ int main(void)
case ZEN3_RYZEN:
case ZEN3_RYZEN2:
case ZEN3_RYZEN3:
case ZEN3_EPYC_TRENTO:
allowed = allowed_amd17_zen2;
break;
case ZEN4_RYZEN:
Expand Down
1 change: 1 addition & 0 deletions src/includes/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ struct topology_functions {
#define ZEN3_RYZEN 0x01
#define ZEN3_RYZEN2 0x21
#define ZEN3_RYZEN3 0x50
#define ZEN3_EPYC_TRENTO 0x30
#define ZEN4_RYZEN 0x61
#define ZEN4_EPYC 0x11

Expand Down
2 changes: 2 additions & 0 deletions src/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,7 @@ perfmon_init_maps(void)
case ZEN3_RYZEN:
case ZEN3_RYZEN2:
case ZEN3_RYZEN3:
case ZEN3_EPYC_TRENTO:
eventHash = zen3_arch_events;
perfmon_numArchEvents = perfmon_numArchEventsZen3;
counter_map = zen3_counter_map;
Expand Down Expand Up @@ -1865,6 +1866,7 @@ perfmon_init_funcs(int* init_power, int* init_temp)
case ZEN3_RYZEN:
case ZEN3_RYZEN2:
case ZEN3_RYZEN3:
case ZEN3_EPYC_TRENTO:
initThreadArch = perfmon_init_zen3;
initialize_power = TRUE;
perfmon_startCountersThread = perfmon_startCountersThread_zen3;
Expand Down
6 changes: 5 additions & 1 deletion src/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ power_init(int cpuId)
cpuid_info.model == ZENPLUS_RYZEN2 ||
cpuid_info.model == ZEN2_RYZEN ||
cpuid_info.model == ZEN2_RYZEN2 ||
cpuid_info.model == ZEN2_RYZEN3)
cpuid_info.model == ZEN2_RYZEN3 ||
cpuid_info.model == ZEN3_RYZEN ||
cpuid_info.model == ZEN3_RYZEN2 ||
cpuid_info.model == ZEN3_RYZEN3 ||
cpuid_info.model == ZEN3_EPYC_TRENTO)
{
cpuid_info.turbo = 0;
power_info.hasRAPL = 1;
Expand Down
7 changes: 1 addition & 6 deletions src/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,14 +1121,9 @@ topology_setName(void)
switch (cpuid_info.model)
{
case ZEN3_RYZEN:
cpuid_info.name = amd_zen3_str;
cpuid_info.short_name = short_zen3;
break;
case ZEN3_RYZEN2:
cpuid_info.name = amd_zen3_str;
cpuid_info.short_name = short_zen3;
break;
case ZEN3_RYZEN3:
case ZEN3_EPYC_TRENTO:
cpuid_info.name = amd_zen3_str;
cpuid_info.short_name = short_zen3;
break;
Expand Down

0 comments on commit f50ee71

Please sign in to comment.