Skip to content

Commit a9a0456

Browse files
committed
Use clang-format
1 parent d5b9c09 commit a9a0456

File tree

13 files changed

+6250
-6250
lines changed

13 files changed

+6250
-6250
lines changed

.clang-format

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SpacesInContainerLiterals: false
102102
SpacesInCStyleCastParentheses: false
103103
SpacesInParentheses: false
104104
SpacesInSquareBrackets: false
105-
Standard: Cpp11
106-
TabWidth: 4
107-
UseTab: ForIndentation
105+
Standard: Cpp11
106+
TabWidth: 4
107+
UseTab: ForContinuationAndIndentation
108108
...

cpu_profiler.h

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,24 @@ enum class CpuCounter
5959

6060
// Mapping from CPU counter names to enum values. Used for JSON initialization.
6161
const std::unordered_map<std::string, CpuCounter> cpu_counter_names {
62-
{"Cycles", CpuCounter::Cycles},
63-
{"Instructions", CpuCounter::Instructions},
64-
{"CacheReferences", CpuCounter::CacheReferences},
65-
{"CacheMisses", CpuCounter::CacheMisses},
66-
{"BranchInstructions", CpuCounter::BranchInstructions},
67-
{"BranchMisses", CpuCounter::BranchMisses},
68-
69-
{"L1Accesses", CpuCounter::L1Accesses},
70-
{"InstrRetired", CpuCounter::InstrRetired},
71-
{"L2Accesses", CpuCounter::L2Accesses},
72-
{"L3Accesses", CpuCounter::L3Accesses},
73-
{"BusReads", CpuCounter::BusReads},
74-
{"BusWrites", CpuCounter::BusWrites},
75-
{"MemReads", CpuCounter::MemReads},
76-
{"MemWrites", CpuCounter::MemWrites},
77-
{"ASESpec", CpuCounter::ASESpec},
78-
{"VFPSpec", CpuCounter::VFPSpec},
79-
{"CryptoSpec", CpuCounter::CryptoSpec},
62+
{"Cycles", CpuCounter::Cycles},
63+
{"Instructions", CpuCounter::Instructions},
64+
{"CacheReferences", CpuCounter::CacheReferences},
65+
{"CacheMisses", CpuCounter::CacheMisses},
66+
{"BranchInstructions", CpuCounter::BranchInstructions},
67+
{"BranchMisses", CpuCounter::BranchMisses},
68+
69+
{"L1Accesses", CpuCounter::L1Accesses},
70+
{"InstrRetired", CpuCounter::InstrRetired},
71+
{"L2Accesses", CpuCounter::L2Accesses},
72+
{"L3Accesses", CpuCounter::L3Accesses},
73+
{"BusReads", CpuCounter::BusReads},
74+
{"BusWrites", CpuCounter::BusWrites},
75+
{"MemReads", CpuCounter::MemReads},
76+
{"MemWrites", CpuCounter::MemWrites},
77+
{"ASESpec", CpuCounter::ASESpec},
78+
{"VFPSpec", CpuCounter::VFPSpec},
79+
{"CryptoSpec", CpuCounter::CryptoSpec},
8080
};
8181

8282
// A hash function for CpuCounter values
@@ -97,29 +97,29 @@ struct CpuCounterInfo
9797

