mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Initial support for oneAPI Level Zero
Change-Id: I221df8427b1844237a4d9d900c58512706b0be0f
This commit is contained in:
22
level_zero/tools/source/pin/CMakeLists.txt
Normal file
22
level_zero/tools/source/pin/CMakeLists.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
#
|
||||
# Copyright (C) 2019-2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(L0_SRCS_TOOLS_PIN
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pin.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pin.h
|
||||
)
|
||||
|
||||
target_include_directories(${TARGET_NAME_L0}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/
|
||||
)
|
||||
|
||||
target_sources(${TARGET_NAME_L0} PRIVATE
|
||||
${L0_SRCS_TOOLS_PIN}
|
||||
)
|
||||
|
||||
# Make our source files visible to parent
|
||||
set_property(GLOBAL PROPERTY L0_SRCS_TOOLS_PIN ${L0_SRCS_TOOLS_PIN})
|
||||
26
level_zero/tools/source/pin/pin.cpp
Normal file
26
level_zero/tools/source/pin/pin.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "pin.h"
|
||||
|
||||
#include "level_zero/core/source/module.h"
|
||||
#include "level_zero/source/inc/ze_intel_gpu.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
static PinContext *PinContextInstance = nullptr;
|
||||
|
||||
void PinContext::init(ze_init_flag_t flag) {
|
||||
if (!getenv_tobool("ZE_ENABLE_PROGRAM_INSTRUMENTATION")) {
|
||||
return;
|
||||
}
|
||||
if (PinContextInstance == nullptr) {
|
||||
PinContextInstance = new PinContext();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
19
level_zero/tools/source/pin/pin.h
Normal file
19
level_zero/tools/source/pin/pin.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <level_zero/ze_api.h>
|
||||
#include <level_zero/zet_api.h>
|
||||
|
||||
namespace L0 {
|
||||
|
||||
class PinContext {
|
||||
public:
|
||||
static void init(ze_init_flag_t flag);
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
Reference in New Issue
Block a user