Initial support for oneAPI Level Zero

Change-Id: I221df8427b1844237a4d9d900c58512706b0be0f
This commit is contained in:
Brandon Fliflet
2020-03-06 11:09:57 +01:00
committed by ocldev
parent 612f47ced3
commit 27f4bce42f
277 changed files with 27508 additions and 1 deletions

View 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})

View 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

View 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