MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / measurements

Method measurements

tests/framework/instruments/OpenCLTimer.cpp:188–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187template <bool output_timestamps>
188Instrument::MeasurementsMap OpenCLClock<output_timestamps>::measurements() const
189{
190 MeasurementsMap measurements;
191 unsigned int kernel_number = 0;
192 for (auto const &kernel : _kernels)
193 {
194 cl_ulong queued;
195 cl_ulong flushed;
196 cl_ulong start;
197 cl_ulong end;
198 kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_QUEUED, &queued);
199 kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_SUBMIT, &flushed);
200 kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_START, &start);
201 kernel.event.getProfilingInfo(CL_PROFILING_COMMAND_END, &end);
202 std::string name = kernel.name + " #" + support::cpp11::to_string(kernel_number++);
203
204 if (output_timestamps)
205 {
206 measurements.emplace("[start]" + name, Measurement(start / static_cast<cl_ulong>(_scale_factor), _unit));
207 measurements.emplace("[queued]" + name, Measurement(queued / static_cast<cl_ulong>(_scale_factor), _unit));
208 measurements.emplace("[flushed]" + name,
209 Measurement(flushed / static_cast<cl_ulong>(_scale_factor), _unit));
210 measurements.emplace("[end]" + name, Measurement(end / static_cast<cl_ulong>(_scale_factor), _unit));
211 }
212 else
213 {
214 measurements.emplace(name, Measurement((end - start) / _scale_factor, _unit));
215 }
216 }
217
218 return measurements;
219}
220
221template <bool output_timestamps>
222Instrument::MeasurementsMap OpenCLClock<output_timestamps>::test_measurements() const

Callers

nothing calls this directly

Calls 3

getProfilingInfoMethod · 0.80
MeasurementClass · 0.70
to_stringFunction · 0.50

Tested by

no test coverage detected