2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2019-02-27 18:39:32 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "runtime/os_interface/debug_settings_manager.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "runtime/utilities/perf_profiler.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#define API_ENTER(retValPointer) \
|
|
|
|
DebugSettingsApiEnterWrapper<DebugManager.debugLoggingAvailable()> ApiWrapperForSingleCall(__FUNCTION__, retValPointer)
|
|
|
|
#define SYSTEM_ENTER()
|
|
|
|
#define SYSTEM_LEAVE(id)
|
|
|
|
#define WAIT_ENTER()
|
|
|
|
#define WAIT_LEAVE()
|
|
|
|
|
|
|
|
#if OCL_RUNTIME_PROFILING == 1
|
|
|
|
#undef API_ENTER
|
|
|
|
#undef SYSTEM_ENTER
|
|
|
|
#undef SYSTEM_LEAVE
|
|
|
|
#undef WAIT_ENTER
|
|
|
|
#undef WAIT_LEAVE
|
|
|
|
|
|
|
|
#define API_ENTER(x) \
|
|
|
|
PerfProfilerApiWrapper globalPerfProfilersWrapperInstanceForSingleApiFunction(__FUNCTION__)
|
|
|
|
|
|
|
|
#define SYSTEM_ENTER() \
|
|
|
|
PerfProfiler::create(); \
|
2019-03-02 02:29:58 +08:00
|
|
|
gPerfProfiler->systemEnter();
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#define SYSTEM_LEAVE(id) \
|
2019-03-02 02:29:58 +08:00
|
|
|
gPerfProfiler->systemLeave(id);
|
2017-12-21 07:45:38 +08:00
|
|
|
#define WAIT_ENTER() \
|
|
|
|
SYSTEM_ENTER()
|
|
|
|
#define WAIT_LEAVE() \
|
|
|
|
SYSTEM_LEAVE(0)
|
|
|
|
#endif
|