9898
// Mapping from each counter to its corresponding information (description and unit)
9999
const std::unordered_map<CpuCounter, CpuCounterInfo, CpuCounterHash> cpu_counter_info {
100-
{CpuCounter::Cycles, {"Number of CPU cycles", "cycles"}},
101-
{CpuCounter::Instructions, {"Number of CPU instructions", "instructions"}},
102-
{CpuCounter::CacheReferences, {"Number of cache references", "references"}},
103-
{CpuCounter::CacheMisses, {"Number of cache misses", "misses"}},
104-
{CpuCounter::BranchInstructions, {"Number of branch instructions", "instructions"}},
105-
{CpuCounter::BranchMisses, {"Number of branch misses", "misses"}},
106-
107-
{CpuCounter::L1Accesses, {"L1 data cache accesses", "accesses"}},
108-
{CpuCounter::InstrRetired, {"All retired instructions", "instructions"}},
109-
{CpuCounter::L2Accesses, {"L2 data cache accesses", "accesses"}},
110-
{CpuCounter::L3Accesses, {"L3 data cache accesses", "accesses"}},
111-
{CpuCounter::BusReads, {"Bus access reads", "beats"}},
112-
{CpuCounter::BusWrites, {"Bus access writes", "beats"}},
113-
{CpuCounter::MemReads, {"Data memory access, load instructions", "instructions"}},
114-
{CpuCounter::MemWrites, {"Data memory access, store instructions", "instructions"}},
115-
{CpuCounter::ASESpec, {"Speculatively executed SIMD operations", "operations"}},
116-
{CpuCounter::VFPSpec, {"Speculatively executed floating point operations", "operations"}},
117-
{CpuCounter::CryptoSpec, {"Speculatively executed cryptographic operations", "operations"}},
100+
{CpuCounter::Cycles, {"Number of CPU cycles", "cycles"}},
101+
{CpuCounter::Instructions, {"Number of CPU instructions", "instructions"}},
102+
{CpuCounter::CacheReferences, {"Number of cache references", "references"}},
103+
{CpuCounter::CacheMisses, {"Number of cache misses", "misses"}},
104+
{CpuCounter::BranchInstructions, {"Number of branch instructions", "instructions"}},
105+
{CpuCounter::BranchMisses, {"Number of branch misses", "misses"}},
106+
107+
{CpuCounter::L1Accesses, {"L1 data cache accesses", "accesses"}},
108+
{CpuCounter::InstrRetired, {"All retired instructions", "instructions"}},
109+
{CpuCounter::L2Accesses, {"L2 data cache accesses", "accesses"}},
110+
{CpuCounter::L3Accesses, {"L3 data cache accesses", "accesses"}},
111+
{CpuCounter::BusReads, {"Bus access reads", "beats"}},
112+
{CpuCounter::BusWrites, {"Bus access writes", "beats"}},
113+
{CpuCounter::MemReads, {"Data memory access, load instructions", "instructions"}},
114+
{CpuCounter::MemWrites, {"Data memory access, store instructions", "instructions"}},
115+
{CpuCounter::ASESpec, {"Speculatively executed SIMD operations", "operations"}},
116+
{CpuCounter::VFPSpec, {"Speculatively executed floating point operations", "operations"}},
117+
{CpuCounter::CryptoSpec, {"Speculatively executed cryptographic operations", "operations"}},
118118
};
119119

120120
typedef std::unordered_set<CpuCounter, CpuCounterHash> CpuCounterSet;
121121
typedef std::unordered_map<CpuCounter, Value, CpuCounterHash>
122-
CpuMeasurements;
122+
CpuMeasurements;
123123

124124
/** An interface for classes that collect CPU performance data. */
125125
class CpuProfiler

gpu_profiler.h

Lines changed: 90 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -86,51 +86,51 @@ enum class GpuCounter
8686

