Skip to content

Commit 549d74e

Browse files
DianaChenigcbot
authored andcommitted
vISA: refactor perf stats dump (NFC)
Add VISAKernelImpl::finalizePerfStats to finalize the perf stats values before dumping
1 parent 65f0967 commit 549d74e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

visa/VISAKernel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,10 @@ class VISAKernelImpl : public VISAFunction {
13071307

13081308
void createBindlessSampler();
13091309

1310+
// if vISA_DumpPerfStats is enabled, finalize the perf stats values before
1311+
// dumping
1312+
void finalizePerfStats(uint64_t binaryHash);
1313+
13101314
private:
13111315
// This member holds symbolic index of function when invoked via
13121316
// API path. Builder client can use this id when invoking this

visa/VISAKernelImpl.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,15 +464,17 @@ void *VISAKernelImpl::encodeAndEmit(unsigned int &binarySize) {
464464

465465
if (m_options->getOption(vISA_DumpPerfStats) ||
466466
m_options->getOption(vISA_DumpPerfStatsVerbose)) {
467-
// set BinaryHash
468-
m_jitInfo->stats.binaryHash =
469-
std::hash<std::string>{}(std::string((char*)binary, binarySize));
467+
finalizePerfStats(std::hash<std::string>{}(std::string((char*)binary, binarySize)));
470468
dumpPerfStatsInJson(m_asmName);
471469
}
472470

473471
return binary;
474472
}
475473

474+
void VISAKernelImpl::finalizePerfStats(uint64_t binaryHash) {
475+
// set BinaryHash
476+
m_jitInfo->stats.binaryHash = binaryHash;
477+
}
476478

477479
void KERNEL_INFO::collectStats(G4_Kernel &kernel) {
478480
for (auto decl : kernel.Declares) {

0 commit comments

Comments
 (0)