File: JitterDataStruct.cpp

package info (click to toggle)
intel-graphics-compiler2 2.20.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 107,552 kB
  • sloc: cpp: 807,012; lisp: 287,936; ansic: 16,397; python: 4,010; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 37
file content (61 lines) | stat: -rw-r--r-- 2,084 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*========================== begin_copyright_notice ============================

Copyright (C) 2022 Intel Corporation

SPDX-License-Identifier: MIT

============================= end_copyright_notice ===========================*/

#include "JitterDataStruct.h"

namespace vISA {

llvm::json::Value toJSON(const PERF_STATS &p) {
  // llvm Json cannot support u64 type, force to print string for binaryHash
  return llvm::json::Object{
    {"binaryHash", std::to_string(p.binaryHash)},
    {"numGRFUsed", p.numGRFUsed},
    {"numGRFTotal", p.numGRFTotal},
    {"numThreads", p.numThreads},
    {"numAsmCount", p.numAsmCountUnweighted},
    {"numFlagSpillStore", p.numFlagSpillStore},
    {"numFlagSpillLoad", p.numFlagSpillLoad},
    {"numGRFSpillFill", p.numGRFSpillFillWeighted},
    {"GRFSpillSize", p.spillMemUsed},
    {"numCycles", p.numCycles},
    {"maxGRFPressurePreRA", p.maxGRFPressurePreRA},
    {"maxGRFPressure", p.maxGRFPressure}
  };
}

llvm::json::Value toJSON(const PERF_STATS_VERBOSE &p) {
  llvm::json::Object jsonObject = llvm::json::Object{
      {"BCNum", p.BCNum},
      {"numByteRMWs", p.numByteRMWs},
      {"numALUInst", p.numALUInst},
      {"accSubDef", p.accSubDef},
      {"accSubUse", p.accSubUse},
      {"accSubCandidateDef", p.accSubCandidateDef},
      {"accSubCandidateUse", p.accSubCandidateUse},
      {"syncInstCount", p.syncInstCount},
      {"tokenReuseCount", p.tokenReuseCount},
      {"singlePipeAtOneDistNum", p.singlePipeAtOneDistNum},
      {"allAtOneDistNum", p.allAtOneDistNum},
      {"AfterWriteTokenDepCount", p.AfterWriteTokenDepCount},
  };
  if (p.RAIterNum) {
    jsonObject.insert({"RAIterNum", p.RAIterNum});
    jsonObject.insert({"varNum", p.varNum});
    jsonObject.insert({"globalVarNum", p.globalVarNum});
    jsonObject.insert({"maxRP", p.maxRP});
    jsonObject.insert({"maxNeighbors", p.maxNeighbors});
    jsonObject.insert({"avgNeighbors", p.avgNeighbors});
    jsonObject.insert({"normIntfNum", p.normIntfNum});
    jsonObject.insert({"augIntfNum", p.augIntfNum});
  }

  return jsonObject;
}

} // namespace vISA