8787
// Mapping from GPU counter names to enum values. Used for JSON initialization.
8888
const std::unordered_map<std::string, GpuCounter> gpu_counter_names {
89-
{"GpuCycles", GpuCounter::GpuCycles},
90-
{"ComputeCycles", GpuCounter::ComputeCycles},
91-
{"VertexCycles", GpuCounter::VertexCycles},
92-
{"VertexComputeCycles", GpuCounter::VertexComputeCycles},
93-
{"FragmentCycles", GpuCounter::FragmentCycles},
94-
{"TilerCycles", GpuCounter::TilerCycles},
95-
96-
{"ComputeJobs", GpuCounter::VertexComputeJobs},
97-
{"VertexJobs", GpuCounter::VertexJobs},
98-
{"VertexComputeJobs", GpuCounter::VertexComputeJobs},
99-
{"FragmentJobs", GpuCounter::FragmentJobs},
100-
{"Pixels", GpuCounter::Pixels},
101-
102-
{"CulledPrimitives", GpuCounter::CulledPrimitives},
103-
{"VisiblePrimitives", GpuCounter::VisiblePrimitives},
104-
{"InputPrimitives", GpuCounter::InputPrimitives},
105-
106-
{"Tiles", GpuCounter::Tiles},
107-
{"TransactionEliminations", GpuCounter::TransactionEliminations},
108-
109-
{"EarlyZTests", GpuCounter::EarlyZTests},
110-
{"EarlyZKilled", GpuCounter::EarlyZKilled},
111-
{"LateZTests", GpuCounter::LateZTests},
112-
{"LateZKilled", GpuCounter::LateZKilled},
113-
114-
{"Instructions", GpuCounter::Instructions},
115-
{"DivergedInstructions", GpuCounter::DivergedInstructions},
116-
117-
{"ShaderComputeCycles", GpuCounter::ShaderComputeCycles},
118-
{"ShaderFragmentCycles", GpuCounter::ShaderFragmentCycles},
119-
{"ShaderCycles", GpuCounter::ShaderCycles},
120-
{"ShaderArithmeticCycles", GpuCounter::ShaderArithmeticCycles},
121-
{"ShaderInterpolatorCycles", GpuCounter::ShaderInterpolatorCycles},
122-
{"ShaderLoadStoreCycles", GpuCounter::ShaderLoadStoreCycles},
123-
{"ShaderTextureCycles", GpuCounter::ShaderTextureCycles},
124-
125-
{"CacheReadLookups", GpuCounter::CacheReadLookups},
126-
{"CacheWriteLookups", GpuCounter::CacheWriteLookups},
127-
128-
{"ExternalMemoryReadAccesses", GpuCounter::ExternalMemoryReadAccesses},
129-
{"ExternalMemoryWriteAccesses", GpuCounter::ExternalMemoryWriteAccesses},
130-
{"ExternalMemoryReadStalls", GpuCounter::ExternalMemoryReadStalls},
131-
{"ExternalMemoryWriteStalls", GpuCounter::ExternalMemoryWriteStalls},
132-
{"ExternalMemoryReadBytes", GpuCounter::ExternalMemoryReadBytes},
133-
{"ExternalMemoryWriteBytes", GpuCounter::ExternalMemoryWriteBytes},
89+
{"GpuCycles", GpuCounter::GpuCycles},
90+
{"ComputeCycles", GpuCounter::ComputeCycles},
91+
{"VertexCycles", GpuCounter::VertexCycles},
92+
{"VertexComputeCycles", GpuCounter::VertexComputeCycles},
93+
{"FragmentCycles", GpuCounter::FragmentCycles},
94+
{"TilerCycles", GpuCounter::TilerCycles},
95+
96+
{"ComputeJobs", GpuCounter::VertexComputeJobs},
97+
{"VertexJobs", GpuCounter::VertexJobs},
98+
{"VertexComputeJobs", GpuCounter::VertexComputeJobs},
99+
{"FragmentJobs", GpuCounter::FragmentJobs},
100+
{"Pixels", GpuCounter::Pixels},
101+
102+
{"CulledPrimitives", GpuCounter::CulledPrimitives},
103+
{"VisiblePrimitives", GpuCounter::VisiblePrimitives},
104+
{"InputPrimitives", GpuCounter::InputPrimitives},
105+
106+
{"Tiles", GpuCounter::Tiles},
107+
{"TransactionEliminations", GpuCounter::TransactionEliminations},
108+
109+
{"EarlyZTests", GpuCounter::EarlyZTests},
110+
{"EarlyZKilled", GpuCounter::EarlyZKilled},
111+
{"LateZTests", GpuCounter::LateZTests},
112+
{"LateZKilled", GpuCounter::LateZKilled},
113+
114+
{"Instructions", GpuCounter::Instructions},
115+
{"DivergedInstructions", GpuCounter::DivergedInstructions},
116+
117+
{"ShaderComputeCycles", GpuCounter::ShaderComputeCycles},
118+
{"ShaderFragmentCycles", GpuCounter::ShaderFragmentCycles},
119+
{"ShaderCycles", GpuCounter::ShaderCycles},
120+
{"ShaderArithmeticCycles", GpuCounter::ShaderArithmeticCycles},
121+
{"ShaderInterpolatorCycles", GpuCounter::ShaderInterpolatorCycles},
122+
{"ShaderLoadStoreCycles", GpuCounter::ShaderLoadStoreCycles},
123+
{"ShaderTextureCycles", GpuCounter::ShaderTextureCycles},
124+
125+
{"CacheReadLookups", GpuCounter::CacheReadLookups},
126+
{"CacheWriteLookups", GpuCounter::CacheWriteLookups},
127+
128+
{"ExternalMemoryReadAccesses", GpuCounter::ExternalMemoryReadAccesses},
129+
{"ExternalMemoryWriteAccesses", GpuCounter::ExternalMemoryWriteAccesses},
130+
{"ExternalMemoryReadStalls", GpuCounter::ExternalMemoryReadStalls},
131+
{"ExternalMemoryWriteStalls", GpuCounter::ExternalMemoryWriteStalls},
132+
{"ExternalMemoryReadBytes", GpuCounter::ExternalMemoryReadBytes},
133+
{"ExternalMemoryWriteBytes", GpuCounter::ExternalMemoryWriteBytes},
134134
};
135135

