| 54 | |
| 55 | template <bool output_timestamps> |
| 56 | OpenCLClock<output_timestamps>::OpenCLClock(ScaleFactor scale_factor) |
| 57 | : _kernels(), |
| 58 | _real_function(nullptr), |
| 59 | #ifdef ARM_COMPUTE_GRAPH_ENABLED |
| 60 | _real_graph_function(nullptr), |
| 61 | #endif /* ARM_COMPUTE_GRAPH_ENABLED */ |
| 62 | _prefix(), |
| 63 | _timer_enabled(false) |
| 64 | { |
| 65 | auto q = CLScheduler::get().queue(); |
| 66 | cl_command_queue_properties props = q.getInfo<CL_QUEUE_PROPERTIES>(); |
| 67 | if ((props & CL_QUEUE_PROFILING_ENABLE) == 0) |
| 68 | { |
| 69 | CLScheduler::get().set_queue(cl::CommandQueue(CLScheduler::get().context(), props | CL_QUEUE_PROFILING_ENABLE)); |
| 70 | } |
| 71 | |
| 72 | switch (scale_factor) |
| 73 | { |
| 74 | case ScaleFactor::NONE: |
| 75 | _scale_factor = 1.f; |
| 76 | _unit = "ns"; |
| 77 | break; |
| 78 | case ScaleFactor::TIME_US: |
| 79 | _scale_factor = 1000.f; |
| 80 | _unit = "us"; |
| 81 | break; |
| 82 | case ScaleFactor::TIME_MS: |
| 83 | _scale_factor = 1000000.f; |
| 84 | _unit = "ms"; |
| 85 | break; |
| 86 | case ScaleFactor::TIME_S: |
| 87 | _scale_factor = 1000000000.f; |
| 88 | _unit = "s"; |
| 89 | break; |
| 90 | default: |
| 91 | ARM_COMPUTE_ERROR("Invalid scale"); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | template <bool output_timestamps> |
| 96 | void OpenCLClock<output_timestamps>::test_start() |
nothing calls this directly
no test coverage detected