mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Simplify PerfCounter initialization
Change-Id: Ia393088a80ac7b439efb5e40b70e593e3891cbc5 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
58fa5bd347
commit
2c63a956ad
@@ -289,32 +289,20 @@ void CommandQueue::updateFromCompletionStamp(const CompletionStamp &completionSt
|
||||
this->taskLevel = completionStamp.taskLevel;
|
||||
}
|
||||
|
||||
bool CommandQueue::setPerfCountersEnabled(bool perfCountersEnabled, cl_uint configuration) {
|
||||
bool CommandQueue::setPerfCountersEnabled() {
|
||||
DEBUG_BREAK_IF(device == nullptr);
|
||||
if (perfCountersEnabled == this->perfCountersEnabled) {
|
||||
return true;
|
||||
}
|
||||
// Only dynamic configuration (set 0) is supported.
|
||||
const uint32_t dynamicSet = 0;
|
||||
if (configuration != dynamicSet) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto perfCounters = device->getPerformanceCounters();
|
||||
bool isCcsEngine = isCcs(getGpgpuEngine().osContext->getEngineType());
|
||||
|
||||
if (perfCountersEnabled) {
|
||||
if (!perfCounters->enable(isCcsEngine)) {
|
||||
perfCounters->shutdown();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
perfCountersEnabled = perfCounters->enable(isCcsEngine);
|
||||
|
||||
if (!perfCountersEnabled) {
|
||||
perfCounters->shutdown();
|
||||
}
|
||||
|
||||
this->perfCountersEnabled = perfCountersEnabled;
|
||||
|
||||
return true;
|
||||
} // namespace NEO
|
||||
return perfCountersEnabled;
|
||||
}
|
||||
|
||||
PerformanceCounters *CommandQueue::getPerfCounters() {
|
||||
return device->getPerformanceCounters();
|
||||
|
||||
Reference in New Issue
Block a user