136136
// A hash function for GpuCounter values
@@ -151,51 +151,51 @@ struct GpuCounterInfo
151151

152152
// Mapping from each counter to its corresponding information (description and unit)
153153
const std::unordered_map<GpuCounter, GpuCounterInfo, GpuCounterHash> gpu_counter_info {
154-
{GpuCounter::GpuCycles, {"Number of GPU cycles", "cycles"}},
155-
{GpuCounter::ComputeCycles, {"Number of compute cycles", "cycles"}},
156-
{GpuCounter::VertexCycles, {"Number of vertex cycles", "cycles"}},
157-
{GpuCounter::VertexComputeCycles, {"Number of vertex/compute cycles", "cycles"}},
158-
{GpuCounter::FragmentCycles, {"Number of fragment cycles", "cycles"}},
159-
{GpuCounter::TilerCycles, {"Number of tiler cycles", "cycles"}},
160-
161-
{GpuCounter::ComputeJobs, {"Number of compute jobs", "jobs"}},
162-
{GpuCounter::VertexJobs, {"Number of vertex jobs", "jobs"}},
163-
{GpuCounter::VertexComputeJobs, {"Number of vertex/compute jobs", "jobs"}},
164-
{GpuCounter::FragmentJobs, {"Number of fragment jobs", "jobs"}},
165-
{GpuCounter::Pixels, {"Number of pixels shaded", "cycles"}},
166-
167-
{GpuCounter::CulledPrimitives, {"Number of culled primitives", "triangles"}},
168-
{GpuCounter::VisiblePrimitives, {"Number of visible primitives", "triangles"}},
169-
{GpuCounter::InputPrimitives, {"Number of input primitives", "triangles"}},
170-
171-
{GpuCounter::Tiles, {"Number of physical tiles written", "tiles"}},
172-
{GpuCounter::TransactionEliminations, {"Number of transaction eliminations", "tiles"}},
173-
174-
{GpuCounter::EarlyZTests, {"Number of early-Z tests performed", "tests"}},
175-
{GpuCounter::EarlyZKilled, {"Number of early-Z tests resulting in a kill", "tests"}},
176-
{GpuCounter::LateZTests, {"Number of late-Z tests performed", "tests"}},
177-
{GpuCounter::LateZKilled, {"Number of late-Z tests resulting in a kill", "tests"}},
178-
179-
{GpuCounter::Instructions, {"Number of shader instructions", "instructions"}},
180-
{GpuCounter::DivergedInstructions, {"Number of diverged shader instructions", "instructions"}},
181-
182-
{GpuCounter::ShaderComputeCycles, {"Number of shader vertex/compute cycles", "cycles"}},
183-
{GpuCounter::ShaderFragmentCycles, {"Number of shader fragment cycles", "cycles"}},
184-
{GpuCounter::ShaderCycles, {"Number of shader core cycles", "cycles"}},
185-
{GpuCounter::ShaderArithmeticCycles, {"Number of shader arithmetic cycles", "cycles"}},
186-
{GpuCounter::ShaderInterpolatorCycles, {"Number of shader interpolator cycles", "cycles"}},
187-
{GpuCounter::ShaderLoadStoreCycles, {"Number of shader load/store cycles", "cycles"}},
188-
{GpuCounter::ShaderTextureCycles, {"Number of shader texture cycles", "cycles"}},
189-
190-
{GpuCounter::CacheReadLookups, {"Number of cache read lookups", "lookups"}},
191-
{GpuCounter::CacheWriteLookups, {"Number of cache write lookups", "lookups"}},
192-
193-
{GpuCounter::ExternalMemoryReadAccesses, {"Number of reads from external memory", "accesses"}},
194-
{GpuCounter::ExternalMemoryWriteAccesses, {"Number of writes to external memory", "accesses"}},
195-
{GpuCounter::ExternalMemoryReadStalls, {"Number of stall cycles when reading from external memory", "cycles"}},
196-
{GpuCounter::ExternalMemoryWriteStalls, {"Number of stall cycles when writing to external memory", "cycles"}},
197-
{GpuCounter::ExternalMemoryReadBytes, {"Number of bytes read to external memory", "bytes"}},
198-
{GpuCounter::ExternalMemoryWriteBytes, {"Number of bytes written to external memory", "bytes"}},
154+
{GpuCounter::GpuCycles, {"Number of GPU cycles", "cycles"}},
155+
{GpuCounter::ComputeCycles, {"Number of compute cycles", "cycles"}},
156+
{GpuCounter::VertexCycles, {"Number of vertex cycles", "cycles"}},
157+
{GpuCounter::VertexComputeCycles, {"Number of vertex/compute cycles", "cycles"}},
158+
{GpuCounter::FragmentCycles, {"Number of fragment cycles", "cycles"}},
159+
{GpuCounter::TilerCycles, {"Number of tiler cycles", "cycles"}},
160+
161+
{GpuCounter::ComputeJobs, {"Number of compute jobs", "jobs"}},
162+
{GpuCounter::VertexJobs, {"Number of vertex jobs", "jobs"}},
163+
{GpuCounter::VertexComputeJobs, {"Number of vertex/compute jobs", "jobs"}},
164+
{GpuCounter::FragmentJobs, {"Number of fragment jobs", "jobs"}},
165+
{GpuCounter::Pixels, {"Number of pixels shaded", "cycles"}},
166+
167+
{GpuCounter::CulledPrimitives, {"Number of culled primitives", "triangles"}},
168+
{GpuCounter::VisiblePrimitives, {"Number of visible primitives", "triangles"}},
169+
{GpuCounter::InputPrimitives, {"Number of input primitives", "triangles"}},
170+
171+
{GpuCounter::Tiles, {"Number of physical tiles written", "tiles"}},
172+
{GpuCounter::TransactionEliminations, {"Number of transaction eliminations", "tiles"}},
173+
174+
{GpuCounter::EarlyZTests, {"Number of early-Z tests performed", "tests"}},
175+
{GpuCounter::EarlyZKilled, {"Number of early-Z tests resulting in a kill", "tests"}},
176+
{GpuCounter::LateZTests, {"Number of late-Z tests performed", "tests"}},
177+
{GpuCounter::LateZKilled, {"Number of late-Z tests resulting in a kill", "tests"}},
178+
179+
{GpuCounter::Instructions, {"Number of shader instructions", "instructions"}},
180+
{GpuCounter::DivergedInstructions, {"Number of diverged shader instructions", "instructions"}},
181+
182+
{GpuCounter::ShaderComputeCycles, {"Number of shader vertex/compute cycles", "cycles"}},
183+
{GpuCounter::ShaderFragmentCycles, {"Number of shader fragment cycles", "cycles"}},
184+
{GpuCounter::ShaderCycles, {"Number of shader core cycles", "cycles"}},
185+
{GpuCounter::ShaderArithmeticCycles, {"Number of shader arithmetic cycles", "cycles"}},
186+
{GpuCounter::ShaderInterpolatorCycles, {"Number of shader interpolator cycles", "cycles"}},
187+
{GpuCounter::ShaderLoadStoreCycles, {"Number of shader load/store cycles", "cycles"}},
188+
{GpuCounter::ShaderTextureCycles, {"Number of shader texture cycles", "cycles"}},
189+
190+
{GpuCounter::CacheReadLookups, {"Number of cache read lookups", "lookups"}},
191+
{GpuCounter::CacheWriteLookups, {"Number of cache write lookups", "lookups"}},
192+
193+
{GpuCounter::ExternalMemoryReadAccesses, {"Number of reads from external memory", "accesses"}},
194+
{GpuCounter::ExternalMemoryWriteAccesses, {"Number of writes to external memory", "accesses"}},
195+
{GpuCounter::ExternalMemoryReadStalls, {"Number of stall cycles when reading from external memory", "cycles"}},
196+
{GpuCounter::ExternalMemoryWriteStalls, {"Number of stall cycles when writing to external memory", "cycles"}},
197+
{GpuCounter::ExternalMemoryReadBytes, {"Number of bytes read to external memory", "bytes"}},
198+
{GpuCounter::ExternalMemoryWriteBytes, {"Number of bytes written to external memory", "bytes"}},
199199
};
200200

