mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Change-Id: Iea704cda26916315343e3cef6840954ba3d62c06 Signed-off-by: davidoli <david.olien@intel.com>
35 lines
780 B
C++
35 lines
780 B
C++
/*
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "level_zero/tools/source/tools_init_imp.h"
|
|
|
|
#include "level_zero/tools/source/sysman/sysman.h"
|
|
#include "level_zero/tools/source/tools_init.h"
|
|
|
|
#include <mutex>
|
|
#include <thread>
|
|
|
|
namespace L0 {
|
|
|
|
static void enableTools(ze_result_t &result, ze_init_flag_t flag, bool *ptoolsAreEnabled) {
|
|
SysmanHandleContext::init(flag);
|
|
*ptoolsAreEnabled = true;
|
|
}
|
|
|
|
ze_result_t ToolsInitImp::initTools(ze_init_flag_t flag) {
|
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
|
|
|
std::call_once(this->initToolsOnce, enableTools, std::ref(result), flag, &this->toolsAreEnabled);
|
|
return result;
|
|
}
|
|
|
|
bool ToolsInitImp::areToolsEnabled() {
|
|
return this->toolsAreEnabled;
|
|
}
|
|
|
|
} // namespace L0
|