mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: make spdlog optional
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eff450c5ef
commit
b8e212d728
@@ -17,24 +17,14 @@
|
||||
#include "level_zero/core/source/device/device.h"
|
||||
#include "level_zero/core/source/driver/driver_handle_imp.h"
|
||||
#include "level_zero/core/source/driver/driver_imp.h"
|
||||
#include "level_zero/experimental/source/log_utility/log_manager.h"
|
||||
#include "level_zero/tools/source/metrics/metric.h"
|
||||
|
||||
#include "driver_version.h"
|
||||
#include "log_manager.h"
|
||||
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
#define QTR(a) #a
|
||||
#define TOSTR(b) QTR(b)
|
||||
#define LOG_INFO_VERSION_SHA(logType, version, sha) \
|
||||
auto logger = NEO::LogManager::getInstance()->getLogger(logType); \
|
||||
if (logger) { \
|
||||
char logBuffer[256]; \
|
||||
snprintf(logBuffer, 256, "Level zero driver version and SHA : %s - %s\n", version, sha); \
|
||||
logger->logInfo(logBuffer); \
|
||||
}
|
||||
|
||||
namespace L0 {
|
||||
|
||||
_ze_driver_handle_t *globalDriverHandle;
|
||||
@@ -72,7 +62,7 @@ void DriverImp::initialize(ze_result_t *result) {
|
||||
}
|
||||
|
||||
// Logging enablement if opted
|
||||
initLogger();
|
||||
NEO::initLogger();
|
||||
|
||||
if (envVariables.fp64Emulation) {
|
||||
executionEnvironment->setFP64EmulationEnabled();
|
||||
@@ -111,13 +101,6 @@ void DriverImp::initialize(ze_result_t *result) {
|
||||
|
||||
ze_result_t DriverImp::initStatus(ZE_RESULT_ERROR_UNINITIALIZED);
|
||||
|
||||
void DriverImp::initLogger() {
|
||||
if (NEO::LogManager::getLoggingLevel() != (uint32_t)NEO::LogLevel::logLevelOff) {
|
||||
CREATE_LOGGER(NEO::LogManager::LogType::coreLogger, "coreLogger.log", NEO::LogManager::getLoggingLevel());
|
||||
LOG_INFO_VERSION_SHA(NEO::LogManager::LogType::coreLogger, TOSTR(NEO_OCL_DRIVER_VERSION), NEO_REVISION);
|
||||
}
|
||||
}
|
||||
|
||||
ze_result_t DriverImp::driverInit(ze_init_flags_t flags) {
|
||||
std::call_once(initDriverOnce, [this]() {
|
||||
ze_result_t result;
|
||||
|
||||
@@ -21,7 +21,6 @@ class DriverImp : public Driver {
|
||||
void initialize(ze_result_t *result) override;
|
||||
|
||||
protected:
|
||||
void initLogger();
|
||||
std::once_flag initDriverOnce;
|
||||
static ze_result_t initStatus;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user