201201
typedef std::unordered_set<GpuCounter, GpuCounterHash> GpuCounterSet;

hwcpipe.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,27 @@ HWCPipe::HWCPipe(CpuCounterSet enabled_cpu_counters, GpuCounterSet enabled_gpu_c
9292
HWCPipe::HWCPipe()
9393
{
9494
CpuCounterSet enabled_cpu_counters {
95-
CpuCounter::Cycles,
96-
CpuCounter::Instructions,
97-
CpuCounter::CacheReferences,
98-
CpuCounter::CacheMisses,
99-
CpuCounter::BranchInstructions,
100-
CpuCounter::BranchMisses,
95+
CpuCounter::Cycles,
96+
CpuCounter::Instructions,
97+
CpuCounter::CacheReferences,
98+
CpuCounter::CacheMisses,
99+
CpuCounter::BranchInstructions,
100+
CpuCounter::BranchMisses,
101101
};
102102

103103
GpuCounterSet enabled_gpu_counters {
104-
GpuCounter::GpuCycles,
105-
GpuCounter::VertexComputeCycles,
106-
GpuCounter::FragmentCycles,
107-
GpuCounter::TilerCycles,
108-
GpuCounter::CacheReadLookups,
109-
GpuCounter::CacheWriteLookups,
110-
GpuCounter::ExternalMemoryReadAccesses,
111-
GpuCounter::ExternalMemoryWriteAccesses,
112-
GpuCounter::ExternalMemoryReadStalls,
113-
GpuCounter::ExternalMemoryWriteStalls,
114-
GpuCounter::ExternalMemoryReadBytes,
115-
GpuCounter::ExternalMemoryWriteBytes,
104+
GpuCounter::GpuCycles,
105+
GpuCounter::VertexComputeCycles,
106+
GpuCounter::FragmentCycles,
107+
GpuCounter::TilerCycles,
108+
GpuCounter::CacheReadLookups,
109+
GpuCounter::CacheWriteLookups,
110+
GpuCounter::ExternalMemoryReadAccesses,
111+
GpuCounter::ExternalMemoryWriteAccesses,
112+
GpuCounter::ExternalMemoryReadStalls,
113+
GpuCounter::ExternalMemoryWriteStalls,
114+
GpuCounter::ExternalMemoryReadBytes,
115+
GpuCounter::ExternalMemoryWriteBytes,
116116
};
117117

118118
create_profilers(std::move(enabled_cpu_counters), std::move(enabled_gpu_counters));

value.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ class Value
3030
{
3131
public:
3232
Value() :
33-
is_int_(true),
34-
int_(0),
35-
double_(0.0f)
33+
is_int_(true),
34+
int_(0),
35+
double_(0.0f)
3636
{}
3737
Value(long long value) :
38-
is_int_(true),
39-
int_(value)
38+
is_int_(true),
39+
int_(value)
4040
{}
4141
Value(double value) :
42-
is_int_(false),
43-
double_(value)
42+
is_int_(false),
43+
double_(value)
4444
{}
4545

4646
template <typename T>

0 commit comments

Comments
 (0)