mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Wrap L0 exported functions to prevent symbol collision
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ce7de9d66e
commit
c9cb58ec8e
@@ -1,24 +1,25 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2020 Intel Corporation
|
# Copyright (C) 2020-2022 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
|
|
||||||
set(L0_SRCS_API
|
set(L0_SRCS_API
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_barrier.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_barrier_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_cmdlist.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_cmdlist_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_cmdqueue.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_cmdqueue_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_context.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_context_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_copy.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_copy_api_entrypoints.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_core_all_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_core_loader.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_core_loader.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_device.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_device_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_driver.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_driver_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_event.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_event_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_fence.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_fence_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_image.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_image_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_memory.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_memory_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_module.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_module_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_sampler.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_sampler_api_entrypoints.h
|
||||||
)
|
)
|
||||||
set_property(GLOBAL PROPERTY L0_SRCS_API ${L0_SRCS_API})
|
set_property(GLOBAL PROPERTY L0_SRCS_API ${L0_SRCS_API})
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendBarrier(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendBarrier(hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemoryRangesBarrier(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
uint32_t numRanges,
|
|
||||||
const size_t *pRangeSizes,
|
|
||||||
const void **pRanges,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemoryRangesBarrier(numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceSystemBarrier(
|
|
||||||
ze_device_handle_t hDevice) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->systemBarrier();
|
|
||||||
}
|
|
||||||
76
level_zero/api/core/ze_barrier_api_entrypoints.h
Normal file
76
level_zero/api/core/ze_barrier_api_entrypoints.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeCommandListAppendBarrier(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendBarrier(hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendMemoryRangesBarrier(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numRanges,
|
||||||
|
const size_t *pRangeSizes,
|
||||||
|
const void **pRanges,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemoryRangesBarrier(numRanges, pRangeSizes, pRanges, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceSystemBarrier(
|
||||||
|
ze_device_handle_t hDevice) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->systemBarrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendBarrier(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendBarrier(
|
||||||
|
hCommandList,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryRangesBarrier(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numRanges,
|
||||||
|
const size_t *pRangeSizes,
|
||||||
|
const void **pRanges,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendMemoryRangesBarrier(
|
||||||
|
hCommandList,
|
||||||
|
numRanges,
|
||||||
|
pRangeSizes,
|
||||||
|
pRanges,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceSystemBarrier(
|
||||||
|
ze_device_handle_t hDevice) {
|
||||||
|
return L0::zeDeviceSystemBarrier(
|
||||||
|
hDevice);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
|
||||||
#include "level_zero/core/source/context/context.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListCreate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_command_list_desc_t *desc,
|
|
||||||
ze_command_list_handle_t *phCommandList) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createCommandList(hDevice, desc, phCommandList);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListCreateImmediate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_command_queue_desc_t *altdesc,
|
|
||||||
ze_command_list_handle_t *phCommandList) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createCommandListImmediate(hDevice, altdesc, phCommandList);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListDestroy(
|
|
||||||
ze_command_list_handle_t hCommandList) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListClose(
|
|
||||||
ze_command_list_handle_t hCommandList) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListReset(
|
|
||||||
ze_command_list_handle_t hCommandList) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendWriteGlobalTimestamp(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
uint64_t *dstptr,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendWriteGlobalTimestamp(dstptr, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendQueryKernelTimestamps(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
uint32_t numEvents,
|
|
||||||
ze_event_handle_t *phEvents,
|
|
||||||
void *dstptr,
|
|
||||||
const size_t *pOffsets,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendQueryKernelTimestamps(numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
125
level_zero/api/core/ze_cmdlist_api_entrypoints.h
Normal file
125
level_zero/api/core/ze_cmdlist_api_entrypoints.h
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||||
|
#include "level_zero/core/source/context/context.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeCommandListCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_command_list_desc_t *desc,
|
||||||
|
ze_command_list_handle_t *phCommandList) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createCommandList(hDevice, desc, phCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListCreateImmediate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_command_queue_desc_t *altdesc,
|
||||||
|
ze_command_list_handle_t *phCommandList) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createCommandListImmediate(hDevice, altdesc, phCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListDestroy(
|
||||||
|
ze_command_list_handle_t hCommandList) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListClose(
|
||||||
|
ze_command_list_handle_t hCommandList) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListReset(
|
||||||
|
ze_command_list_handle_t hCommandList) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendWriteGlobalTimestamp(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint64_t *dstptr,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendWriteGlobalTimestamp(dstptr, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendQueryKernelTimestamps(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numEvents,
|
||||||
|
ze_event_handle_t *phEvents,
|
||||||
|
void *dstptr,
|
||||||
|
const size_t *pOffsets,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendQueryKernelTimestamps(numEvents, phEvents, dstptr, pOffsets, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_command_list_desc_t *desc,
|
||||||
|
ze_command_list_handle_t *phCommandList) {
|
||||||
|
return L0::zeCommandListCreate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
desc,
|
||||||
|
phCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListCreateImmediate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_command_queue_desc_t *altdesc,
|
||||||
|
ze_command_list_handle_t *phCommandList) {
|
||||||
|
return L0::zeCommandListCreateImmediate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
altdesc,
|
||||||
|
phCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListDestroy(
|
||||||
|
ze_command_list_handle_t hCommandList) {
|
||||||
|
return L0::zeCommandListDestroy(
|
||||||
|
hCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListClose(
|
||||||
|
ze_command_list_handle_t hCommandList) {
|
||||||
|
return L0::zeCommandListClose(
|
||||||
|
hCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListReset(
|
||||||
|
ze_command_list_handle_t hCommandList) {
|
||||||
|
return L0::zeCommandListReset(
|
||||||
|
hCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendWriteGlobalTimestamp(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint64_t *dstptr,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendWriteGlobalTimestamp(
|
||||||
|
hCommandList,
|
||||||
|
dstptr,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/cmdqueue/cmdqueue.h"
|
|
||||||
#include "level_zero/core/source/context/context.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandQueueCreate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_command_queue_desc_t *desc,
|
|
||||||
ze_command_queue_handle_t *phCommandQueue) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createCommandQueue(hDevice, desc, phCommandQueue);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandQueueDestroy(
|
|
||||||
ze_command_queue_handle_t hCommandQueue) {
|
|
||||||
return L0::CommandQueue::fromHandle(hCommandQueue)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandQueueExecuteCommandLists(
|
|
||||||
ze_command_queue_handle_t hCommandQueue,
|
|
||||||
uint32_t numCommandLists,
|
|
||||||
ze_command_list_handle_t *phCommandLists,
|
|
||||||
ze_fence_handle_t hFence) {
|
|
||||||
return L0::CommandQueue::fromHandle(hCommandQueue)->executeCommandLists(numCommandLists, phCommandLists, hFence, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandQueueSynchronize(
|
|
||||||
ze_command_queue_handle_t hCommandQueue,
|
|
||||||
uint64_t timeout) {
|
|
||||||
return L0::CommandQueue::fromHandle(hCommandQueue)->synchronize(timeout);
|
|
||||||
}
|
|
||||||
82
level_zero/api/core/ze_cmdqueue_api_entrypoints.h
Normal file
82
level_zero/api/core/ze_cmdqueue_api_entrypoints.h
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/cmdqueue/cmdqueue.h"
|
||||||
|
#include "level_zero/core/source/context/context.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeCommandQueueCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_command_queue_desc_t *desc,
|
||||||
|
ze_command_queue_handle_t *phCommandQueue) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createCommandQueue(hDevice, desc, phCommandQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandQueueDestroy(
|
||||||
|
ze_command_queue_handle_t hCommandQueue) {
|
||||||
|
return L0::CommandQueue::fromHandle(hCommandQueue)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandQueueExecuteCommandLists(
|
||||||
|
ze_command_queue_handle_t hCommandQueue,
|
||||||
|
uint32_t numCommandLists,
|
||||||
|
ze_command_list_handle_t *phCommandLists,
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::CommandQueue::fromHandle(hCommandQueue)->executeCommandLists(numCommandLists, phCommandLists, hFence, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandQueueSynchronize(
|
||||||
|
ze_command_queue_handle_t hCommandQueue,
|
||||||
|
uint64_t timeout) {
|
||||||
|
return L0::CommandQueue::fromHandle(hCommandQueue)->synchronize(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_command_queue_desc_t *desc,
|
||||||
|
ze_command_queue_handle_t *phCommandQueue) {
|
||||||
|
return L0::zeCommandQueueCreate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
desc,
|
||||||
|
phCommandQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueDestroy(
|
||||||
|
ze_command_queue_handle_t hCommandQueue) {
|
||||||
|
return L0::zeCommandQueueDestroy(
|
||||||
|
hCommandQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueExecuteCommandLists(
|
||||||
|
ze_command_queue_handle_t hCommandQueue,
|
||||||
|
uint32_t numCommandLists,
|
||||||
|
ze_command_list_handle_t *phCommandLists,
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::zeCommandQueueExecuteCommandLists(
|
||||||
|
hCommandQueue,
|
||||||
|
numCommandLists,
|
||||||
|
phCommandLists,
|
||||||
|
hFence);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandQueueSynchronize(
|
||||||
|
ze_command_queue_handle_t hCommandQueue,
|
||||||
|
uint64_t timeout) {
|
||||||
|
return L0::zeCommandQueueSynchronize(
|
||||||
|
hCommandQueue,
|
||||||
|
timeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "level_zero/core/source/context/context.h"
|
#include "level_zero/core/source/context/context.h"
|
||||||
#include "level_zero/core/source/driver/driver_handle.h"
|
#include "level_zero/core/source/driver/driver_handle.h"
|
||||||
#include <level_zero/ze_api.h>
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
namespace L0 {
|
||||||
zeContextCreate(
|
ze_result_t zeContextCreate(
|
||||||
ze_driver_handle_t hDriver,
|
ze_driver_handle_t hDriver,
|
||||||
const ze_context_desc_t *desc,
|
const ze_context_desc_t *desc,
|
||||||
ze_context_handle_t *phContext) {
|
ze_context_handle_t *phContext) {
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->createContext(desc, 0u, nullptr, phContext);
|
return L0::DriverHandle::fromHandle(hDriver)->createContext(desc, 0u, nullptr, phContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextCreateEx(
|
||||||
zeContextCreateEx(
|
|
||||||
ze_driver_handle_t hDriver,
|
ze_driver_handle_t hDriver,
|
||||||
const ze_context_desc_t *desc,
|
const ze_context_desc_t *desc,
|
||||||
uint32_t numDevices,
|
uint32_t numDevices,
|
||||||
@@ -27,18 +28,15 @@ zeContextCreateEx(
|
|||||||
return L0::DriverHandle::fromHandle(hDriver)->createContext(desc, numDevices, phDevices, phContext);
|
return L0::DriverHandle::fromHandle(hDriver)->createContext(desc, numDevices, phDevices, phContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextDestroy(ze_context_handle_t hContext) {
|
||||||
zeContextDestroy(ze_context_handle_t hContext) {
|
|
||||||
return L0::Context::fromHandle(hContext)->destroy();
|
return L0::Context::fromHandle(hContext)->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextGetStatus(ze_context_handle_t hContext) {
|
||||||
zeContextGetStatus(ze_context_handle_t hContext) {
|
|
||||||
return L0::Context::fromHandle(hContext)->getStatus();
|
return L0::Context::fromHandle(hContext)->getStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemReserve(
|
||||||
zeVirtualMemReserve(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *pStart,
|
const void *pStart,
|
||||||
size_t size,
|
size_t size,
|
||||||
@@ -46,16 +44,14 @@ zeVirtualMemReserve(
|
|||||||
return L0::Context::fromHandle(hContext)->reserveVirtualMem(pStart, size, pptr);
|
return L0::Context::fromHandle(hContext)->reserveVirtualMem(pStart, size, pptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemFree(
|
||||||
zeVirtualMemFree(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *ptr,
|
const void *ptr,
|
||||||
size_t size) {
|
size_t size) {
|
||||||
return L0::Context::fromHandle(hContext)->freeVirtualMem(ptr, size);
|
return L0::Context::fromHandle(hContext)->freeVirtualMem(ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemQueryPageSize(
|
||||||
zeVirtualMemQueryPageSize(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
size_t size,
|
size_t size,
|
||||||
@@ -63,8 +59,7 @@ zeVirtualMemQueryPageSize(
|
|||||||
return L0::Context::fromHandle(hContext)->queryVirtualMemPageSize(hDevice, size, pagesize);
|
return L0::Context::fromHandle(hContext)->queryVirtualMemPageSize(hDevice, size, pagesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zePhysicalMemCreate(
|
||||||
zePhysicalMemCreate(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
ze_physical_mem_desc_t *desc,
|
ze_physical_mem_desc_t *desc,
|
||||||
@@ -72,15 +67,13 @@ zePhysicalMemCreate(
|
|||||||
return L0::Context::fromHandle(hContext)->createPhysicalMem(hDevice, desc, phPhysicalMemory);
|
return L0::Context::fromHandle(hContext)->createPhysicalMem(hDevice, desc, phPhysicalMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zePhysicalMemDestroy(
|
||||||
zePhysicalMemDestroy(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_physical_mem_handle_t hPhysicalMemory) {
|
ze_physical_mem_handle_t hPhysicalMemory) {
|
||||||
return L0::Context::fromHandle(hContext)->destroyPhysicalMem(hPhysicalMemory);
|
return L0::Context::fromHandle(hContext)->destroyPhysicalMem(hPhysicalMemory);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemMap(
|
||||||
zeVirtualMemMap(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *ptr,
|
const void *ptr,
|
||||||
size_t size,
|
size_t size,
|
||||||
@@ -90,16 +83,14 @@ zeVirtualMemMap(
|
|||||||
return L0::Context::fromHandle(hContext)->mapVirtualMem(ptr, size, hPhysicalMemory, offset, access);
|
return L0::Context::fromHandle(hContext)->mapVirtualMem(ptr, size, hPhysicalMemory, offset, access);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemUnmap(
|
||||||
zeVirtualMemUnmap(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *ptr,
|
const void *ptr,
|
||||||
size_t size) {
|
size_t size) {
|
||||||
return L0::Context::fromHandle(hContext)->unMapVirtualMem(ptr, size);
|
return L0::Context::fromHandle(hContext)->unMapVirtualMem(ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemSetAccessAttribute(
|
||||||
zeVirtualMemSetAccessAttribute(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *ptr,
|
const void *ptr,
|
||||||
size_t size,
|
size_t size,
|
||||||
@@ -107,8 +98,7 @@ zeVirtualMemSetAccessAttribute(
|
|||||||
return L0::Context::fromHandle(hContext)->setVirtualMemAccessAttribute(ptr, size, access);
|
return L0::Context::fromHandle(hContext)->setVirtualMemAccessAttribute(ptr, size, access);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeVirtualMemGetAccessAttribute(
|
||||||
zeVirtualMemGetAccessAttribute(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *ptr,
|
const void *ptr,
|
||||||
size_t size,
|
size_t size,
|
||||||
@@ -117,15 +107,13 @@ zeVirtualMemGetAccessAttribute(
|
|||||||
return L0::Context::fromHandle(hContext)->getVirtualMemAccessAttribute(ptr, size, access, outSize);
|
return L0::Context::fromHandle(hContext)->getVirtualMemAccessAttribute(ptr, size, access, outSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextSystemBarrier(
|
||||||
zeContextSystemBarrier(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice) {
|
ze_device_handle_t hDevice) {
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextMakeMemoryResident(
|
||||||
zeContextMakeMemoryResident(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
void *ptr,
|
void *ptr,
|
||||||
@@ -133,8 +121,7 @@ zeContextMakeMemoryResident(
|
|||||||
return L0::Context::fromHandle(hContext)->makeMemoryResident(hDevice, ptr, size);
|
return L0::Context::fromHandle(hContext)->makeMemoryResident(hDevice, ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextEvictMemory(
|
||||||
zeContextEvictMemory(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
void *ptr,
|
void *ptr,
|
||||||
@@ -142,18 +129,56 @@ zeContextEvictMemory(
|
|||||||
return L0::Context::fromHandle(hContext)->evictMemory(hDevice, ptr, size);
|
return L0::Context::fromHandle(hContext)->evictMemory(hDevice, ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextMakeImageResident(
|
||||||
zeContextMakeImageResident(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
ze_image_handle_t hImage) {
|
ze_image_handle_t hImage) {
|
||||||
return L0::Context::fromHandle(hContext)->makeImageResident(hDevice, hImage);
|
return L0::Context::fromHandle(hContext)->makeImageResident(hDevice, hImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zeContextEvictImage(
|
||||||
zeContextEvictImage(
|
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
ze_image_handle_t hImage) {
|
ze_image_handle_t hImage) {
|
||||||
return L0::Context::fromHandle(hContext)->evictImage(hDevice, hImage);
|
return L0::Context::fromHandle(hContext)->evictImage(hDevice, hImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextCreate(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
const ze_context_desc_t *desc,
|
||||||
|
ze_context_handle_t *phContext) {
|
||||||
|
return L0::zeContextCreate(
|
||||||
|
hDriver,
|
||||||
|
desc,
|
||||||
|
phContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextCreateEx(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
const ze_context_desc_t *desc,
|
||||||
|
uint32_t numDevices,
|
||||||
|
ze_device_handle_t *phDevices,
|
||||||
|
ze_context_handle_t *phContext) {
|
||||||
|
return L0::zeContextCreateEx(
|
||||||
|
hDriver,
|
||||||
|
desc,
|
||||||
|
numDevices,
|
||||||
|
phDevices,
|
||||||
|
phContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextDestroy(
|
||||||
|
ze_context_handle_t hContext) {
|
||||||
|
return L0::zeContextDestroy(
|
||||||
|
hContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextGetStatus(
|
||||||
|
ze_context_handle_t hContext) {
|
||||||
|
return L0::zeContextGetStatus(
|
||||||
|
hContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemoryCopy(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
void *dstptr,
|
|
||||||
const void *srcptr,
|
|
||||||
size_t size,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemoryCopy(dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemoryFill(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
void *ptr,
|
|
||||||
const void *pattern,
|
|
||||||
size_t patternSize,
|
|
||||||
size_t size,
|
|
||||||
ze_event_handle_t hEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemoryFill(ptr, pattern, patternSize, size, hEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemoryCopyRegion(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
void *dstptr,
|
|
||||||
const ze_copy_region_t *dstRegion,
|
|
||||||
uint32_t dstPitch,
|
|
||||||
uint32_t dstSlicePitch,
|
|
||||||
const void *srcptr,
|
|
||||||
const ze_copy_region_t *srcRegion,
|
|
||||||
uint32_t srcPitch,
|
|
||||||
uint32_t srcSlicePitch,
|
|
||||||
ze_event_handle_t hEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemoryCopyRegion(dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendImageCopy(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_image_handle_t hDstImage,
|
|
||||||
ze_image_handle_t hSrcImage,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendImageCopy(hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendImageCopyRegion(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_image_handle_t hDstImage,
|
|
||||||
ze_image_handle_t hSrcImage,
|
|
||||||
const ze_image_region_t *pDstRegion,
|
|
||||||
const ze_image_region_t *pSrcRegion,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendImageCopyRegion(hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendImageCopyToMemory(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
void *dstptr,
|
|
||||||
ze_image_handle_t hSrcImage,
|
|
||||||
const ze_image_region_t *pSrcRegion,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendImageCopyToMemory(dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendImageCopyFromMemory(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_image_handle_t hDstImage,
|
|
||||||
const void *srcptr,
|
|
||||||
const ze_image_region_t *pDstRegion,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendImageCopyFromMemory(hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemoryPrefetch(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
const void *ptr,
|
|
||||||
size_t size) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemoryPrefetch(ptr, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemAdvise(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const void *ptr,
|
|
||||||
size_t size,
|
|
||||||
ze_memory_advice_t advice) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemAdvise(hDevice, ptr, size, advice);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendMemoryCopyFromContext(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
void *dstptr,
|
|
||||||
ze_context_handle_t hContextSrc,
|
|
||||||
const void *srcptr,
|
|
||||||
size_t size,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMemoryCopyFromContext(dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
309
level_zero/api/core/ze_copy_api_entrypoints.h
Normal file
309
level_zero/api/core/ze_copy_api_entrypoints.h
Normal file
@@ -0,0 +1,309 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeCommandListAppendMemoryCopy(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
const void *srcptr,
|
||||||
|
size_t size,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemoryCopy(dstptr, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendMemoryFill(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *ptr,
|
||||||
|
const void *pattern,
|
||||||
|
size_t patternSize,
|
||||||
|
size_t size,
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemoryFill(ptr, pattern, patternSize, size, hEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendMemoryCopyRegion(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
const ze_copy_region_t *dstRegion,
|
||||||
|
uint32_t dstPitch,
|
||||||
|
uint32_t dstSlicePitch,
|
||||||
|
const void *srcptr,
|
||||||
|
const ze_copy_region_t *srcRegion,
|
||||||
|
uint32_t srcPitch,
|
||||||
|
uint32_t srcSlicePitch,
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemoryCopyRegion(dstptr, dstRegion, dstPitch, dstSlicePitch, srcptr, srcRegion, srcPitch, srcSlicePitch, hEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendImageCopy(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_image_handle_t hDstImage,
|
||||||
|
ze_image_handle_t hSrcImage,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendImageCopy(hDstImage, hSrcImage, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendImageCopyRegion(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_image_handle_t hDstImage,
|
||||||
|
ze_image_handle_t hSrcImage,
|
||||||
|
const ze_image_region_t *pDstRegion,
|
||||||
|
const ze_image_region_t *pSrcRegion,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendImageCopyRegion(hDstImage, hSrcImage, pDstRegion, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendImageCopyToMemory(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
ze_image_handle_t hSrcImage,
|
||||||
|
const ze_image_region_t *pSrcRegion,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendImageCopyToMemory(dstptr, hSrcImage, pSrcRegion, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendImageCopyFromMemory(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_image_handle_t hDstImage,
|
||||||
|
const void *srcptr,
|
||||||
|
const ze_image_region_t *pDstRegion,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendImageCopyFromMemory(hDstImage, srcptr, pDstRegion, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendMemoryPrefetch(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
const void *ptr,
|
||||||
|
size_t size) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemoryPrefetch(ptr, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendMemAdvise(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const void *ptr,
|
||||||
|
size_t size,
|
||||||
|
ze_memory_advice_t advice) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemAdvise(hDevice, ptr, size, advice);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendMemoryCopyFromContext(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
ze_context_handle_t hContextSrc,
|
||||||
|
const void *srcptr,
|
||||||
|
size_t size,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMemoryCopyFromContext(dstptr, hContextSrc, srcptr, size, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopy(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
const void *srcptr,
|
||||||
|
size_t size,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendMemoryCopy(
|
||||||
|
hCommandList,
|
||||||
|
dstptr,
|
||||||
|
srcptr,
|
||||||
|
size,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryFill(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *ptr,
|
||||||
|
const void *pattern,
|
||||||
|
size_t patternSize,
|
||||||
|
size_t size,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendMemoryFill(
|
||||||
|
hCommandList,
|
||||||
|
ptr,
|
||||||
|
pattern,
|
||||||
|
patternSize,
|
||||||
|
size,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopyRegion(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
const ze_copy_region_t *dstRegion,
|
||||||
|
uint32_t dstPitch,
|
||||||
|
uint32_t dstSlicePitch,
|
||||||
|
const void *srcptr,
|
||||||
|
const ze_copy_region_t *srcRegion,
|
||||||
|
uint32_t srcPitch,
|
||||||
|
uint32_t srcSlicePitch,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendMemoryCopyRegion(
|
||||||
|
hCommandList,
|
||||||
|
dstptr,
|
||||||
|
dstRegion,
|
||||||
|
dstPitch,
|
||||||
|
dstSlicePitch,
|
||||||
|
srcptr,
|
||||||
|
srcRegion,
|
||||||
|
srcPitch,
|
||||||
|
srcSlicePitch,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryCopyFromContext(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
ze_context_handle_t hContextSrc,
|
||||||
|
const void *srcptr,
|
||||||
|
size_t size,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendMemoryCopyFromContext(
|
||||||
|
hCommandList,
|
||||||
|
dstptr,
|
||||||
|
hContextSrc,
|
||||||
|
srcptr,
|
||||||
|
size,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopy(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_image_handle_t hDstImage,
|
||||||
|
ze_image_handle_t hSrcImage,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendImageCopy(
|
||||||
|
hCommandList,
|
||||||
|
hDstImage,
|
||||||
|
hSrcImage,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopyRegion(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_image_handle_t hDstImage,
|
||||||
|
ze_image_handle_t hSrcImage,
|
||||||
|
const ze_image_region_t *pDstRegion,
|
||||||
|
const ze_image_region_t *pSrcRegion,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendImageCopyRegion(
|
||||||
|
hCommandList,
|
||||||
|
hDstImage,
|
||||||
|
hSrcImage,
|
||||||
|
pDstRegion,
|
||||||
|
pSrcRegion,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopyToMemory(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
void *dstptr,
|
||||||
|
ze_image_handle_t hSrcImage,
|
||||||
|
const ze_image_region_t *pSrcRegion,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendImageCopyToMemory(
|
||||||
|
hCommandList,
|
||||||
|
dstptr,
|
||||||
|
hSrcImage,
|
||||||
|
pSrcRegion,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendImageCopyFromMemory(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_image_handle_t hDstImage,
|
||||||
|
const void *srcptr,
|
||||||
|
const ze_image_region_t *pDstRegion,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendImageCopyFromMemory(
|
||||||
|
hCommandList,
|
||||||
|
hDstImage,
|
||||||
|
srcptr,
|
||||||
|
pDstRegion,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemoryPrefetch(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
const void *ptr,
|
||||||
|
size_t size) {
|
||||||
|
return L0::zeCommandListAppendMemoryPrefetch(
|
||||||
|
hCommandList,
|
||||||
|
ptr,
|
||||||
|
size);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendMemAdvise(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const void *ptr,
|
||||||
|
size_t size,
|
||||||
|
ze_memory_advice_t advice) {
|
||||||
|
return L0::zeCommandListAppendMemAdvise(
|
||||||
|
hCommandList,
|
||||||
|
hDevice,
|
||||||
|
ptr,
|
||||||
|
size,
|
||||||
|
advice);
|
||||||
|
}
|
||||||
|
}
|
||||||
21
level_zero/api/core/ze_core_all_api_entrypoints.h
Normal file
21
level_zero/api/core/ze_core_all_api_entrypoints.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "ze_barrier_api_entrypoints.h"
|
||||||
|
#include "ze_cmdlist_api_entrypoints.h"
|
||||||
|
#include "ze_cmdqueue_api_entrypoints.h"
|
||||||
|
#include "ze_context_api_entrypoints.h"
|
||||||
|
#include "ze_copy_api_entrypoints.h"
|
||||||
|
#include "ze_device_api_entrypoints.h"
|
||||||
|
#include "ze_driver_api_entrypoints.h"
|
||||||
|
#include "ze_event_api_entrypoints.h"
|
||||||
|
#include "ze_fence_api_entrypoints.h"
|
||||||
|
#include "ze_image_api_entrypoints.h"
|
||||||
|
#include "ze_memory_api_entrypoints.h"
|
||||||
|
#include "ze_module_api_entrypoints.h"
|
||||||
|
#include "ze_sampler_api_entrypoints.h"
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <level_zero/zet_api.h>
|
#include <level_zero/zet_api.h>
|
||||||
#include <level_zero/zet_ddi.h>
|
#include <level_zero/zet_ddi.h>
|
||||||
|
|
||||||
|
#include "ze_core_all_api_entrypoints.h"
|
||||||
#include "ze_ddi_tables.h"
|
#include "ze_ddi_tables.h"
|
||||||
|
|
||||||
ze_gpu_driver_dditable_t driver_ddiTable;
|
ze_gpu_driver_dditable_t driver_ddiTable;
|
||||||
@@ -27,12 +28,12 @@ zeGetDriverProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGet = zeDriverGet;
|
pDdiTable->pfnGet = L0::zeDriverGet;
|
||||||
pDdiTable->pfnGetApiVersion = zeDriverGetApiVersion;
|
pDdiTable->pfnGetApiVersion = L0::zeDriverGetApiVersion;
|
||||||
pDdiTable->pfnGetProperties = zeDriverGetProperties;
|
pDdiTable->pfnGetProperties = L0::zeDriverGetProperties;
|
||||||
pDdiTable->pfnGetIpcProperties = zeDriverGetIpcProperties;
|
pDdiTable->pfnGetIpcProperties = L0::zeDriverGetIpcProperties;
|
||||||
pDdiTable->pfnGetExtensionProperties = zeDriverGetExtensionProperties;
|
pDdiTable->pfnGetExtensionProperties = L0::zeDriverGetExtensionProperties;
|
||||||
pDdiTable->pfnGetExtensionFunctionAddress = zeDriverGetExtensionFunctionAddress;
|
pDdiTable->pfnGetExtensionFunctionAddress = L0::zeDriverGetExtensionFunctionAddress;
|
||||||
driver_ddiTable.core_ddiTable.Driver = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Driver = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnGet = zeDriverGetTracing;
|
pDdiTable->pfnGet = zeDriverGetTracing;
|
||||||
@@ -56,16 +57,16 @@ zeGetMemProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnAllocShared = zeMemAllocShared;
|
pDdiTable->pfnAllocShared = L0::zeMemAllocShared;
|
||||||
pDdiTable->pfnAllocDevice = zeMemAllocDevice;
|
pDdiTable->pfnAllocDevice = L0::zeMemAllocDevice;
|
||||||
pDdiTable->pfnAllocHost = zeMemAllocHost;
|
pDdiTable->pfnAllocHost = L0::zeMemAllocHost;
|
||||||
pDdiTable->pfnFree = zeMemFree;
|
pDdiTable->pfnFree = L0::zeMemFree;
|
||||||
pDdiTable->pfnFreeExt = zeMemFreeExt;
|
pDdiTable->pfnFreeExt = L0::zeMemFreeExt;
|
||||||
pDdiTable->pfnGetAllocProperties = zeMemGetAllocProperties;
|
pDdiTable->pfnGetAllocProperties = L0::zeMemGetAllocProperties;
|
||||||
pDdiTable->pfnGetAddressRange = zeMemGetAddressRange;
|
pDdiTable->pfnGetAddressRange = L0::zeMemGetAddressRange;
|
||||||
pDdiTable->pfnGetIpcHandle = zeMemGetIpcHandle;
|
pDdiTable->pfnGetIpcHandle = L0::zeMemGetIpcHandle;
|
||||||
pDdiTable->pfnOpenIpcHandle = zeMemOpenIpcHandle;
|
pDdiTable->pfnOpenIpcHandle = L0::zeMemOpenIpcHandle;
|
||||||
pDdiTable->pfnCloseIpcHandle = zeMemCloseIpcHandle;
|
pDdiTable->pfnCloseIpcHandle = L0::zeMemCloseIpcHandle;
|
||||||
driver_ddiTable.core_ddiTable.Mem = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Mem = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnAllocShared = zeMemAllocSharedTracing;
|
pDdiTable->pfnAllocShared = zeMemAllocSharedTracing;
|
||||||
@@ -94,15 +95,15 @@ zeGetContextProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeContextCreate;
|
pDdiTable->pfnCreate = L0::zeContextCreate;
|
||||||
pDdiTable->pfnCreateEx = zeContextCreateEx;
|
pDdiTable->pfnCreateEx = L0::zeContextCreateEx;
|
||||||
pDdiTable->pfnDestroy = zeContextDestroy;
|
pDdiTable->pfnDestroy = L0::zeContextDestroy;
|
||||||
pDdiTable->pfnGetStatus = zeContextGetStatus;
|
pDdiTable->pfnGetStatus = L0::zeContextGetStatus;
|
||||||
pDdiTable->pfnSystemBarrier = zeContextSystemBarrier;
|
pDdiTable->pfnSystemBarrier = L0::zeContextSystemBarrier;
|
||||||
pDdiTable->pfnMakeMemoryResident = zeContextMakeMemoryResident;
|
pDdiTable->pfnMakeMemoryResident = L0::zeContextMakeMemoryResident;
|
||||||
pDdiTable->pfnEvictMemory = zeContextEvictMemory;
|
pDdiTable->pfnEvictMemory = L0::zeContextEvictMemory;
|
||||||
pDdiTable->pfnMakeImageResident = zeContextMakeImageResident;
|
pDdiTable->pfnMakeImageResident = L0::zeContextMakeImageResident;
|
||||||
pDdiTable->pfnEvictImage = zeContextEvictImage;
|
pDdiTable->pfnEvictImage = L0::zeContextEvictImage;
|
||||||
|
|
||||||
driver_ddiTable.core_ddiTable.Context = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Context = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
@@ -131,8 +132,8 @@ zeGetPhysicalMemProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zePhysicalMemCreate;
|
pDdiTable->pfnCreate = L0::zePhysicalMemCreate;
|
||||||
pDdiTable->pfnDestroy = zePhysicalMemDestroy;
|
pDdiTable->pfnDestroy = L0::zePhysicalMemDestroy;
|
||||||
|
|
||||||
driver_ddiTable.core_ddiTable.PhysicalMem = *pDdiTable;
|
driver_ddiTable.core_ddiTable.PhysicalMem = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
@@ -154,13 +155,13 @@ zeGetVirtualMemProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnReserve = zeVirtualMemReserve;
|
pDdiTable->pfnReserve = L0::zeVirtualMemReserve;
|
||||||
pDdiTable->pfnFree = zeVirtualMemFree;
|
pDdiTable->pfnFree = L0::zeVirtualMemFree;
|
||||||
pDdiTable->pfnQueryPageSize = zeVirtualMemQueryPageSize;
|
pDdiTable->pfnQueryPageSize = L0::zeVirtualMemQueryPageSize;
|
||||||
pDdiTable->pfnMap = zeVirtualMemMap;
|
pDdiTable->pfnMap = L0::zeVirtualMemMap;
|
||||||
pDdiTable->pfnUnmap = zeVirtualMemUnmap;
|
pDdiTable->pfnUnmap = L0::zeVirtualMemUnmap;
|
||||||
pDdiTable->pfnSetAccessAttribute = zeVirtualMemSetAccessAttribute;
|
pDdiTable->pfnSetAccessAttribute = L0::zeVirtualMemSetAccessAttribute;
|
||||||
pDdiTable->pfnGetAccessAttribute = zeVirtualMemGetAccessAttribute;
|
pDdiTable->pfnGetAccessAttribute = L0::zeVirtualMemGetAccessAttribute;
|
||||||
|
|
||||||
driver_ddiTable.core_ddiTable.VirtualMem = *pDdiTable;
|
driver_ddiTable.core_ddiTable.VirtualMem = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
@@ -187,7 +188,7 @@ zeGetGlobalProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnInit = zeInit;
|
pDdiTable->pfnInit = L0::zeInit;
|
||||||
driver_ddiTable.core_ddiTable.Global = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Global = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnInit = zeInitTracing;
|
pDdiTable->pfnInit = zeInitTracing;
|
||||||
@@ -207,24 +208,24 @@ zeGetDeviceProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGet = zeDeviceGet;
|
pDdiTable->pfnGet = L0::zeDeviceGet;
|
||||||
pDdiTable->pfnGetCommandQueueGroupProperties = zeDeviceGetCommandQueueGroupProperties;
|
pDdiTable->pfnGetCommandQueueGroupProperties = L0::zeDeviceGetCommandQueueGroupProperties;
|
||||||
pDdiTable->pfnGetSubDevices = zeDeviceGetSubDevices;
|
pDdiTable->pfnGetSubDevices = L0::zeDeviceGetSubDevices;
|
||||||
pDdiTable->pfnGetProperties = zeDeviceGetProperties;
|
pDdiTable->pfnGetProperties = L0::zeDeviceGetProperties;
|
||||||
pDdiTable->pfnGetComputeProperties = zeDeviceGetComputeProperties;
|
pDdiTable->pfnGetComputeProperties = L0::zeDeviceGetComputeProperties;
|
||||||
pDdiTable->pfnGetModuleProperties = zeDeviceGetModuleProperties;
|
pDdiTable->pfnGetModuleProperties = L0::zeDeviceGetModuleProperties;
|
||||||
pDdiTable->pfnGetMemoryProperties = zeDeviceGetMemoryProperties;
|
pDdiTable->pfnGetMemoryProperties = L0::zeDeviceGetMemoryProperties;
|
||||||
pDdiTable->pfnGetMemoryAccessProperties = zeDeviceGetMemoryAccessProperties;
|
pDdiTable->pfnGetMemoryAccessProperties = L0::zeDeviceGetMemoryAccessProperties;
|
||||||
pDdiTable->pfnGetCacheProperties = zeDeviceGetCacheProperties;
|
pDdiTable->pfnGetCacheProperties = L0::zeDeviceGetCacheProperties;
|
||||||
pDdiTable->pfnGetImageProperties = zeDeviceGetImageProperties;
|
pDdiTable->pfnGetImageProperties = L0::zeDeviceGetImageProperties;
|
||||||
pDdiTable->pfnGetP2PProperties = zeDeviceGetP2PProperties;
|
pDdiTable->pfnGetP2PProperties = L0::zeDeviceGetP2PProperties;
|
||||||
pDdiTable->pfnCanAccessPeer = zeDeviceCanAccessPeer;
|
pDdiTable->pfnCanAccessPeer = L0::zeDeviceCanAccessPeer;
|
||||||
pDdiTable->pfnGetStatus = zeDeviceGetStatus;
|
pDdiTable->pfnGetStatus = L0::zeDeviceGetStatus;
|
||||||
pDdiTable->pfnGetExternalMemoryProperties = zeDeviceGetExternalMemoryProperties;
|
pDdiTable->pfnGetExternalMemoryProperties = L0::zeDeviceGetExternalMemoryProperties;
|
||||||
pDdiTable->pfnGetGlobalTimestamps = zeDeviceGetGlobalTimestamps;
|
pDdiTable->pfnGetGlobalTimestamps = L0::zeDeviceGetGlobalTimestamps;
|
||||||
pDdiTable->pfnReserveCacheExt = zeDeviceReserveCacheExt;
|
pDdiTable->pfnReserveCacheExt = L0::zeDeviceReserveCacheExt;
|
||||||
pDdiTable->pfnSetCacheAdviceExt = zeDeviceSetCacheAdviceExt;
|
pDdiTable->pfnSetCacheAdviceExt = L0::zeDeviceSetCacheAdviceExt;
|
||||||
pDdiTable->pfnPciGetPropertiesExt = zeDevicePciGetPropertiesExt;
|
pDdiTable->pfnPciGetPropertiesExt = L0::zeDevicePciGetPropertiesExt;
|
||||||
driver_ddiTable.core_ddiTable.Device = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Device = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnGet = zeDeviceGetTracing;
|
pDdiTable->pfnGet = zeDeviceGetTracing;
|
||||||
@@ -257,10 +258,10 @@ zeGetCommandQueueProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeCommandQueueCreate;
|
pDdiTable->pfnCreate = L0::zeCommandQueueCreate;
|
||||||
pDdiTable->pfnDestroy = zeCommandQueueDestroy;
|
pDdiTable->pfnDestroy = L0::zeCommandQueueDestroy;
|
||||||
pDdiTable->pfnExecuteCommandLists = zeCommandQueueExecuteCommandLists;
|
pDdiTable->pfnExecuteCommandLists = L0::zeCommandQueueExecuteCommandLists;
|
||||||
pDdiTable->pfnSynchronize = zeCommandQueueSynchronize;
|
pDdiTable->pfnSynchronize = L0::zeCommandQueueSynchronize;
|
||||||
driver_ddiTable.core_ddiTable.CommandQueue = *pDdiTable;
|
driver_ddiTable.core_ddiTable.CommandQueue = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeCommandQueueCreateTracing;
|
pDdiTable->pfnCreate = zeCommandQueueCreateTracing;
|
||||||
@@ -283,32 +284,32 @@ zeGetCommandListProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnAppendBarrier = zeCommandListAppendBarrier;
|
pDdiTable->pfnAppendBarrier = L0::zeCommandListAppendBarrier;
|
||||||
pDdiTable->pfnAppendMemoryRangesBarrier = zeCommandListAppendMemoryRangesBarrier;
|
pDdiTable->pfnAppendMemoryRangesBarrier = L0::zeCommandListAppendMemoryRangesBarrier;
|
||||||
pDdiTable->pfnCreate = zeCommandListCreate;
|
pDdiTable->pfnCreate = L0::zeCommandListCreate;
|
||||||
pDdiTable->pfnCreateImmediate = zeCommandListCreateImmediate;
|
pDdiTable->pfnCreateImmediate = L0::zeCommandListCreateImmediate;
|
||||||
pDdiTable->pfnDestroy = zeCommandListDestroy;
|
pDdiTable->pfnDestroy = L0::zeCommandListDestroy;
|
||||||
pDdiTable->pfnClose = zeCommandListClose;
|
pDdiTable->pfnClose = L0::zeCommandListClose;
|
||||||
pDdiTable->pfnReset = zeCommandListReset;
|
pDdiTable->pfnReset = L0::zeCommandListReset;
|
||||||
pDdiTable->pfnAppendMemoryCopy = zeCommandListAppendMemoryCopy;
|
pDdiTable->pfnAppendMemoryCopy = L0::zeCommandListAppendMemoryCopy;
|
||||||
pDdiTable->pfnAppendMemoryCopyRegion = zeCommandListAppendMemoryCopyRegion;
|
pDdiTable->pfnAppendMemoryCopyRegion = L0::zeCommandListAppendMemoryCopyRegion;
|
||||||
pDdiTable->pfnAppendMemoryFill = zeCommandListAppendMemoryFill;
|
pDdiTable->pfnAppendMemoryFill = L0::zeCommandListAppendMemoryFill;
|
||||||
pDdiTable->pfnAppendImageCopy = zeCommandListAppendImageCopy;
|
pDdiTable->pfnAppendImageCopy = L0::zeCommandListAppendImageCopy;
|
||||||
pDdiTable->pfnAppendImageCopyRegion = zeCommandListAppendImageCopyRegion;
|
pDdiTable->pfnAppendImageCopyRegion = L0::zeCommandListAppendImageCopyRegion;
|
||||||
pDdiTable->pfnAppendImageCopyToMemory = zeCommandListAppendImageCopyToMemory;
|
pDdiTable->pfnAppendImageCopyToMemory = L0::zeCommandListAppendImageCopyToMemory;
|
||||||
pDdiTable->pfnAppendImageCopyFromMemory = zeCommandListAppendImageCopyFromMemory;
|
pDdiTable->pfnAppendImageCopyFromMemory = L0::zeCommandListAppendImageCopyFromMemory;
|
||||||
pDdiTable->pfnAppendMemoryPrefetch = zeCommandListAppendMemoryPrefetch;
|
pDdiTable->pfnAppendMemoryPrefetch = L0::zeCommandListAppendMemoryPrefetch;
|
||||||
pDdiTable->pfnAppendMemAdvise = zeCommandListAppendMemAdvise;
|
pDdiTable->pfnAppendMemAdvise = L0::zeCommandListAppendMemAdvise;
|
||||||
pDdiTable->pfnAppendSignalEvent = zeCommandListAppendSignalEvent;
|
pDdiTable->pfnAppendSignalEvent = L0::zeCommandListAppendSignalEvent;
|
||||||
pDdiTable->pfnAppendWaitOnEvents = zeCommandListAppendWaitOnEvents;
|
pDdiTable->pfnAppendWaitOnEvents = L0::zeCommandListAppendWaitOnEvents;
|
||||||
pDdiTable->pfnAppendEventReset = zeCommandListAppendEventReset;
|
pDdiTable->pfnAppendEventReset = L0::zeCommandListAppendEventReset;
|
||||||
pDdiTable->pfnAppendLaunchKernel = zeCommandListAppendLaunchKernel;
|
pDdiTable->pfnAppendLaunchKernel = L0::zeCommandListAppendLaunchKernel;
|
||||||
pDdiTable->pfnAppendLaunchCooperativeKernel = zeCommandListAppendLaunchCooperativeKernel;
|
pDdiTable->pfnAppendLaunchCooperativeKernel = L0::zeCommandListAppendLaunchCooperativeKernel;
|
||||||
pDdiTable->pfnAppendLaunchKernelIndirect = zeCommandListAppendLaunchKernelIndirect;
|
pDdiTable->pfnAppendLaunchKernelIndirect = L0::zeCommandListAppendLaunchKernelIndirect;
|
||||||
pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = zeCommandListAppendLaunchMultipleKernelsIndirect;
|
pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = L0::zeCommandListAppendLaunchMultipleKernelsIndirect;
|
||||||
pDdiTable->pfnAppendWriteGlobalTimestamp = zeCommandListAppendWriteGlobalTimestamp;
|
pDdiTable->pfnAppendWriteGlobalTimestamp = L0::zeCommandListAppendWriteGlobalTimestamp;
|
||||||
pDdiTable->pfnAppendMemoryCopyFromContext = zeCommandListAppendMemoryCopyFromContext;
|
pDdiTable->pfnAppendMemoryCopyFromContext = L0::zeCommandListAppendMemoryCopyFromContext;
|
||||||
pDdiTable->pfnAppendQueryKernelTimestamps = zeCommandListAppendQueryKernelTimestamps;
|
pDdiTable->pfnAppendQueryKernelTimestamps = L0::zeCommandListAppendQueryKernelTimestamps;
|
||||||
driver_ddiTable.core_ddiTable.CommandList = *pDdiTable;
|
driver_ddiTable.core_ddiTable.CommandList = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnAppendBarrier = zeCommandListAppendBarrierTracing;
|
pDdiTable->pfnAppendBarrier = zeCommandListAppendBarrierTracing;
|
||||||
@@ -353,11 +354,11 @@ zeGetFenceProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeFenceCreate;
|
pDdiTable->pfnCreate = L0::zeFenceCreate;
|
||||||
pDdiTable->pfnDestroy = zeFenceDestroy;
|
pDdiTable->pfnDestroy = L0::zeFenceDestroy;
|
||||||
pDdiTable->pfnHostSynchronize = zeFenceHostSynchronize;
|
pDdiTable->pfnHostSynchronize = L0::zeFenceHostSynchronize;
|
||||||
pDdiTable->pfnQueryStatus = zeFenceQueryStatus;
|
pDdiTable->pfnQueryStatus = L0::zeFenceQueryStatus;
|
||||||
pDdiTable->pfnReset = zeFenceReset;
|
pDdiTable->pfnReset = L0::zeFenceReset;
|
||||||
driver_ddiTable.core_ddiTable.Fence = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Fence = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeFenceCreateTracing;
|
pDdiTable->pfnCreate = zeFenceCreateTracing;
|
||||||
@@ -381,11 +382,11 @@ zeGetEventPoolProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeEventPoolCreate;
|
pDdiTable->pfnCreate = L0::zeEventPoolCreate;
|
||||||
pDdiTable->pfnDestroy = zeEventPoolDestroy;
|
pDdiTable->pfnDestroy = L0::zeEventPoolDestroy;
|
||||||
pDdiTable->pfnGetIpcHandle = zeEventPoolGetIpcHandle;
|
pDdiTable->pfnGetIpcHandle = L0::zeEventPoolGetIpcHandle;
|
||||||
pDdiTable->pfnOpenIpcHandle = zeEventPoolOpenIpcHandle;
|
pDdiTable->pfnOpenIpcHandle = L0::zeEventPoolOpenIpcHandle;
|
||||||
pDdiTable->pfnCloseIpcHandle = zeEventPoolCloseIpcHandle;
|
pDdiTable->pfnCloseIpcHandle = L0::zeEventPoolCloseIpcHandle;
|
||||||
driver_ddiTable.core_ddiTable.EventPool = *pDdiTable;
|
driver_ddiTable.core_ddiTable.EventPool = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeEventPoolCreateTracing;
|
pDdiTable->pfnCreate = zeEventPoolCreateTracing;
|
||||||
@@ -409,13 +410,13 @@ zeGetEventProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeEventCreate;
|
pDdiTable->pfnCreate = L0::zeEventCreate;
|
||||||
pDdiTable->pfnDestroy = zeEventDestroy;
|
pDdiTable->pfnDestroy = L0::zeEventDestroy;
|
||||||
pDdiTable->pfnHostSignal = zeEventHostSignal;
|
pDdiTable->pfnHostSignal = L0::zeEventHostSignal;
|
||||||
pDdiTable->pfnHostSynchronize = zeEventHostSynchronize;
|
pDdiTable->pfnHostSynchronize = L0::zeEventHostSynchronize;
|
||||||
pDdiTable->pfnQueryStatus = zeEventQueryStatus;
|
pDdiTable->pfnQueryStatus = L0::zeEventQueryStatus;
|
||||||
pDdiTable->pfnHostReset = zeEventHostReset;
|
pDdiTable->pfnHostReset = L0::zeEventHostReset;
|
||||||
pDdiTable->pfnQueryKernelTimestamp = zeEventQueryKernelTimestamp;
|
pDdiTable->pfnQueryKernelTimestamp = L0::zeEventQueryKernelTimestamp;
|
||||||
driver_ddiTable.core_ddiTable.Event = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Event = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeEventCreateTracing;
|
pDdiTable->pfnCreate = zeEventCreateTracing;
|
||||||
@@ -440,7 +441,7 @@ zeGetEventExpProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnQueryTimestampsExp = zeEventQueryTimestampsExp;
|
pDdiTable->pfnQueryTimestampsExp = L0::zeEventQueryTimestampsExp;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -457,16 +458,16 @@ zeGetImageProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGetProperties = zeImageGetProperties;
|
pDdiTable->pfnGetProperties = L0::zeImageGetProperties;
|
||||||
pDdiTable->pfnCreate = zeImageCreate;
|
pDdiTable->pfnCreate = L0::zeImageCreate;
|
||||||
pDdiTable->pfnDestroy = zeImageDestroy;
|
pDdiTable->pfnDestroy = L0::zeImageDestroy;
|
||||||
pDdiTable->pfnGetAllocPropertiesExt = zeImageGetAllocPropertiesExt;
|
pDdiTable->pfnGetAllocPropertiesExt = L0::zeImageGetAllocPropertiesExt;
|
||||||
driver_ddiTable.core_ddiTable.Image = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Image = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnGetProperties = zeImageGetPropertiesTracing;
|
pDdiTable->pfnGetProperties = zeImageGetPropertiesTracing;
|
||||||
pDdiTable->pfnCreate = zeImageCreateTracing;
|
pDdiTable->pfnCreate = zeImageCreateTracing;
|
||||||
pDdiTable->pfnDestroy = zeImageDestroyTracing;
|
pDdiTable->pfnDestroy = zeImageDestroyTracing;
|
||||||
pDdiTable->pfnGetAllocPropertiesExt = zeImageGetAllocPropertiesExt;
|
pDdiTable->pfnGetAllocPropertiesExt = L0::zeImageGetAllocPropertiesExt;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -483,14 +484,14 @@ zeGetModuleProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeModuleCreate;
|
pDdiTable->pfnCreate = L0::zeModuleCreate;
|
||||||
pDdiTable->pfnDestroy = zeModuleDestroy;
|
pDdiTable->pfnDestroy = L0::zeModuleDestroy;
|
||||||
pDdiTable->pfnDynamicLink = zeModuleDynamicLink;
|
pDdiTable->pfnDynamicLink = L0::zeModuleDynamicLink;
|
||||||
pDdiTable->pfnGetNativeBinary = zeModuleGetNativeBinary;
|
pDdiTable->pfnGetNativeBinary = L0::zeModuleGetNativeBinary;
|
||||||
pDdiTable->pfnGetGlobalPointer = zeModuleGetGlobalPointer;
|
pDdiTable->pfnGetGlobalPointer = L0::zeModuleGetGlobalPointer;
|
||||||
pDdiTable->pfnGetKernelNames = zeModuleGetKernelNames;
|
pDdiTable->pfnGetKernelNames = L0::zeModuleGetKernelNames;
|
||||||
pDdiTable->pfnGetFunctionPointer = zeModuleGetFunctionPointer;
|
pDdiTable->pfnGetFunctionPointer = L0::zeModuleGetFunctionPointer;
|
||||||
pDdiTable->pfnGetProperties = zeModuleGetProperties;
|
pDdiTable->pfnGetProperties = L0::zeModuleGetProperties;
|
||||||
driver_ddiTable.core_ddiTable.Module = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Module = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeModuleCreateTracing;
|
pDdiTable->pfnCreate = zeModuleCreateTracing;
|
||||||
@@ -517,8 +518,8 @@ zeGetModuleBuildLogProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnDestroy = zeModuleBuildLogDestroy;
|
pDdiTable->pfnDestroy = L0::zeModuleBuildLogDestroy;
|
||||||
pDdiTable->pfnGetString = zeModuleBuildLogGetString;
|
pDdiTable->pfnGetString = L0::zeModuleBuildLogGetString;
|
||||||
driver_ddiTable.core_ddiTable.ModuleBuildLog = *pDdiTable;
|
driver_ddiTable.core_ddiTable.ModuleBuildLog = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnDestroy = zeModuleBuildLogDestroyTracing;
|
pDdiTable->pfnDestroy = zeModuleBuildLogDestroyTracing;
|
||||||
@@ -539,18 +540,18 @@ zeGetKernelProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeKernelCreate;
|
pDdiTable->pfnCreate = L0::zeKernelCreate;
|
||||||
pDdiTable->pfnDestroy = zeKernelDestroy;
|
pDdiTable->pfnDestroy = L0::zeKernelDestroy;
|
||||||
pDdiTable->pfnSetGroupSize = zeKernelSetGroupSize;
|
pDdiTable->pfnSetGroupSize = L0::zeKernelSetGroupSize;
|
||||||
pDdiTable->pfnSuggestGroupSize = zeKernelSuggestGroupSize;
|
pDdiTable->pfnSuggestGroupSize = L0::zeKernelSuggestGroupSize;
|
||||||
pDdiTable->pfnSuggestMaxCooperativeGroupCount = zeKernelSuggestMaxCooperativeGroupCount;
|
pDdiTable->pfnSuggestMaxCooperativeGroupCount = L0::zeKernelSuggestMaxCooperativeGroupCount;
|
||||||
pDdiTable->pfnSetArgumentValue = zeKernelSetArgumentValue;
|
pDdiTable->pfnSetArgumentValue = L0::zeKernelSetArgumentValue;
|
||||||
pDdiTable->pfnSetIndirectAccess = zeKernelSetIndirectAccess;
|
pDdiTable->pfnSetIndirectAccess = L0::zeKernelSetIndirectAccess;
|
||||||
pDdiTable->pfnGetIndirectAccess = zeKernelGetIndirectAccess;
|
pDdiTable->pfnGetIndirectAccess = L0::zeKernelGetIndirectAccess;
|
||||||
pDdiTable->pfnGetSourceAttributes = zeKernelGetSourceAttributes;
|
pDdiTable->pfnGetSourceAttributes = L0::zeKernelGetSourceAttributes;
|
||||||
pDdiTable->pfnGetProperties = zeKernelGetProperties;
|
pDdiTable->pfnGetProperties = L0::zeKernelGetProperties;
|
||||||
pDdiTable->pfnSetCacheConfig = zeKernelSetCacheConfig;
|
pDdiTable->pfnSetCacheConfig = L0::zeKernelSetCacheConfig;
|
||||||
pDdiTable->pfnGetName = zeKernelGetName;
|
pDdiTable->pfnGetName = L0::zeKernelGetName;
|
||||||
driver_ddiTable.core_ddiTable.Kernel = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Kernel = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeKernelCreateTracing;
|
pDdiTable->pfnCreate = zeKernelCreateTracing;
|
||||||
@@ -581,8 +582,8 @@ zeGetSamplerProcAddrTable(
|
|||||||
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
driver_ddiTable.enableTracing = getEnvToBool("ZET_ENABLE_API_TRACING_EXP");
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zeSamplerCreate;
|
pDdiTable->pfnCreate = L0::zeSamplerCreate;
|
||||||
pDdiTable->pfnDestroy = zeSamplerDestroy;
|
pDdiTable->pfnDestroy = L0::zeSamplerDestroy;
|
||||||
driver_ddiTable.core_ddiTable.Sampler = *pDdiTable;
|
driver_ddiTable.core_ddiTable.Sampler = *pDdiTable;
|
||||||
if (driver_ddiTable.enableTracing) {
|
if (driver_ddiTable.enableTracing) {
|
||||||
pDdiTable->pfnCreate = zeSamplerCreateTracing;
|
pDdiTable->pfnCreate = zeSamplerCreateTracing;
|
||||||
@@ -602,8 +603,8 @@ zeGetKernelExpProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnSetGlobalOffsetExp = zeKernelSetGlobalOffsetExp;
|
pDdiTable->pfnSetGlobalOffsetExp = L0::zeKernelSetGlobalOffsetExp;
|
||||||
pDdiTable->pfnSchedulingHintExp = zeKernelSchedulingHintExp;
|
pDdiTable->pfnSchedulingHintExp = L0::zeKernelSchedulingHintExp;
|
||||||
driver_ddiTable.core_ddiTable.KernelExp = *pDdiTable;
|
driver_ddiTable.core_ddiTable.KernelExp = *pDdiTable;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -619,8 +620,8 @@ zeGetImageExpProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGetMemoryPropertiesExp = zeImageGetMemoryPropertiesExp;
|
pDdiTable->pfnGetMemoryPropertiesExp = L0::zeImageGetMemoryPropertiesExp;
|
||||||
pDdiTable->pfnViewCreateExp = zeImageViewCreateExp;
|
pDdiTable->pfnViewCreateExp = L0::zeImageViewCreateExp;
|
||||||
driver_ddiTable.core_ddiTable.ImageExp = *pDdiTable;
|
driver_ddiTable.core_ddiTable.ImageExp = *pDdiTable;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,148 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/device/device.h"
|
|
||||||
#include "level_zero/core/source/driver/driver.h"
|
|
||||||
#include "level_zero/core/source/driver/driver_handle.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
#include <level_zero/ze_ddi.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGet(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_device_handle_t *phDevices) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getDevice(pCount, phDevices);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetSubDevices(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_device_handle_t *phSubdevices) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getSubDevices(pCount, phSubdevices);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_properties_t *pDeviceProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getProperties(pDeviceProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetComputeProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_compute_properties_t *pComputeProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getComputeProperties(pComputeProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetModuleProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_module_properties_t *pKernelProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getKernelProperties(pKernelProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetMemoryProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_device_memory_properties_t *pMemProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getMemoryProperties(pCount, pMemProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetMemoryAccessProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_memory_access_properties_t *pMemAccessProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getMemoryAccessProperties(pMemAccessProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetCacheProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_device_cache_properties_t *pCacheProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getCacheProperties(pCount, pCacheProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetImageProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_image_properties_t *pImageProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getDeviceImageProperties(pImageProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetP2PProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_handle_t hPeerDevice,
|
|
||||||
ze_device_p2p_properties_t *pP2PProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getP2PProperties(hPeerDevice, pP2PProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceCanAccessPeer(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_handle_t hPeerDevice,
|
|
||||||
ze_bool_t *value) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->canAccessPeer(hPeerDevice, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetCommandQueueGroupProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_command_queue_group_properties_t *pCommandQueueGroupProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getCommandQueueGroupProperties(pCount, pCommandQueueGroupProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetExternalMemoryProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_device_external_memory_properties_t *pExternalMemoryProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getExternalMemoryProperties(pExternalMemoryProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetStatus(
|
|
||||||
ze_device_handle_t hDevice) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceGetGlobalTimestamps(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
uint64_t *hostTimestamp,
|
|
||||||
uint64_t *deviceTimestamp) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getGlobalTimestamps(hostTimestamp, deviceTimestamp);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceReserveCacheExt(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
size_t cacheLevel,
|
|
||||||
size_t cacheReservationSize) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->reserveCache(cacheLevel, cacheReservationSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDeviceSetCacheAdviceExt(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
void *ptr,
|
|
||||||
size_t regionSize,
|
|
||||||
ze_cache_ext_region_t cacheRegion) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->setCacheAdvice(ptr, regionSize, cacheRegion);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDevicePciGetPropertiesExt(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_pci_ext_properties_t *pPciProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getPciProperties(pPciProperties);
|
|
||||||
}
|
|
||||||
292
level_zero/api/core/ze_device_api_entrypoints.h
Normal file
292
level_zero/api/core/ze_device_api_entrypoints.h
Normal file
@@ -0,0 +1,292 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/device/device.h"
|
||||||
|
#include "level_zero/core/source/driver/driver.h"
|
||||||
|
#include "level_zero/core/source/driver/driver_handle.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
#include <level_zero/ze_ddi.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeDeviceGet(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_handle_t *phDevices) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getDevice(pCount, phDevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetSubDevices(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_handle_t *phSubdevices) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getSubDevices(pCount, phSubdevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_properties_t *pDeviceProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getProperties(pDeviceProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetComputeProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_compute_properties_t *pComputeProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getComputeProperties(pComputeProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetModuleProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_module_properties_t *pKernelProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getKernelProperties(pKernelProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetMemoryProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_memory_properties_t *pMemProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getMemoryProperties(pCount, pMemProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetMemoryAccessProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_memory_access_properties_t *pMemAccessProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getMemoryAccessProperties(pMemAccessProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetCacheProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_cache_properties_t *pCacheProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getCacheProperties(pCount, pCacheProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetImageProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_image_properties_t *pImageProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getDeviceImageProperties(pImageProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetP2PProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_handle_t hPeerDevice,
|
||||||
|
ze_device_p2p_properties_t *pP2PProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getP2PProperties(hPeerDevice, pP2PProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceCanAccessPeer(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_handle_t hPeerDevice,
|
||||||
|
ze_bool_t *value) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->canAccessPeer(hPeerDevice, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetCommandQueueGroupProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_command_queue_group_properties_t *pCommandQueueGroupProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getCommandQueueGroupProperties(pCount, pCommandQueueGroupProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetExternalMemoryProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_external_memory_properties_t *pExternalMemoryProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getExternalMemoryProperties(pExternalMemoryProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetStatus(
|
||||||
|
ze_device_handle_t hDevice) {
|
||||||
|
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceGetGlobalTimestamps(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint64_t *hostTimestamp,
|
||||||
|
uint64_t *deviceTimestamp) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getGlobalTimestamps(hostTimestamp, deviceTimestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceReserveCacheExt(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
size_t cacheLevel,
|
||||||
|
size_t cacheReservationSize) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->reserveCache(cacheLevel, cacheReservationSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceSetCacheAdviceExt(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
void *ptr,
|
||||||
|
size_t regionSize,
|
||||||
|
ze_cache_ext_region_t cacheRegion) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->setCacheAdvice(ptr, regionSize, cacheRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDevicePciGetPropertiesExt(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_pci_ext_properties_t *pPciProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getPciProperties(pPciProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGet(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_handle_t *phDevices) {
|
||||||
|
return L0::zeDeviceGet(
|
||||||
|
hDriver,
|
||||||
|
pCount,
|
||||||
|
phDevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetSubDevices(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_handle_t *phSubdevices) {
|
||||||
|
return L0::zeDeviceGetSubDevices(
|
||||||
|
hDevice,
|
||||||
|
pCount,
|
||||||
|
phSubdevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_properties_t *pDeviceProperties) {
|
||||||
|
return L0::zeDeviceGetProperties(
|
||||||
|
hDevice,
|
||||||
|
pDeviceProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetComputeProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_compute_properties_t *pComputeProperties) {
|
||||||
|
return L0::zeDeviceGetComputeProperties(
|
||||||
|
hDevice,
|
||||||
|
pComputeProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetModuleProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_module_properties_t *pModuleProperties) {
|
||||||
|
return L0::zeDeviceGetModuleProperties(
|
||||||
|
hDevice,
|
||||||
|
pModuleProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetCommandQueueGroupProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_command_queue_group_properties_t *pCommandQueueGroupProperties) {
|
||||||
|
return L0::zeDeviceGetCommandQueueGroupProperties(
|
||||||
|
hDevice,
|
||||||
|
pCount,
|
||||||
|
pCommandQueueGroupProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetMemoryProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_memory_properties_t *pMemProperties) {
|
||||||
|
return L0::zeDeviceGetMemoryProperties(
|
||||||
|
hDevice,
|
||||||
|
pCount,
|
||||||
|
pMemProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetMemoryAccessProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_memory_access_properties_t *pMemAccessProperties) {
|
||||||
|
return L0::zeDeviceGetMemoryAccessProperties(
|
||||||
|
hDevice,
|
||||||
|
pMemAccessProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetCacheProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_device_cache_properties_t *pCacheProperties) {
|
||||||
|
return L0::zeDeviceGetCacheProperties(
|
||||||
|
hDevice,
|
||||||
|
pCount,
|
||||||
|
pCacheProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetImageProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_image_properties_t *pImageProperties) {
|
||||||
|
return L0::zeDeviceGetImageProperties(
|
||||||
|
hDevice,
|
||||||
|
pImageProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetExternalMemoryProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_external_memory_properties_t *pExternalMemoryProperties) {
|
||||||
|
return L0::zeDeviceGetExternalMemoryProperties(
|
||||||
|
hDevice,
|
||||||
|
pExternalMemoryProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetP2PProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_handle_t hPeerDevice,
|
||||||
|
ze_device_p2p_properties_t *pP2PProperties) {
|
||||||
|
return L0::zeDeviceGetP2PProperties(
|
||||||
|
hDevice,
|
||||||
|
hPeerDevice,
|
||||||
|
pP2PProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceCanAccessPeer(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_device_handle_t hPeerDevice,
|
||||||
|
ze_bool_t *value) {
|
||||||
|
return L0::zeDeviceCanAccessPeer(
|
||||||
|
hDevice,
|
||||||
|
hPeerDevice,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetStatus(
|
||||||
|
ze_device_handle_t hDevice) {
|
||||||
|
return L0::zeDeviceGetStatus(
|
||||||
|
hDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDeviceGetGlobalTimestamps(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint64_t *hostTimestamp,
|
||||||
|
uint64_t *deviceTimestamp) {
|
||||||
|
return L0::zeDeviceGetGlobalTimestamps(
|
||||||
|
hDevice,
|
||||||
|
hostTimestamp,
|
||||||
|
deviceTimestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceReserveCacheExt(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
size_t cacheLevel,
|
||||||
|
size_t cacheReservationSize) {
|
||||||
|
return L0::zeDeviceReserveCacheExt(hDevice, cacheLevel, cacheReservationSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDeviceSetCacheAdviceExt(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
void *ptr,
|
||||||
|
size_t regionSize,
|
||||||
|
ze_cache_ext_region_t cacheRegion) {
|
||||||
|
return L0::zeDeviceSetCacheAdviceExt(hDevice, ptr, regionSize, cacheRegion);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDevicePciGetPropertiesExt(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_pci_ext_properties_t *pPciProperties) {
|
||||||
|
return L0::zeDevicePciGetPropertiesExt(hDevice, pPciProperties);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/driver/driver.h"
|
|
||||||
#include "level_zero/core/source/driver/driver_handle.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeInit(
|
|
||||||
ze_init_flags_t flags) {
|
|
||||||
return L0::init(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDriverGet(
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_driver_handle_t *phDrivers) {
|
|
||||||
return L0::driverHandleGet(pCount, phDrivers);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDriverGetProperties(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
ze_driver_properties_t *pProperties) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDriverGetApiVersion(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
ze_api_version_t *version) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getApiVersion(version);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDriverGetIpcProperties(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
ze_driver_ipc_properties_t *pIPCProperties) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getIPCProperties(pIPCProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDriverGetExtensionProperties(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
uint32_t *pCount,
|
|
||||||
ze_driver_extension_properties_t *pExtensionProperties) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getExtensionProperties(pCount, pExtensionProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeDriverGetExtensionFunctionAddress(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
const char *name,
|
|
||||||
void **ppFunctionAddress) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getExtensionFunctionAddress(name, ppFunctionAddress);
|
|
||||||
}
|
|
||||||
117
level_zero/api/core/ze_driver_api_entrypoints.h
Normal file
117
level_zero/api/core/ze_driver_api_entrypoints.h
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/driver/driver.h"
|
||||||
|
#include "level_zero/core/source/driver/driver_handle.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeInit(
|
||||||
|
ze_init_flags_t flags) {
|
||||||
|
return L0::init(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDriverGet(
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_driver_handle_t *phDrivers) {
|
||||||
|
return L0::driverHandleGet(pCount, phDrivers);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDriverGetProperties(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
ze_driver_properties_t *pProperties) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getProperties(pProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDriverGetApiVersion(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
ze_api_version_t *version) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getApiVersion(version);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDriverGetIpcProperties(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
ze_driver_ipc_properties_t *pIPCProperties) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getIPCProperties(pIPCProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDriverGetExtensionProperties(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_driver_extension_properties_t *pExtensionProperties) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getExtensionProperties(pCount, pExtensionProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeDriverGetExtensionFunctionAddress(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
const char *name,
|
||||||
|
void **ppFunctionAddress) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getExtensionFunctionAddress(name, ppFunctionAddress);
|
||||||
|
}
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeInit(
|
||||||
|
ze_init_flags_t flags) {
|
||||||
|
return L0::zeInit(
|
||||||
|
flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGet(
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_driver_handle_t *phDrivers) {
|
||||||
|
return L0::zeDriverGet(
|
||||||
|
pCount,
|
||||||
|
phDrivers);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetApiVersion(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
ze_api_version_t *version) {
|
||||||
|
return L0::zeDriverGetApiVersion(
|
||||||
|
hDriver,
|
||||||
|
version);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetProperties(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
ze_driver_properties_t *pDriverProperties) {
|
||||||
|
return L0::zeDriverGetProperties(
|
||||||
|
hDriver,
|
||||||
|
pDriverProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetIpcProperties(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
ze_driver_ipc_properties_t *pIpcProperties) {
|
||||||
|
return L0::zeDriverGetIpcProperties(
|
||||||
|
hDriver,
|
||||||
|
pIpcProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetExtensionProperties(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_driver_extension_properties_t *pExtensionProperties) {
|
||||||
|
return L0::zeDriverGetExtensionProperties(
|
||||||
|
hDriver,
|
||||||
|
pCount,
|
||||||
|
pExtensionProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeDriverGetExtensionFunctionAddress(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
const char *name,
|
||||||
|
void **ppFunctionAddress) {
|
||||||
|
return L0::zeDriverGetExtensionFunctionAddress(
|
||||||
|
hDriver,
|
||||||
|
name,
|
||||||
|
ppFunctionAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/event/event.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventPoolCreate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const ze_event_pool_desc_t *desc,
|
|
||||||
uint32_t numDevices,
|
|
||||||
ze_device_handle_t *phDevices,
|
|
||||||
ze_event_pool_handle_t *phEventPool) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createEventPool(desc, numDevices, phDevices, phEventPool);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventPoolDestroy(
|
|
||||||
ze_event_pool_handle_t hEventPool) {
|
|
||||||
return L0::EventPool::fromHandle(hEventPool)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventCreate(
|
|
||||||
ze_event_pool_handle_t hEventPool,
|
|
||||||
const ze_event_desc_t *desc,
|
|
||||||
ze_event_handle_t *phEvent) {
|
|
||||||
return L0::EventPool::fromHandle(hEventPool)->createEvent(desc, phEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventDestroy(
|
|
||||||
ze_event_handle_t hEvent) {
|
|
||||||
return L0::Event::fromHandle(hEvent)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventPoolGetIpcHandle(
|
|
||||||
ze_event_pool_handle_t hEventPool,
|
|
||||||
ze_ipc_event_pool_handle_t *phIpc) {
|
|
||||||
return L0::EventPool::fromHandle(hEventPool)->getIpcHandle(phIpc);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventPoolOpenIpcHandle(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_ipc_event_pool_handle_t hIpc,
|
|
||||||
ze_event_pool_handle_t *phEventPool) {
|
|
||||||
return L0::Context::fromHandle(hContext)->openEventPoolIpcHandle(hIpc, phEventPool);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventPoolCloseIpcHandle(
|
|
||||||
ze_event_pool_handle_t hEventPool) {
|
|
||||||
return L0::EventPool::fromHandle(hEventPool)->closeIpcHandle();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendSignalEvent(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_event_handle_t hEvent) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendSignalEvent(hEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendWaitOnEvents(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
uint32_t numEvents,
|
|
||||||
ze_event_handle_t *phEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendWaitOnEvents(numEvents, phEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventHostSignal(
|
|
||||||
ze_event_handle_t hEvent) {
|
|
||||||
return L0::Event::fromHandle(hEvent)->hostSignal();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventHostSynchronize(
|
|
||||||
ze_event_handle_t hEvent,
|
|
||||||
uint64_t timeout) {
|
|
||||||
return L0::Event::fromHandle(hEvent)->hostSynchronize(timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventQueryStatus(
|
|
||||||
ze_event_handle_t hEvent) {
|
|
||||||
return L0::Event::fromHandle(hEvent)->queryStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendEventReset(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_event_handle_t hEvent) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendEventReset(hEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventHostReset(
|
|
||||||
ze_event_handle_t hEvent) {
|
|
||||||
return L0::Event::fromHandle(hEvent)->reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeEventQueryKernelTimestamp(
|
|
||||||
ze_event_handle_t hEvent,
|
|
||||||
ze_kernel_timestamp_result_t *timestampType) {
|
|
||||||
return L0::Event::fromHandle(hEvent)->queryKernelTimestamp(timestampType);
|
|
||||||
}
|
|
||||||
245
level_zero/api/core/ze_event_api_entrypoints.h
Normal file
245
level_zero/api/core/ze_event_api_entrypoints.h
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/event/event.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeEventPoolCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_event_pool_desc_t *desc,
|
||||||
|
uint32_t numDevices,
|
||||||
|
ze_device_handle_t *phDevices,
|
||||||
|
ze_event_pool_handle_t *phEventPool) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createEventPool(desc, numDevices, phDevices, phEventPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventPoolDestroy(
|
||||||
|
ze_event_pool_handle_t hEventPool) {
|
||||||
|
return L0::EventPool::fromHandle(hEventPool)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventCreate(
|
||||||
|
ze_event_pool_handle_t hEventPool,
|
||||||
|
const ze_event_desc_t *desc,
|
||||||
|
ze_event_handle_t *phEvent) {
|
||||||
|
return L0::EventPool::fromHandle(hEventPool)->createEvent(desc, phEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventDestroy(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventPoolGetIpcHandle(
|
||||||
|
ze_event_pool_handle_t hEventPool,
|
||||||
|
ze_ipc_event_pool_handle_t *phIpc) {
|
||||||
|
return L0::EventPool::fromHandle(hEventPool)->getIpcHandle(phIpc);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventPoolOpenIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_ipc_event_pool_handle_t hIpc,
|
||||||
|
ze_event_pool_handle_t *phEventPool) {
|
||||||
|
return L0::Context::fromHandle(hContext)->openEventPoolIpcHandle(hIpc, phEventPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventPoolCloseIpcHandle(
|
||||||
|
ze_event_pool_handle_t hEventPool) {
|
||||||
|
return L0::EventPool::fromHandle(hEventPool)->closeIpcHandle();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendSignalEvent(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendSignalEvent(hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendWaitOnEvents(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numEvents,
|
||||||
|
ze_event_handle_t *phEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendWaitOnEvents(numEvents, phEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventHostSignal(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->hostSignal();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventHostSynchronize(
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
uint64_t timeout) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->hostSynchronize(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventQueryStatus(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->queryStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendEventReset(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendEventReset(hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventHostReset(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventQueryKernelTimestamp(
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
ze_kernel_timestamp_result_t *timestampType) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->queryKernelTimestamp(timestampType);
|
||||||
|
}
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_event_pool_desc_t *desc,
|
||||||
|
uint32_t numDevices,
|
||||||
|
ze_device_handle_t *phDevices,
|
||||||
|
ze_event_pool_handle_t *phEventPool) {
|
||||||
|
return L0::zeEventPoolCreate(
|
||||||
|
hContext,
|
||||||
|
desc,
|
||||||
|
numDevices,
|
||||||
|
phDevices,
|
||||||
|
phEventPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolDestroy(
|
||||||
|
ze_event_pool_handle_t hEventPool) {
|
||||||
|
return L0::zeEventPoolDestroy(
|
||||||
|
hEventPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventCreate(
|
||||||
|
ze_event_pool_handle_t hEventPool,
|
||||||
|
const ze_event_desc_t *desc,
|
||||||
|
ze_event_handle_t *phEvent) {
|
||||||
|
return L0::zeEventCreate(
|
||||||
|
hEventPool,
|
||||||
|
desc,
|
||||||
|
phEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventDestroy(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::zeEventDestroy(
|
||||||
|
hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolGetIpcHandle(
|
||||||
|
ze_event_pool_handle_t hEventPool,
|
||||||
|
ze_ipc_event_pool_handle_t *phIpc) {
|
||||||
|
return L0::zeEventPoolGetIpcHandle(
|
||||||
|
hEventPool,
|
||||||
|
phIpc);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolOpenIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_ipc_event_pool_handle_t hIpc,
|
||||||
|
ze_event_pool_handle_t *phEventPool) {
|
||||||
|
return L0::zeEventPoolOpenIpcHandle(
|
||||||
|
hContext,
|
||||||
|
hIpc,
|
||||||
|
phEventPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventPoolCloseIpcHandle(
|
||||||
|
ze_event_pool_handle_t hEventPool) {
|
||||||
|
return L0::zeEventPoolCloseIpcHandle(
|
||||||
|
hEventPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendSignalEvent(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::zeCommandListAppendSignalEvent(
|
||||||
|
hCommandList,
|
||||||
|
hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendWaitOnEvents(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numEvents,
|
||||||
|
ze_event_handle_t *phEvents) {
|
||||||
|
return L0::zeCommandListAppendWaitOnEvents(
|
||||||
|
hCommandList,
|
||||||
|
numEvents,
|
||||||
|
phEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventHostSignal(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::zeEventHostSignal(
|
||||||
|
hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventHostSynchronize(
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
uint64_t timeout) {
|
||||||
|
return L0::zeEventHostSynchronize(
|
||||||
|
hEvent,
|
||||||
|
timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventQueryStatus(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::zeEventQueryStatus(
|
||||||
|
hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendEventReset(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::zeCommandListAppendEventReset(
|
||||||
|
hCommandList,
|
||||||
|
hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventHostReset(
|
||||||
|
ze_event_handle_t hEvent) {
|
||||||
|
return L0::zeEventHostReset(
|
||||||
|
hEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeEventQueryKernelTimestamp(
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
ze_kernel_timestamp_result_t *dstptr) {
|
||||||
|
return L0::zeEventQueryKernelTimestamp(
|
||||||
|
hEvent,
|
||||||
|
dstptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendQueryKernelTimestamps(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numEvents,
|
||||||
|
ze_event_handle_t *phEvents,
|
||||||
|
void *dstptr,
|
||||||
|
const size_t *pOffsets,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendQueryKernelTimestamps(
|
||||||
|
hCommandList,
|
||||||
|
numEvents,
|
||||||
|
phEvents,
|
||||||
|
dstptr,
|
||||||
|
pOffsets,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/fence/fence.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeFenceCreate(
|
|
||||||
ze_command_queue_handle_t hCommandQueue,
|
|
||||||
const ze_fence_desc_t *desc,
|
|
||||||
ze_fence_handle_t *phFence) {
|
|
||||||
return L0::CommandQueue::fromHandle(hCommandQueue)->createFence(desc, phFence);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeFenceDestroy(
|
|
||||||
ze_fence_handle_t hFence) {
|
|
||||||
return L0::Fence::fromHandle(hFence)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeFenceHostSynchronize(
|
|
||||||
ze_fence_handle_t hFence,
|
|
||||||
uint64_t timeout) {
|
|
||||||
return L0::Fence::fromHandle(hFence)->hostSynchronize(timeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeFenceQueryStatus(
|
|
||||||
ze_fence_handle_t hFence) {
|
|
||||||
return L0::Fence::fromHandle(hFence)->queryStatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeFenceReset(
|
|
||||||
ze_fence_handle_t hFence) {
|
|
||||||
return L0::Fence::fromHandle(hFence)->reset(false);
|
|
||||||
}
|
|
||||||
80
level_zero/api/core/ze_fence_api_entrypoints.h
Normal file
80
level_zero/api/core/ze_fence_api_entrypoints.h
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/fence/fence.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeFenceCreate(
|
||||||
|
ze_command_queue_handle_t hCommandQueue,
|
||||||
|
const ze_fence_desc_t *desc,
|
||||||
|
ze_fence_handle_t *phFence) {
|
||||||
|
return L0::CommandQueue::fromHandle(hCommandQueue)->createFence(desc, phFence);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeFenceDestroy(
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::Fence::fromHandle(hFence)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeFenceHostSynchronize(
|
||||||
|
ze_fence_handle_t hFence,
|
||||||
|
uint64_t timeout) {
|
||||||
|
return L0::Fence::fromHandle(hFence)->hostSynchronize(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeFenceQueryStatus(
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::Fence::fromHandle(hFence)->queryStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeFenceReset(
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::Fence::fromHandle(hFence)->reset(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceCreate(
|
||||||
|
ze_command_queue_handle_t hCommandQueue,
|
||||||
|
const ze_fence_desc_t *desc,
|
||||||
|
ze_fence_handle_t *phFence) {
|
||||||
|
return L0::zeFenceCreate(
|
||||||
|
hCommandQueue,
|
||||||
|
desc,
|
||||||
|
phFence);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceDestroy(
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::zeFenceDestroy(
|
||||||
|
hFence);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceHostSynchronize(
|
||||||
|
ze_fence_handle_t hFence,
|
||||||
|
uint64_t timeout) {
|
||||||
|
return L0::zeFenceHostSynchronize(
|
||||||
|
hFence,
|
||||||
|
timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceQueryStatus(
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::zeFenceQueryStatus(
|
||||||
|
hFence);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeFenceReset(
|
||||||
|
ze_fence_handle_t hFence) {
|
||||||
|
return L0::zeFenceReset(
|
||||||
|
hFence);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/image/image.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeImageGetProperties(
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_image_desc_t *desc,
|
|
||||||
ze_image_properties_t *pImageProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->imageGetProperties(desc, pImageProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeImageCreate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_image_desc_t *desc,
|
|
||||||
ze_image_handle_t *phImage) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createImage(hDevice, desc, phImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeImageDestroy(
|
|
||||||
ze_image_handle_t hImage) {
|
|
||||||
return L0::Image::fromHandle(hImage)->destroy();
|
|
||||||
}
|
|
||||||
64
level_zero/api/core/ze_image_api_entrypoints.h
Normal file
64
level_zero/api/core/ze_image_api_entrypoints.h
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/image/image.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeImageGetProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_image_desc_t *desc,
|
||||||
|
ze_image_properties_t *pImageProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->imageGetProperties(desc, pImageProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeImageCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_image_desc_t *desc,
|
||||||
|
ze_image_handle_t *phImage) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createImage(hDevice, desc, phImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeImageDestroy(
|
||||||
|
ze_image_handle_t hImage) {
|
||||||
|
return L0::Image::fromHandle(hImage)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeImageGetProperties(
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_image_desc_t *desc,
|
||||||
|
ze_image_properties_t *pImageProperties) {
|
||||||
|
return L0::zeImageGetProperties(
|
||||||
|
hDevice,
|
||||||
|
desc,
|
||||||
|
pImageProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeImageCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_image_desc_t *desc,
|
||||||
|
ze_image_handle_t *phImage) {
|
||||||
|
return L0::zeImageCreate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
desc,
|
||||||
|
phImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeImageDestroy(
|
||||||
|
ze_image_handle_t hImage) {
|
||||||
|
return L0::zeImageDestroy(
|
||||||
|
hImage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/driver/driver_handle.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemAllocShared(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const ze_device_mem_alloc_desc_t *deviceDesc,
|
|
||||||
const ze_host_mem_alloc_desc_t *hostDesc,
|
|
||||||
size_t size,
|
|
||||||
size_t alignment,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
void **pptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->allocSharedMem(hDevice, deviceDesc, hostDesc, size, alignment, pptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemAllocDevice(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const ze_device_mem_alloc_desc_t *deviceDesc,
|
|
||||||
size_t size,
|
|
||||||
size_t alignment,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
void **pptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->allocDeviceMem(hDevice, deviceDesc, size, alignment, pptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemAllocHost(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const ze_host_mem_alloc_desc_t *hostDesc,
|
|
||||||
size_t size,
|
|
||||||
size_t alignment,
|
|
||||||
void **pptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->allocHostMem(hostDesc, size, alignment, pptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemFree(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
void *ptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->freeMem(ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemFreeExt(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const ze_memory_free_ext_desc_t *pMemFreeDesc,
|
|
||||||
void *ptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->freeMemExt(pMemFreeDesc, ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemGetAllocProperties(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const void *ptr,
|
|
||||||
ze_memory_allocation_properties_t *pMemAllocProperties,
|
|
||||||
ze_device_handle_t *phDevice) {
|
|
||||||
return L0::Context::fromHandle(hContext)->getMemAllocProperties(ptr, pMemAllocProperties, phDevice);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemGetAddressRange(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const void *ptr,
|
|
||||||
void **pBase,
|
|
||||||
size_t *pSize) {
|
|
||||||
return L0::Context::fromHandle(hContext)->getMemAddressRange(ptr, pBase, pSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemGetIpcHandle(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const void *ptr,
|
|
||||||
ze_ipc_mem_handle_t *pIpcHandle) {
|
|
||||||
return L0::Context::fromHandle(hContext)->getIpcMemHandle(ptr, pIpcHandle);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemOpenIpcHandle(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
ze_ipc_mem_handle_t handle,
|
|
||||||
ze_ipc_memory_flags_t flags,
|
|
||||||
void **pptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->openIpcMemHandle(hDevice, handle, flags, pptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeMemCloseIpcHandle(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
const void *ptr) {
|
|
||||||
return L0::Context::fromHandle(hContext)->closeIpcMemHandle(ptr);
|
|
||||||
}
|
|
||||||
210
level_zero/api/core/ze_memory_api_entrypoints.h
Normal file
210
level_zero/api/core/ze_memory_api_entrypoints.h
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/driver/driver_handle.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeMemAllocShared(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_device_mem_alloc_desc_t *deviceDesc,
|
||||||
|
const ze_host_mem_alloc_desc_t *hostDesc,
|
||||||
|
size_t size,
|
||||||
|
size_t alignment,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->allocSharedMem(hDevice, deviceDesc, hostDesc, size, alignment, pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemAllocDevice(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_device_mem_alloc_desc_t *deviceDesc,
|
||||||
|
size_t size,
|
||||||
|
size_t alignment,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->allocDeviceMem(hDevice, deviceDesc, size, alignment, pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemAllocHost(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_host_mem_alloc_desc_t *hostDesc,
|
||||||
|
size_t size,
|
||||||
|
size_t alignment,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->allocHostMem(hostDesc, size, alignment, pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemFree(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
void *ptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->freeMem(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemFreeExt(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_memory_free_ext_desc_t *pMemFreeDesc,
|
||||||
|
void *ptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->freeMemExt(pMemFreeDesc, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemGetAllocProperties(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
ze_memory_allocation_properties_t *pMemAllocProperties,
|
||||||
|
ze_device_handle_t *phDevice) {
|
||||||
|
return L0::Context::fromHandle(hContext)->getMemAllocProperties(ptr, pMemAllocProperties, phDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemGetAddressRange(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
void **pBase,
|
||||||
|
size_t *pSize) {
|
||||||
|
return L0::Context::fromHandle(hContext)->getMemAddressRange(ptr, pBase, pSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemGetIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
ze_ipc_mem_handle_t *pIpcHandle) {
|
||||||
|
return L0::Context::fromHandle(hContext)->getIpcMemHandle(ptr, pIpcHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemOpenIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_ipc_mem_handle_t handle,
|
||||||
|
ze_ipc_memory_flags_t flags,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->openIpcMemHandle(hDevice, handle, flags, pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeMemCloseIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->closeIpcMemHandle(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemAllocShared(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_device_mem_alloc_desc_t *deviceDesc,
|
||||||
|
const ze_host_mem_alloc_desc_t *hostDesc,
|
||||||
|
size_t size,
|
||||||
|
size_t alignment,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::zeMemAllocShared(
|
||||||
|
hContext,
|
||||||
|
deviceDesc,
|
||||||
|
hostDesc,
|
||||||
|
size,
|
||||||
|
alignment,
|
||||||
|
hDevice,
|
||||||
|
pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemAllocDevice(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_device_mem_alloc_desc_t *deviceDesc,
|
||||||
|
size_t size,
|
||||||
|
size_t alignment,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::zeMemAllocDevice(
|
||||||
|
hContext,
|
||||||
|
deviceDesc,
|
||||||
|
size,
|
||||||
|
alignment,
|
||||||
|
hDevice,
|
||||||
|
pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemAllocHost(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const ze_host_mem_alloc_desc_t *hostDesc,
|
||||||
|
size_t size,
|
||||||
|
size_t alignment,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::zeMemAllocHost(
|
||||||
|
hContext,
|
||||||
|
hostDesc,
|
||||||
|
size,
|
||||||
|
alignment,
|
||||||
|
pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemFree(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
void *ptr) {
|
||||||
|
return L0::zeMemFree(
|
||||||
|
hContext,
|
||||||
|
ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetAllocProperties(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
ze_memory_allocation_properties_t *pMemAllocProperties,
|
||||||
|
ze_device_handle_t *phDevice) {
|
||||||
|
return L0::zeMemGetAllocProperties(
|
||||||
|
hContext,
|
||||||
|
ptr,
|
||||||
|
pMemAllocProperties,
|
||||||
|
phDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetAddressRange(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
void **pBase,
|
||||||
|
size_t *pSize) {
|
||||||
|
return L0::zeMemGetAddressRange(
|
||||||
|
hContext,
|
||||||
|
ptr,
|
||||||
|
pBase,
|
||||||
|
pSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemGetIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
ze_ipc_mem_handle_t *pIpcHandle) {
|
||||||
|
return L0::zeMemGetIpcHandle(
|
||||||
|
hContext,
|
||||||
|
ptr,
|
||||||
|
pIpcHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemOpenIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
ze_ipc_mem_handle_t handle,
|
||||||
|
ze_ipc_memory_flags_t flags,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::zeMemOpenIpcHandle(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
handle,
|
||||||
|
flags,
|
||||||
|
pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeMemCloseIpcHandle(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr) {
|
||||||
|
return L0::zeMemCloseIpcHandle(
|
||||||
|
hContext,
|
||||||
|
ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,237 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
|
||||||
#include "level_zero/core/source/module/module.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleCreate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_module_desc_t *desc,
|
|
||||||
ze_module_handle_t *phModule,
|
|
||||||
ze_module_build_log_handle_t *phBuildLog) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createModule(hDevice, desc, phModule, phBuildLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleDestroy(
|
|
||||||
ze_module_handle_t hModule) {
|
|
||||||
return L0::Module::fromHandle(hModule)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleBuildLogDestroy(
|
|
||||||
ze_module_build_log_handle_t hModuleBuildLog) {
|
|
||||||
return L0::ModuleBuildLog::fromHandle(hModuleBuildLog)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleBuildLogGetString(
|
|
||||||
ze_module_build_log_handle_t hModuleBuildLog,
|
|
||||||
size_t *pSize,
|
|
||||||
char *pBuildLog) {
|
|
||||||
return L0::ModuleBuildLog::fromHandle(hModuleBuildLog)->getString(pSize, pBuildLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleGetNativeBinary(
|
|
||||||
ze_module_handle_t hModule,
|
|
||||||
size_t *pSize,
|
|
||||||
uint8_t *pModuleNativeBinary) {
|
|
||||||
return L0::Module::fromHandle(hModule)->getNativeBinary(pSize, pModuleNativeBinary);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleGetGlobalPointer(
|
|
||||||
ze_module_handle_t hModule,
|
|
||||||
const char *pGlobalName,
|
|
||||||
size_t *pSize,
|
|
||||||
void **pptr) {
|
|
||||||
return L0::Module::fromHandle(hModule)->getGlobalPointer(pGlobalName, pSize, pptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleGetKernelNames(
|
|
||||||
ze_module_handle_t hModule,
|
|
||||||
uint32_t *pCount,
|
|
||||||
const char **pNames) {
|
|
||||||
return L0::Module::fromHandle(hModule)->getKernelNames(pCount, pNames);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelCreate(
|
|
||||||
ze_module_handle_t hModule,
|
|
||||||
const ze_kernel_desc_t *desc,
|
|
||||||
ze_kernel_handle_t *phFunction) {
|
|
||||||
return L0::Module::fromHandle(hModule)->createKernel(desc, phFunction);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelDestroy(
|
|
||||||
ze_kernel_handle_t hKernel) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleGetFunctionPointer(
|
|
||||||
ze_module_handle_t hModule,
|
|
||||||
const char *pKernelName,
|
|
||||||
void **pfnFunction) {
|
|
||||||
return L0::Module::fromHandle(hModule)->getFunctionPointer(pKernelName, pfnFunction);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSetGroupSize(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
uint32_t groupSizeX,
|
|
||||||
uint32_t groupSizeY,
|
|
||||||
uint32_t groupSizeZ) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->setGroupSize(groupSizeX, groupSizeY, groupSizeZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSuggestGroupSize(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
uint32_t globalSizeX,
|
|
||||||
uint32_t globalSizeY,
|
|
||||||
uint32_t globalSizeZ,
|
|
||||||
uint32_t *groupSizeX,
|
|
||||||
uint32_t *groupSizeY,
|
|
||||||
uint32_t *groupSizeZ) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->suggestGroupSize(globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSuggestMaxCooperativeGroupCount(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
uint32_t *totalGroupCount) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->suggestMaxCooperativeGroupCount(totalGroupCount, NEO::EngineGroupType::Compute, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSetArgumentValue(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
uint32_t argIndex,
|
|
||||||
size_t argSize,
|
|
||||||
const void *pArgValue) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->setArgumentValue(argIndex, argSize, pArgValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSetIndirectAccess(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
ze_kernel_indirect_access_flags_t flags) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->setIndirectAccess(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelGetIndirectAccess(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
ze_kernel_indirect_access_flags_t *pFlags) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->getIndirectAccess(pFlags);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelGetSourceAttributes(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
uint32_t *pSize,
|
|
||||||
char **pString) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->getSourceAttributes(pSize, pString);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelGetProperties(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
ze_kernel_properties_t *pKernelProperties) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->getProperties(pKernelProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendLaunchKernel(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
const ze_group_count_t *pLaunchFuncArgs,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
L0::CmdListKernelLaunchParams launchParams = {};
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendLaunchKernel(hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents, launchParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendLaunchCooperativeKernel(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
const ze_group_count_t *pLaunchFuncArgs,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendLaunchCooperativeKernel(hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendLaunchKernelIndirect(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
const ze_group_count_t *pLaunchArgumentsBuffer,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendLaunchKernelIndirect(hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeCommandListAppendLaunchMultipleKernelsIndirect(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
uint32_t numKernels,
|
|
||||||
ze_kernel_handle_t *phKernels,
|
|
||||||
const uint32_t *pCountBuffer,
|
|
||||||
const ze_group_count_t *pLaunchArgumentsBuffer,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendLaunchMultipleKernelsIndirect(numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelGetName(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
size_t *pSize,
|
|
||||||
char *pName) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->getKernelName(pSize, pName);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleDynamicLink(
|
|
||||||
uint32_t numModules,
|
|
||||||
ze_module_handle_t *phModules,
|
|
||||||
ze_module_build_log_handle_t *phLinkLog) {
|
|
||||||
return L0::Module::fromHandle(phModules[0])->performDynamicLink(numModules, phModules, phLinkLog);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeModuleGetProperties(
|
|
||||||
ze_module_handle_t hModule,
|
|
||||||
ze_module_properties_t *pModuleProperties) {
|
|
||||||
return L0::Module::fromHandle(hModule)->getProperties(pModuleProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSetCacheConfig(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
ze_cache_config_flags_t flags) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->setCacheConfig(flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSchedulingHintExp(
|
|
||||||
ze_kernel_handle_t hKernel,
|
|
||||||
ze_scheduling_hint_exp_desc_t *pHint) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->setSchedulingHintExp(pHint);
|
|
||||||
}
|
|
||||||
499
level_zero/api/core/ze_module_api_entrypoints.h
Normal file
499
level_zero/api/core/ze_module_api_entrypoints.h
Normal file
@@ -0,0 +1,499 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||||
|
#include "level_zero/core/source/module/module.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeModuleCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_module_desc_t *desc,
|
||||||
|
ze_module_handle_t *phModule,
|
||||||
|
ze_module_build_log_handle_t *phBuildLog) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createModule(hDevice, desc, phModule, phBuildLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleDestroy(
|
||||||
|
ze_module_handle_t hModule) {
|
||||||
|
return L0::Module::fromHandle(hModule)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleBuildLogDestroy(
|
||||||
|
ze_module_build_log_handle_t hModuleBuildLog) {
|
||||||
|
return L0::ModuleBuildLog::fromHandle(hModuleBuildLog)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleBuildLogGetString(
|
||||||
|
ze_module_build_log_handle_t hModuleBuildLog,
|
||||||
|
size_t *pSize,
|
||||||
|
char *pBuildLog) {
|
||||||
|
return L0::ModuleBuildLog::fromHandle(hModuleBuildLog)->getString(pSize, pBuildLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleGetNativeBinary(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
size_t *pSize,
|
||||||
|
uint8_t *pModuleNativeBinary) {
|
||||||
|
return L0::Module::fromHandle(hModule)->getNativeBinary(pSize, pModuleNativeBinary);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleGetGlobalPointer(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
const char *pGlobalName,
|
||||||
|
size_t *pSize,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::Module::fromHandle(hModule)->getGlobalPointer(pGlobalName, pSize, pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleGetKernelNames(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
uint32_t *pCount,
|
||||||
|
const char **pNames) {
|
||||||
|
return L0::Module::fromHandle(hModule)->getKernelNames(pCount, pNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelCreate(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
const ze_kernel_desc_t *desc,
|
||||||
|
ze_kernel_handle_t *phFunction) {
|
||||||
|
return L0::Module::fromHandle(hModule)->createKernel(desc, phFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelDestroy(
|
||||||
|
ze_kernel_handle_t hKernel) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleGetFunctionPointer(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
const char *pKernelName,
|
||||||
|
void **pfnFunction) {
|
||||||
|
return L0::Module::fromHandle(hModule)->getFunctionPointer(pKernelName, pfnFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSetGroupSize(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t groupSizeX,
|
||||||
|
uint32_t groupSizeY,
|
||||||
|
uint32_t groupSizeZ) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->setGroupSize(groupSizeX, groupSizeY, groupSizeZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSuggestGroupSize(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t globalSizeX,
|
||||||
|
uint32_t globalSizeY,
|
||||||
|
uint32_t globalSizeZ,
|
||||||
|
uint32_t *groupSizeX,
|
||||||
|
uint32_t *groupSizeY,
|
||||||
|
uint32_t *groupSizeZ) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->suggestGroupSize(globalSizeX, globalSizeY, globalSizeZ, groupSizeX, groupSizeY, groupSizeZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSuggestMaxCooperativeGroupCount(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t *totalGroupCount) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->suggestMaxCooperativeGroupCount(totalGroupCount, NEO::EngineGroupType::Compute, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSetArgumentValue(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t argIndex,
|
||||||
|
size_t argSize,
|
||||||
|
const void *pArgValue) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->setArgumentValue(argIndex, argSize, pArgValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSetIndirectAccess(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_kernel_indirect_access_flags_t flags) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->setIndirectAccess(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelGetIndirectAccess(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_kernel_indirect_access_flags_t *pFlags) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->getIndirectAccess(pFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelGetSourceAttributes(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t *pSize,
|
||||||
|
char **pString) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->getSourceAttributes(pSize, pString);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelGetProperties(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_kernel_properties_t *pKernelProperties) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->getProperties(pKernelProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendLaunchKernel(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
const ze_group_count_t *pLaunchFuncArgs,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
L0::CmdListKernelLaunchParams launchParams = {};
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendLaunchKernel(hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents, launchParams);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendLaunchCooperativeKernel(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
const ze_group_count_t *pLaunchFuncArgs,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendLaunchCooperativeKernel(hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendLaunchKernelIndirect(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
const ze_group_count_t *pLaunchArgumentsBuffer,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendLaunchKernelIndirect(hKernel, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeCommandListAppendLaunchMultipleKernelsIndirect(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numKernels,
|
||||||
|
ze_kernel_handle_t *phKernels,
|
||||||
|
const uint32_t *pCountBuffer,
|
||||||
|
const ze_group_count_t *pLaunchArgumentsBuffer,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendLaunchMultipleKernelsIndirect(numKernels, phKernels, pCountBuffer, pLaunchArgumentsBuffer, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelGetName(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
size_t *pSize,
|
||||||
|
char *pName) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->getKernelName(pSize, pName);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleDynamicLink(
|
||||||
|
uint32_t numModules,
|
||||||
|
ze_module_handle_t *phModules,
|
||||||
|
ze_module_build_log_handle_t *phLinkLog) {
|
||||||
|
return L0::Module::fromHandle(phModules[0])->performDynamicLink(numModules, phModules, phLinkLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeModuleGetProperties(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
ze_module_properties_t *pModuleProperties) {
|
||||||
|
return L0::Module::fromHandle(hModule)->getProperties(pModuleProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSetCacheConfig(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_cache_config_flags_t flags) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->setCacheConfig(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeKernelSchedulingHintExp(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_scheduling_hint_exp_desc_t *pHint) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->setSchedulingHintExp(pHint);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_module_desc_t *desc,
|
||||||
|
ze_module_handle_t *phModule,
|
||||||
|
ze_module_build_log_handle_t *phBuildLog) {
|
||||||
|
return L0::zeModuleCreate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
desc,
|
||||||
|
phModule,
|
||||||
|
phBuildLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleDestroy(
|
||||||
|
ze_module_handle_t hModule) {
|
||||||
|
return L0::zeModuleDestroy(
|
||||||
|
hModule);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleDynamicLink(
|
||||||
|
uint32_t numModules,
|
||||||
|
ze_module_handle_t *phModules,
|
||||||
|
ze_module_build_log_handle_t *phLinkLog) {
|
||||||
|
return L0::zeModuleDynamicLink(
|
||||||
|
numModules,
|
||||||
|
phModules,
|
||||||
|
phLinkLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleBuildLogDestroy(
|
||||||
|
ze_module_build_log_handle_t hModuleBuildLog) {
|
||||||
|
return L0::zeModuleBuildLogDestroy(
|
||||||
|
hModuleBuildLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleBuildLogGetString(
|
||||||
|
ze_module_build_log_handle_t hModuleBuildLog,
|
||||||
|
size_t *pSize,
|
||||||
|
char *pBuildLog) {
|
||||||
|
return L0::zeModuleBuildLogGetString(
|
||||||
|
hModuleBuildLog,
|
||||||
|
pSize,
|
||||||
|
pBuildLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetNativeBinary(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
size_t *pSize,
|
||||||
|
uint8_t *pModuleNativeBinary) {
|
||||||
|
return L0::zeModuleGetNativeBinary(
|
||||||
|
hModule,
|
||||||
|
pSize,
|
||||||
|
pModuleNativeBinary);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetGlobalPointer(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
const char *pGlobalName,
|
||||||
|
size_t *pSize,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::zeModuleGetGlobalPointer(
|
||||||
|
hModule,
|
||||||
|
pGlobalName,
|
||||||
|
pSize,
|
||||||
|
pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetKernelNames(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
uint32_t *pCount,
|
||||||
|
const char **pNames) {
|
||||||
|
return L0::zeModuleGetKernelNames(
|
||||||
|
hModule,
|
||||||
|
pCount,
|
||||||
|
pNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetProperties(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
ze_module_properties_t *pModuleProperties) {
|
||||||
|
return L0::zeModuleGetProperties(
|
||||||
|
hModule,
|
||||||
|
pModuleProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelCreate(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
const ze_kernel_desc_t *desc,
|
||||||
|
ze_kernel_handle_t *phKernel) {
|
||||||
|
return L0::zeKernelCreate(
|
||||||
|
hModule,
|
||||||
|
desc,
|
||||||
|
phKernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelDestroy(
|
||||||
|
ze_kernel_handle_t hKernel) {
|
||||||
|
return L0::zeKernelDestroy(
|
||||||
|
hKernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeModuleGetFunctionPointer(
|
||||||
|
ze_module_handle_t hModule,
|
||||||
|
const char *pFunctionName,
|
||||||
|
void **pfnFunction) {
|
||||||
|
return L0::zeModuleGetFunctionPointer(
|
||||||
|
hModule,
|
||||||
|
pFunctionName,
|
||||||
|
pfnFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetGroupSize(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t groupSizeX,
|
||||||
|
uint32_t groupSizeY,
|
||||||
|
uint32_t groupSizeZ) {
|
||||||
|
return L0::zeKernelSetGroupSize(
|
||||||
|
hKernel,
|
||||||
|
groupSizeX,
|
||||||
|
groupSizeY,
|
||||||
|
groupSizeZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSuggestGroupSize(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t globalSizeX,
|
||||||
|
uint32_t globalSizeY,
|
||||||
|
uint32_t globalSizeZ,
|
||||||
|
uint32_t *groupSizeX,
|
||||||
|
uint32_t *groupSizeY,
|
||||||
|
uint32_t *groupSizeZ) {
|
||||||
|
return L0::zeKernelSuggestGroupSize(
|
||||||
|
hKernel,
|
||||||
|
globalSizeX,
|
||||||
|
globalSizeY,
|
||||||
|
globalSizeZ,
|
||||||
|
groupSizeX,
|
||||||
|
groupSizeY,
|
||||||
|
groupSizeZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSuggestMaxCooperativeGroupCount(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t *totalGroupCount) {
|
||||||
|
return L0::zeKernelSuggestMaxCooperativeGroupCount(
|
||||||
|
hKernel,
|
||||||
|
totalGroupCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetArgumentValue(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t argIndex,
|
||||||
|
size_t argSize,
|
||||||
|
const void *pArgValue) {
|
||||||
|
return L0::zeKernelSetArgumentValue(
|
||||||
|
hKernel,
|
||||||
|
argIndex,
|
||||||
|
argSize,
|
||||||
|
pArgValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetIndirectAccess(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_kernel_indirect_access_flags_t flags) {
|
||||||
|
return L0::zeKernelSetIndirectAccess(
|
||||||
|
hKernel,
|
||||||
|
flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelGetIndirectAccess(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_kernel_indirect_access_flags_t *pFlags) {
|
||||||
|
return L0::zeKernelGetIndirectAccess(
|
||||||
|
hKernel,
|
||||||
|
pFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelGetSourceAttributes(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t *pSize,
|
||||||
|
char **pString) {
|
||||||
|
return L0::zeKernelGetSourceAttributes(
|
||||||
|
hKernel,
|
||||||
|
pSize,
|
||||||
|
pString);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelSetCacheConfig(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_cache_config_flags_t flags) {
|
||||||
|
return L0::zeKernelSetCacheConfig(
|
||||||
|
hKernel,
|
||||||
|
flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelGetProperties(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
ze_kernel_properties_t *pKernelProperties) {
|
||||||
|
return L0::zeKernelGetProperties(
|
||||||
|
hKernel,
|
||||||
|
pKernelProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeKernelGetName(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
size_t *pSize,
|
||||||
|
char *pName) {
|
||||||
|
return L0::zeKernelGetName(
|
||||||
|
hKernel,
|
||||||
|
pSize,
|
||||||
|
pName);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendLaunchKernel(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
const ze_group_count_t *pLaunchFuncArgs,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendLaunchKernel(
|
||||||
|
hCommandList,
|
||||||
|
hKernel,
|
||||||
|
pLaunchFuncArgs,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendLaunchCooperativeKernel(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
const ze_group_count_t *pLaunchFuncArgs,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendLaunchCooperativeKernel(
|
||||||
|
hCommandList,
|
||||||
|
hKernel,
|
||||||
|
pLaunchFuncArgs,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendLaunchKernelIndirect(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
const ze_group_count_t *pLaunchArgumentsBuffer,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendLaunchKernelIndirect(
|
||||||
|
hCommandList,
|
||||||
|
hKernel,
|
||||||
|
pLaunchArgumentsBuffer,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeCommandListAppendLaunchMultipleKernelsIndirect(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
uint32_t numKernels,
|
||||||
|
ze_kernel_handle_t *phKernels,
|
||||||
|
const uint32_t *pCountBuffer,
|
||||||
|
const ze_group_count_t *pLaunchArgumentsBuffer,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zeCommandListAppendLaunchMultipleKernelsIndirect(
|
||||||
|
hCommandList,
|
||||||
|
numKernels,
|
||||||
|
phKernels,
|
||||||
|
pCountBuffer,
|
||||||
|
pLaunchArgumentsBuffer,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/context/context.h"
|
|
||||||
#include "level_zero/core/source/sampler/sampler.h"
|
|
||||||
#include <level_zero/ze_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeSamplerCreate(
|
|
||||||
ze_context_handle_t hContext,
|
|
||||||
ze_device_handle_t hDevice,
|
|
||||||
const ze_sampler_desc_t *desc,
|
|
||||||
ze_sampler_handle_t *phSampler) {
|
|
||||||
return L0::Context::fromHandle(hContext)->createSampler(hDevice, desc, phSampler);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeSamplerDestroy(
|
|
||||||
ze_sampler_handle_t hSampler) {
|
|
||||||
return L0::Sampler::fromHandle(hSampler)->destroy();
|
|
||||||
}
|
|
||||||
48
level_zero/api/core/ze_sampler_api_entrypoints.h
Normal file
48
level_zero/api/core/ze_sampler_api_entrypoints.h
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/context/context.h"
|
||||||
|
#include "level_zero/core/source/sampler/sampler.h"
|
||||||
|
#include <level_zero/ze_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zeSamplerCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_sampler_desc_t *desc,
|
||||||
|
ze_sampler_handle_t *phSampler) {
|
||||||
|
return L0::Context::fromHandle(hContext)->createSampler(hDevice, desc, phSampler);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeSamplerDestroy(
|
||||||
|
ze_sampler_handle_t hSampler) {
|
||||||
|
return L0::Sampler::fromHandle(hSampler)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeSamplerCreate(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_sampler_desc_t *desc,
|
||||||
|
ze_sampler_handle_t *phSampler) {
|
||||||
|
return L0::zeSamplerCreate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
desc,
|
||||||
|
phSampler);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zeSamplerDestroy(
|
||||||
|
ze_sampler_handle_t hSampler) {
|
||||||
|
return L0::zeSamplerDestroy(
|
||||||
|
hSampler);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,7 +9,9 @@
|
|||||||
#include "level_zero/core/source/driver/driver.h"
|
#include "level_zero/core/source/driver/driver.h"
|
||||||
#include "level_zero/core/source/driver/driver_handle.h"
|
#include "level_zero/core/source/driver/driver_handle.h"
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
namespace L0 {
|
||||||
|
|
||||||
|
ze_result_t ZE_APICALL
|
||||||
zexDriverImportExternalPointer(
|
zexDriverImportExternalPointer(
|
||||||
ze_driver_handle_t hDriver,
|
ze_driver_handle_t hDriver,
|
||||||
void *ptr,
|
void *ptr,
|
||||||
@@ -17,17 +19,45 @@ zexDriverImportExternalPointer(
|
|||||||
return L0::DriverHandle::fromHandle(hDriver)->importExternalPointer(ptr, size);
|
return L0::DriverHandle::fromHandle(hDriver)->importExternalPointer(ptr, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t ZE_APICALL
|
||||||
zexDriverReleaseImportedPointer(
|
zexDriverReleaseImportedPointer(
|
||||||
ze_driver_handle_t hDriver,
|
ze_driver_handle_t hDriver,
|
||||||
void *ptr) {
|
void *ptr) {
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->releaseImportedPointer(ptr);
|
return L0::DriverHandle::fromHandle(hDriver)->releaseImportedPointer(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ze_result_t ZE_APICALL
|
||||||
|
zexDriverGetHostPointerBaseAddress(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
void *ptr,
|
||||||
|
void **baseAddress) {
|
||||||
|
return L0::DriverHandle::fromHandle(hDriver)->getHostPointerBaseAddress(ptr, baseAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zexDriverImportExternalPointer(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
void *ptr,
|
||||||
|
size_t size) {
|
||||||
|
return L0::zexDriverImportExternalPointer(hDriver, ptr, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zexDriverReleaseImportedPointer(
|
||||||
|
ze_driver_handle_t hDriver,
|
||||||
|
void *ptr) {
|
||||||
|
return L0::zexDriverReleaseImportedPointer(hDriver, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zexDriverGetHostPointerBaseAddress(
|
zexDriverGetHostPointerBaseAddress(
|
||||||
ze_driver_handle_t hDriver,
|
ze_driver_handle_t hDriver,
|
||||||
void *ptr,
|
void *ptr,
|
||||||
void **baseAddress) {
|
void **baseAddress) {
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->getHostPointerBaseAddress(ptr, baseAddress);
|
return L0::zexDriverGetHostPointerBaseAddress(hDriver, ptr, baseAddress);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -11,34 +11,30 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
namespace L0 {
|
||||||
|
|
||||||
|
ze_result_t ZE_APICALL
|
||||||
zexDriverImportExternalPointer(
|
zexDriverImportExternalPointer(
|
||||||
ze_driver_handle_t hDriver, ///< [in] handle of the driver
|
ze_driver_handle_t hDriver, ///< [in] handle of the driver
|
||||||
void *ptr, ///< [in] pointer to be imported to the driver
|
void *ptr, ///< [in] pointer to be imported to the driver
|
||||||
size_t size ///< [in] size to be imported
|
size_t size ///< [in] size to be imported
|
||||||
);
|
);
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t ZE_APICALL
|
||||||
zexDriverReleaseImportedPointer(
|
zexDriverReleaseImportedPointer(
|
||||||
ze_driver_handle_t hDriver, ///< [in] handle of the driver
|
ze_driver_handle_t hDriver, ///< [in] handle of the driver
|
||||||
void *ptr ///< [in] pointer to be released from the driver
|
void *ptr ///< [in] pointer to be released from the driver
|
||||||
);
|
);
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t ZE_APICALL
|
||||||
zexDriverGetHostPointerBaseAddress(
|
zexDriverGetHostPointerBaseAddress(
|
||||||
ze_driver_handle_t hDriver, ///< [in] handle of the driver
|
ze_driver_handle_t hDriver, ///< [in] handle of the driver
|
||||||
void *ptr, ///< [in] pointer to be checked if imported to the driver
|
void *ptr, ///< [in] pointer to be checked if imported to the driver
|
||||||
void **baseAddress ///< [out] if not null, returns address of the base pointer of the imported pointer
|
void **baseAddress ///< [out] if not null, returns address of the base pointer of the imported pointer
|
||||||
);
|
);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
} // namespace L0
|
||||||
} // extern "C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _ZEX_DRIVER_H
|
#endif // _ZEX_DRIVER_H
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||||
#include "level_zero/core/source/context/context.h"
|
#include "level_zero/core/source/context/context.h"
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
namespace L0 {
|
||||||
|
|
||||||
|
ze_result_t ZE_APICALL
|
||||||
zexMemGetIpcHandles(
|
zexMemGetIpcHandles(
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
const void *ptr,
|
const void *ptr,
|
||||||
@@ -17,6 +19,30 @@ zexMemGetIpcHandles(
|
|||||||
return L0::Context::fromHandle(hContext)->getIpcMemHandles(ptr, numIpcHandles, pIpcHandles);
|
return L0::Context::fromHandle(hContext)->getIpcMemHandles(ptr, numIpcHandles, pIpcHandles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ze_result_t ZE_APICALL
|
||||||
|
zexMemOpenIpcHandles(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t numIpcHandles,
|
||||||
|
ze_ipc_mem_handle_t *pIpcHandles,
|
||||||
|
ze_ipc_memory_flags_t flags,
|
||||||
|
void **pptr) {
|
||||||
|
return L0::Context::fromHandle(hContext)->openIpcMemHandles(hDevice, numIpcHandles, pIpcHandles, flags, pptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zexMemGetIpcHandles(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
const void *ptr,
|
||||||
|
uint32_t *numIpcHandles,
|
||||||
|
ze_ipc_mem_handle_t *pIpcHandles) {
|
||||||
|
return L0::zexMemGetIpcHandles(hContext, ptr, numIpcHandles, pIpcHandles);
|
||||||
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zexMemOpenIpcHandles(
|
zexMemOpenIpcHandles(
|
||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
@@ -25,5 +51,6 @@ zexMemOpenIpcHandles(
|
|||||||
ze_ipc_mem_handle_t *pIpcHandles,
|
ze_ipc_mem_handle_t *pIpcHandles,
|
||||||
ze_ipc_memory_flags_t flags,
|
ze_ipc_memory_flags_t flags,
|
||||||
void **pptr) {
|
void **pptr) {
|
||||||
return L0::Context::fromHandle(hContext)->openIpcMemHandles(hDevice, numIpcHandles, pIpcHandles, flags, pptr);
|
return L0::zexMemOpenIpcHandles(hContext, hDevice, numIpcHandles, pIpcHandles, flags, pptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -11,10 +11,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -32,6 +28,7 @@ typedef enum _zex_mem_ipc_handles_version_t {
|
|||||||
|
|
||||||
} zex_mem_ipc_handles_version_t;
|
} zex_mem_ipc_handles_version_t;
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief Returns an array IPC memory handles for the specified allocation
|
/// @brief Returns an array IPC memory handles for the specified allocation
|
||||||
///
|
///
|
||||||
@@ -45,7 +42,7 @@ typedef enum _zex_mem_ipc_handles_version_t {
|
|||||||
/// - ::ZE_RESULT_SUCCESS
|
/// - ::ZE_RESULT_SUCCESS
|
||||||
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
||||||
/// + `ptr` not known
|
/// + `ptr` not known
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t ZE_APICALL
|
||||||
zexMemGetIpcHandles(
|
zexMemGetIpcHandles(
|
||||||
ze_context_handle_t hContext, ///< [in] handle of the context object
|
ze_context_handle_t hContext, ///< [in] handle of the context object
|
||||||
const void *ptr, ///< [in] pointer to the device memory allocation
|
const void *ptr, ///< [in] pointer to the device memory allocation
|
||||||
@@ -71,7 +68,7 @@ zexMemGetIpcHandles(
|
|||||||
/// - ::ZE_RESULT_SUCCESS
|
/// - ::ZE_RESULT_SUCCESS
|
||||||
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
|
||||||
/// + handles not known
|
/// + handles not known
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t ZE_APICALL
|
||||||
zexMemOpenIpcHandles(
|
zexMemOpenIpcHandles(
|
||||||
ze_context_handle_t hContext, ///< [in] handle of the context object
|
ze_context_handle_t hContext, ///< [in] handle of the context object
|
||||||
ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle
|
ze_device_handle_t hDevice, ///< [in] handle of the device to associate with the IPC memory handle
|
||||||
@@ -82,8 +79,6 @@ zexMemOpenIpcHandles(
|
|||||||
void **pptr ///< [out] pointer to device allocation in this process
|
void **pptr ///< [out] pointer to device allocation in this process
|
||||||
);
|
);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
} // namespace L0
|
||||||
} // extern "C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _ZEX_MEMORY_H
|
#endif // _ZEX_MEMORY_H
|
||||||
|
|||||||
@@ -9,9 +9,23 @@
|
|||||||
#include "level_zero/core/source/kernel/kernel.h"
|
#include "level_zero/core/source/kernel/kernel.h"
|
||||||
#include "level_zero/core/source/module/module.h"
|
#include "level_zero/core/source/module/module.h"
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
namespace L0 {
|
||||||
|
|
||||||
|
ze_result_t ZE_APICALL
|
||||||
zexKernelGetBaseAddress(
|
zexKernelGetBaseAddress(
|
||||||
ze_kernel_handle_t hKernel,
|
ze_kernel_handle_t hKernel,
|
||||||
uint64_t *baseAddress) {
|
uint64_t *baseAddress) {
|
||||||
return L0::Kernel::fromHandle(hKernel)->getBaseAddress(baseAddress);
|
return L0::Kernel::fromHandle(hKernel)->getBaseAddress(baseAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zexKernelGetBaseAddress(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint64_t *baseAddress) {
|
||||||
|
return L0::zexKernelGetBaseAddress(hKernel, baseAddress);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,19 +11,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||||
|
namespace L0 {
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
ze_result_t ZE_APICALL
|
||||||
zexKernelGetBaseAddress(
|
zexKernelGetBaseAddress(
|
||||||
ze_kernel_handle_t hKernel,
|
ze_kernel_handle_t hKernel,
|
||||||
uint64_t *baseAddress);
|
uint64_t *baseAddress);
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
}
|
||||||
} // extern "C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _ZEX_MODULE_H
|
#endif // _ZEX_MODULE_H
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
set(L0_EXPERIMENTAL_TRACING_API
|
set(L0_EXPERIMENTAL_TRACING_API
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/zet_tracing.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/zet_tracing.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/zet_tracing.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY L0_EXPERIMENTAL_TRACING_API ${L0_EXPERIMENTAL_TRACING_API})
|
set_property(GLOBAL PROPERTY L0_EXPERIMENTAL_TRACING_API ${L0_EXPERIMENTAL_TRACING_API})
|
||||||
|
|||||||
@@ -5,40 +5,76 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "level_zero/experimental/source/tracing/tracing.h"
|
#include "zet_tracing.h"
|
||||||
#include <level_zero/zet_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
#include "level_zero/experimental/source/tracing/tracing.h"
|
||||||
zetTracerExpCreate(
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zetTracerExpCreate(
|
||||||
zet_context_handle_t hContext,
|
zet_context_handle_t hContext,
|
||||||
const zet_tracer_exp_desc_t *desc,
|
const zet_tracer_exp_desc_t *desc,
|
||||||
zet_tracer_exp_handle_t *phTracer) {
|
zet_tracer_exp_handle_t *phTracer) {
|
||||||
return L0::createAPITracer(hContext, desc, phTracer);
|
return L0::createAPITracer(hContext, desc, phTracer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpDestroy(
|
||||||
|
zet_tracer_exp_handle_t hTracer) {
|
||||||
|
return L0::APITracer::fromHandle(hTracer)->destroyTracer(hTracer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpSetPrologues(
|
||||||
|
zet_tracer_exp_handle_t hTracer,
|
||||||
|
zet_core_callbacks_t *pCoreCbs) {
|
||||||
|
return L0::APITracer::fromHandle(hTracer)->setPrologues(pCoreCbs);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpSetEpilogues(
|
||||||
|
zet_tracer_exp_handle_t hTracer,
|
||||||
|
zet_core_callbacks_t *pCoreCbs) {
|
||||||
|
return L0::APITracer::fromHandle(hTracer)->setEpilogues(pCoreCbs);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpSetEnabled(
|
||||||
|
zet_tracer_exp_handle_t hTracer,
|
||||||
|
ze_bool_t enable) {
|
||||||
|
return L0::APITracer::fromHandle(hTracer)->enableTracer(enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zetTracerExpCreate(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
const zet_tracer_exp_desc_t *desc,
|
||||||
|
zet_tracer_exp_handle_t *phTracer) {
|
||||||
|
return L0::zetTracerExpCreate(hContext, desc, phTracer);
|
||||||
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zetTracerExpDestroy(
|
zetTracerExpDestroy(
|
||||||
zet_tracer_exp_handle_t hTracer) {
|
zet_tracer_exp_handle_t hTracer) {
|
||||||
return L0::APITracer::fromHandle(hTracer)->destroyTracer(hTracer);
|
return L0::zetTracerExpDestroy(hTracer);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zetTracerExpSetPrologues(
|
zetTracerExpSetPrologues(
|
||||||
zet_tracer_exp_handle_t hTracer,
|
zet_tracer_exp_handle_t hTracer,
|
||||||
zet_core_callbacks_t *pCoreCbs) {
|
zet_core_callbacks_t *pCoreCbs) {
|
||||||
return L0::APITracer::fromHandle(hTracer)->setPrologues(pCoreCbs);
|
return L0::zetTracerExpSetPrologues(hTracer, pCoreCbs);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zetTracerExpSetEpilogues(
|
zetTracerExpSetEpilogues(
|
||||||
zet_tracer_exp_handle_t hTracer,
|
zet_tracer_exp_handle_t hTracer,
|
||||||
zet_core_callbacks_t *pCoreCbs) {
|
zet_core_callbacks_t *pCoreCbs) {
|
||||||
return L0::APITracer::fromHandle(hTracer)->setEpilogues(pCoreCbs);
|
return L0::zetTracerExpSetEpilogues(hTracer, pCoreCbs);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zetTracerExpSetEnabled(
|
zetTracerExpSetEnabled(
|
||||||
zet_tracer_exp_handle_t hTracer,
|
zet_tracer_exp_handle_t hTracer,
|
||||||
ze_bool_t enable) {
|
ze_bool_t enable) {
|
||||||
return L0::APITracer::fromHandle(hTracer)->enableTracer(enable);
|
return L0::zetTracerExpSetEnabled(hTracer, enable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
33
level_zero/api/driver_experimental/tracing/zet_tracing.h
Normal file
33
level_zero/api/driver_experimental/tracing/zet_tracing.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <level_zero/zet_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zetTracerExpCreate(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
const zet_tracer_exp_desc_t *desc,
|
||||||
|
zet_tracer_exp_handle_t *phTracer);
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpDestroy(
|
||||||
|
zet_tracer_exp_handle_t hTracer);
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpSetPrologues(
|
||||||
|
zet_tracer_exp_handle_t hTracer,
|
||||||
|
zet_core_callbacks_t *pCoreCbs);
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpSetEpilogues(
|
||||||
|
zet_tracer_exp_handle_t hTracer,
|
||||||
|
zet_core_callbacks_t *pCoreCbs);
|
||||||
|
|
||||||
|
ze_result_t zetTracerExpSetEnabled(
|
||||||
|
zet_tracer_exp_handle_t hTracer,
|
||||||
|
ze_bool_t enable);
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
@@ -11,12 +11,8 @@
|
|||||||
#include "level_zero/core/source/image/image.h"
|
#include "level_zero/core/source/image/image.h"
|
||||||
#include "level_zero/core/source/kernel/kernel.h"
|
#include "level_zero/core/source/kernel/kernel.h"
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
namespace L0 {
|
||||||
extern "C" {
|
ze_result_t zeKernelSetGlobalOffsetExp(
|
||||||
#endif
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zeKernelSetGlobalOffsetExp(
|
|
||||||
ze_kernel_handle_t hKernel,
|
ze_kernel_handle_t hKernel,
|
||||||
uint32_t offsetX,
|
uint32_t offsetX,
|
||||||
uint32_t offsetY,
|
uint32_t offsetY,
|
||||||
@@ -24,11 +20,54 @@ zeKernelSetGlobalOffsetExp(
|
|||||||
return L0::Kernel::fromHandle(hKernel)->setGlobalOffsetExp(offsetX, offsetY, offsetZ);
|
return L0::Kernel::fromHandle(hKernel)->setGlobalOffsetExp(offsetX, offsetY, offsetZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ze_result_t zeImageGetMemoryPropertiesExp(
|
||||||
|
ze_image_handle_t hImage,
|
||||||
|
ze_image_memory_properties_exp_t *pMemoryProperties) {
|
||||||
|
return L0::Image::fromHandle(hImage)->getMemoryProperties(pMemoryProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeImageGetAllocPropertiesExt(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_image_handle_t hImage,
|
||||||
|
ze_image_allocation_ext_properties_t *pAllocProperties) {
|
||||||
|
return L0::Context::fromHandle(hContext)->getImageAllocProperties(L0::Image::fromHandle(hImage), pAllocProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeImageViewCreateExp(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_image_desc_t *desc,
|
||||||
|
ze_image_handle_t hImage,
|
||||||
|
ze_image_handle_t *phImageView) {
|
||||||
|
return L0::Image::fromHandle(hImage)->createView(L0::Device::fromHandle(hDevice), desc, phImageView);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zeEventQueryTimestampsExp(
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_kernel_timestamp_result_t *pTimestamps) {
|
||||||
|
return L0::Event::fromHandle(hEvent)->queryTimestampsExp(L0::Device::fromHandle(hDevice), pCount, pTimestamps);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zeKernelSetGlobalOffsetExp(
|
||||||
|
ze_kernel_handle_t hKernel,
|
||||||
|
uint32_t offsetX,
|
||||||
|
uint32_t offsetY,
|
||||||
|
uint32_t offsetZ) {
|
||||||
|
return L0::zeKernelSetGlobalOffsetExp(hKernel, offsetX, offsetY, offsetZ);
|
||||||
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
zeImageGetMemoryPropertiesExp(
|
zeImageGetMemoryPropertiesExp(
|
||||||
ze_image_handle_t hImage,
|
ze_image_handle_t hImage,
|
||||||
ze_image_memory_properties_exp_t *pMemoryProperties) {
|
ze_image_memory_properties_exp_t *pMemoryProperties) {
|
||||||
return L0::Image::fromHandle(hImage)->getMemoryProperties(pMemoryProperties);
|
return L0::zeImageGetMemoryPropertiesExp(hImage, pMemoryProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
@@ -36,7 +75,7 @@ zeImageGetAllocPropertiesExt(
|
|||||||
ze_context_handle_t hContext,
|
ze_context_handle_t hContext,
|
||||||
ze_image_handle_t hImage,
|
ze_image_handle_t hImage,
|
||||||
ze_image_allocation_ext_properties_t *pAllocProperties) {
|
ze_image_allocation_ext_properties_t *pAllocProperties) {
|
||||||
return L0::Context::fromHandle(hContext)->getImageAllocProperties(L0::Image::fromHandle(hImage), pAllocProperties);
|
return L0::zeImageGetAllocPropertiesExt(hContext, hImage, pAllocProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
@@ -46,7 +85,7 @@ zeImageViewCreateExp(
|
|||||||
const ze_image_desc_t *desc,
|
const ze_image_desc_t *desc,
|
||||||
ze_image_handle_t hImage,
|
ze_image_handle_t hImage,
|
||||||
ze_image_handle_t *phImageView) {
|
ze_image_handle_t *phImageView) {
|
||||||
return L0::Image::fromHandle(hImage)->createView(L0::Device::fromHandle(hDevice), desc, phImageView);
|
return L0::zeImageViewCreateExp(hContext, hDevice, desc, hImage, phImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
@@ -55,9 +94,7 @@ zeEventQueryTimestampsExp(
|
|||||||
ze_device_handle_t hDevice,
|
ze_device_handle_t hDevice,
|
||||||
uint32_t *pCount,
|
uint32_t *pCount,
|
||||||
ze_kernel_timestamp_result_t *pTimestamps) {
|
ze_kernel_timestamp_result_t *pTimestamps) {
|
||||||
return L0::Event::fromHandle(hEvent)->queryTimestampsExp(L0::Device::fromHandle(hDevice), pCount, pTimestamps);
|
return L0::zeEventQueryTimestampsExp(hEvent, hDevice, pCount, pTimestamps);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -7,12 +7,46 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <level_zero/ze_api.h>
|
#include <level_zero/zet_api.h>
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
namespace L0 {
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
ze_result_t zeKernelSetGlobalOffsetExp(
|
||||||
} // extern "C"
|
ze_kernel_handle_t hKernel,
|
||||||
#endif
|
uint32_t offsetX,
|
||||||
|
uint32_t offsetY,
|
||||||
|
uint32_t offsetZ);
|
||||||
|
|
||||||
|
ze_result_t zeImageGetMemoryPropertiesExp(
|
||||||
|
ze_image_handle_t hImage,
|
||||||
|
ze_image_memory_properties_exp_t *pMemoryProperties);
|
||||||
|
|
||||||
|
ze_result_t zeImageGetAllocPropertiesExt(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_image_handle_t hImage,
|
||||||
|
ze_image_allocation_ext_properties_t *pAllocProperties);
|
||||||
|
|
||||||
|
ze_result_t zeImageViewCreateExp(
|
||||||
|
ze_context_handle_t hContext,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
const ze_image_desc_t *desc,
|
||||||
|
ze_image_handle_t hImage,
|
||||||
|
ze_image_handle_t *phImageView);
|
||||||
|
|
||||||
|
ze_result_t zeEventQueryTimestampsExp(
|
||||||
|
ze_event_handle_t hEvent,
|
||||||
|
ze_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
ze_kernel_timestamp_result_t *pTimestamps);
|
||||||
|
|
||||||
|
ze_result_t zetMetricGroupCalculateMultipleMetricValuesExp(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_group_calculation_type_t type,
|
||||||
|
size_t rawDataSize,
|
||||||
|
const uint8_t *pRawData,
|
||||||
|
uint32_t *pSetCount,
|
||||||
|
uint32_t *pTotalMetricValueCount,
|
||||||
|
uint32_t *pMetricCounts,
|
||||||
|
zet_typed_value_t *pMetricValues);
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2021 Intel Corporation
|
* Copyright (C) 2021-2022 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
@@ -8,12 +8,9 @@
|
|||||||
#include "level_zero/tools/source/metrics/metric.h"
|
#include "level_zero/tools/source/metrics/metric.h"
|
||||||
#include <level_zero/zet_api.h>
|
#include <level_zero/zet_api.h>
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
namespace L0 {
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
ze_result_t zetMetricGroupCalculateMultipleMetricValuesExp(
|
||||||
zetMetricGroupCalculateMultipleMetricValuesExp(
|
|
||||||
zet_metric_group_handle_t hMetricGroup,
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
zet_metric_group_calculation_type_t type,
|
zet_metric_group_calculation_type_t type,
|
||||||
size_t rawDataSize,
|
size_t rawDataSize,
|
||||||
@@ -25,6 +22,21 @@ zetMetricGroupCalculateMultipleMetricValuesExp(
|
|||||||
return L0::MetricGroup::fromHandle(hMetricGroup)->calculateMetricValuesExp(type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues);
|
return L0::MetricGroup::fromHandle(hMetricGroup)->calculateMetricValuesExp(type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL
|
||||||
|
zetMetricGroupCalculateMultipleMetricValuesExp(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_group_calculation_type_t type,
|
||||||
|
size_t rawDataSize,
|
||||||
|
const uint8_t *pRawData,
|
||||||
|
uint32_t *pSetCount,
|
||||||
|
uint32_t *pTotalMetricValueCount,
|
||||||
|
uint32_t *pMetricCounts,
|
||||||
|
zet_typed_value_t *pMetricValues) {
|
||||||
|
return L0::zetMetricGroupCalculateMultipleMetricValuesExp(hMetricGroup, type, rawDataSize, pRawData, pSetCount, pTotalMetricValueCount, pMetricCounts, pMetricValues);
|
||||||
|
}
|
||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2020 Intel Corporation
|
# Copyright (C) 2020-2022 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
|
|
||||||
set(L0_SYSMAN_API
|
set(L0_SYSMAN_API
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_sysman_loader.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_sysman_loader.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/zes_sysman.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/zes_sysman_api_entrypoints.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/zes_sysman_all_api_entrypoints.h
|
||||||
)
|
)
|
||||||
set_property(GLOBAL PROPERTY L0_SYSMAN_API ${L0_SYSMAN_API})
|
set_property(GLOBAL PROPERTY L0_SYSMAN_API ${L0_SYSMAN_API})
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <level_zero/zet_ddi.h>
|
#include <level_zero/zet_ddi.h>
|
||||||
|
|
||||||
#include "ze_ddi_tables.h"
|
#include "ze_ddi_tables.h"
|
||||||
|
#include "zes_sysman_all_api_entrypoints.h"
|
||||||
|
|
||||||
extern ze_gpu_driver_dditable_t driver_ddiTable;
|
extern ze_gpu_driver_dditable_t driver_ddiTable;
|
||||||
|
|
||||||
@@ -38,35 +39,35 @@ zesGetDeviceProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesDeviceGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesDeviceGetProperties;
|
||||||
pDdiTable->pfnGetState = zesDeviceGetState;
|
pDdiTable->pfnGetState = L0::zesDeviceGetState;
|
||||||
pDdiTable->pfnReset = zesDeviceReset;
|
pDdiTable->pfnReset = L0::zesDeviceReset;
|
||||||
pDdiTable->pfnProcessesGetState = zesDeviceProcessesGetState;
|
pDdiTable->pfnProcessesGetState = L0::zesDeviceProcessesGetState;
|
||||||
pDdiTable->pfnPciGetProperties = zesDevicePciGetProperties;
|
pDdiTable->pfnPciGetProperties = L0::zesDevicePciGetProperties;
|
||||||
pDdiTable->pfnPciGetState = zesDevicePciGetState;
|
pDdiTable->pfnPciGetState = L0::zesDevicePciGetState;
|
||||||
pDdiTable->pfnPciGetBars = zesDevicePciGetBars;
|
pDdiTable->pfnPciGetBars = L0::zesDevicePciGetBars;
|
||||||
pDdiTable->pfnPciGetStats = zesDevicePciGetStats;
|
pDdiTable->pfnPciGetStats = L0::zesDevicePciGetStats;
|
||||||
pDdiTable->pfnEnumDiagnosticTestSuites = zesDeviceEnumDiagnosticTestSuites;
|
pDdiTable->pfnEnumDiagnosticTestSuites = L0::zesDeviceEnumDiagnosticTestSuites;
|
||||||
pDdiTable->pfnEnumEngineGroups = zesDeviceEnumEngineGroups;
|
pDdiTable->pfnEnumEngineGroups = L0::zesDeviceEnumEngineGroups;
|
||||||
pDdiTable->pfnEventRegister = zesDeviceEventRegister;
|
pDdiTable->pfnEventRegister = L0::zesDeviceEventRegister;
|
||||||
pDdiTable->pfnEnumFabricPorts = zesDeviceEnumFabricPorts;
|
pDdiTable->pfnEnumFabricPorts = L0::zesDeviceEnumFabricPorts;
|
||||||
pDdiTable->pfnEnumFans = zesDeviceEnumFans;
|
pDdiTable->pfnEnumFans = L0::zesDeviceEnumFans;
|
||||||
pDdiTable->pfnEnumFirmwares = zesDeviceEnumFirmwares;
|
pDdiTable->pfnEnumFirmwares = L0::zesDeviceEnumFirmwares;
|
||||||
pDdiTable->pfnEnumFrequencyDomains = zesDeviceEnumFrequencyDomains;
|
pDdiTable->pfnEnumFrequencyDomains = L0::zesDeviceEnumFrequencyDomains;
|
||||||
pDdiTable->pfnEnumLeds = zesDeviceEnumLeds;
|
pDdiTable->pfnEnumLeds = L0::zesDeviceEnumLeds;
|
||||||
pDdiTable->pfnEnumMemoryModules = zesDeviceEnumMemoryModules;
|
pDdiTable->pfnEnumMemoryModules = L0::zesDeviceEnumMemoryModules;
|
||||||
pDdiTable->pfnEnumPerformanceFactorDomains = zesDeviceEnumPerformanceFactorDomains;
|
pDdiTable->pfnEnumPerformanceFactorDomains = L0::zesDeviceEnumPerformanceFactorDomains;
|
||||||
pDdiTable->pfnEnumPowerDomains = zesDeviceEnumPowerDomains;
|
pDdiTable->pfnEnumPowerDomains = L0::zesDeviceEnumPowerDomains;
|
||||||
pDdiTable->pfnGetCardPowerDomain = zesDeviceGetCardPowerDomain;
|
pDdiTable->pfnGetCardPowerDomain = L0::zesDeviceGetCardPowerDomain;
|
||||||
pDdiTable->pfnEnumPsus = zesDeviceEnumPsus;
|
pDdiTable->pfnEnumPsus = L0::zesDeviceEnumPsus;
|
||||||
pDdiTable->pfnEnumRasErrorSets = zesDeviceEnumRasErrorSets;
|
pDdiTable->pfnEnumRasErrorSets = L0::zesDeviceEnumRasErrorSets;
|
||||||
pDdiTable->pfnEnumSchedulers = zesDeviceEnumSchedulers;
|
pDdiTable->pfnEnumSchedulers = L0::zesDeviceEnumSchedulers;
|
||||||
pDdiTable->pfnEnumStandbyDomains = zesDeviceEnumStandbyDomains;
|
pDdiTable->pfnEnumStandbyDomains = L0::zesDeviceEnumStandbyDomains;
|
||||||
pDdiTable->pfnEnumTemperatureSensors = zesDeviceEnumTemperatureSensors;
|
pDdiTable->pfnEnumTemperatureSensors = L0::zesDeviceEnumTemperatureSensors;
|
||||||
pDdiTable->pfnEccAvailable = zesDeviceEccAvailable;
|
pDdiTable->pfnEccAvailable = L0::zesDeviceEccAvailable;
|
||||||
pDdiTable->pfnEccConfigurable = zesDeviceEccConfigurable;
|
pDdiTable->pfnEccConfigurable = L0::zesDeviceEccConfigurable;
|
||||||
pDdiTable->pfnGetEccState = zesDeviceGetEccState;
|
pDdiTable->pfnGetEccState = L0::zesDeviceGetEccState;
|
||||||
pDdiTable->pfnSetEccState = zesDeviceSetEccState;
|
pDdiTable->pfnSetEccState = L0::zesDeviceSetEccState;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +90,8 @@ zesGetDriverProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnEventListen = zesDriverEventListen;
|
pDdiTable->pfnEventListen = L0::zesDriverEventListen;
|
||||||
pDdiTable->pfnEventListenEx = zesDriverEventListenEx;
|
pDdiTable->pfnEventListenEx = L0::zesDriverEventListenEx;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,9 +114,9 @@ zesGetDiagnosticsProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesDiagnosticsGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesDiagnosticsGetProperties;
|
||||||
pDdiTable->pfnGetTests = zesDiagnosticsGetTests;
|
pDdiTable->pfnGetTests = L0::zesDiagnosticsGetTests;
|
||||||
pDdiTable->pfnRunTests = zesDiagnosticsRunTests;
|
pDdiTable->pfnRunTests = L0::zesDiagnosticsRunTests;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -140,8 +141,8 @@ zesGetEngineProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesEngineGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesEngineGetProperties;
|
||||||
pDdiTable->pfnGetActivity = zesEngineGetActivity;
|
pDdiTable->pfnGetActivity = L0::zesEngineGetActivity;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -165,12 +166,12 @@ zesGetFabricPortProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesFabricPortGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesFabricPortGetProperties;
|
||||||
pDdiTable->pfnGetLinkType = zesFabricPortGetLinkType;
|
pDdiTable->pfnGetLinkType = L0::zesFabricPortGetLinkType;
|
||||||
pDdiTable->pfnGetConfig = zesFabricPortGetConfig;
|
pDdiTable->pfnGetConfig = L0::zesFabricPortGetConfig;
|
||||||
pDdiTable->pfnSetConfig = zesFabricPortSetConfig;
|
pDdiTable->pfnSetConfig = L0::zesFabricPortSetConfig;
|
||||||
pDdiTable->pfnGetState = zesFabricPortGetState;
|
pDdiTable->pfnGetState = L0::zesFabricPortGetState;
|
||||||
pDdiTable->pfnGetThroughput = zesFabricPortGetThroughput;
|
pDdiTable->pfnGetThroughput = L0::zesFabricPortGetThroughput;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -194,12 +195,12 @@ zesGetFanProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesFanGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesFanGetProperties;
|
||||||
pDdiTable->pfnGetConfig = zesFanGetConfig;
|
pDdiTable->pfnGetConfig = L0::zesFanGetConfig;
|
||||||
pDdiTable->pfnSetDefaultMode = zesFanSetDefaultMode;
|
pDdiTable->pfnSetDefaultMode = L0::zesFanSetDefaultMode;
|
||||||
pDdiTable->pfnSetFixedSpeedMode = zesFanSetFixedSpeedMode;
|
pDdiTable->pfnSetFixedSpeedMode = L0::zesFanSetFixedSpeedMode;
|
||||||
pDdiTable->pfnSetSpeedTableMode = zesFanSetSpeedTableMode;
|
pDdiTable->pfnSetSpeedTableMode = L0::zesFanSetSpeedTableMode;
|
||||||
pDdiTable->pfnGetState = zesFanGetState;
|
pDdiTable->pfnGetState = L0::zesFanGetState;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -223,8 +224,8 @@ zesGetFirmwareProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesFirmwareGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesFirmwareGetProperties;
|
||||||
pDdiTable->pfnFlash = zesFirmwareFlash;
|
pDdiTable->pfnFlash = L0::zesFirmwareFlash;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -249,23 +250,23 @@ zesGetFrequencyProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesFrequencyGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesFrequencyGetProperties;
|
||||||
pDdiTable->pfnGetAvailableClocks = zesFrequencyGetAvailableClocks;
|
pDdiTable->pfnGetAvailableClocks = L0::zesFrequencyGetAvailableClocks;
|
||||||
pDdiTable->pfnGetRange = zesFrequencyGetRange;
|
pDdiTable->pfnGetRange = L0::zesFrequencyGetRange;
|
||||||
pDdiTable->pfnSetRange = zesFrequencySetRange;
|
pDdiTable->pfnSetRange = L0::zesFrequencySetRange;
|
||||||
pDdiTable->pfnGetState = zesFrequencyGetState;
|
pDdiTable->pfnGetState = L0::zesFrequencyGetState;
|
||||||
pDdiTable->pfnGetThrottleTime = zesFrequencyGetThrottleTime;
|
pDdiTable->pfnGetThrottleTime = L0::zesFrequencyGetThrottleTime;
|
||||||
pDdiTable->pfnOcGetCapabilities = zesFrequencyOcGetCapabilities;
|
pDdiTable->pfnOcGetCapabilities = L0::zesFrequencyOcGetCapabilities;
|
||||||
pDdiTable->pfnOcGetFrequencyTarget = zesFrequencyOcGetFrequencyTarget;
|
pDdiTable->pfnOcGetFrequencyTarget = L0::zesFrequencyOcGetFrequencyTarget;
|
||||||
pDdiTable->pfnOcSetFrequencyTarget = zesFrequencyOcSetFrequencyTarget;
|
pDdiTable->pfnOcSetFrequencyTarget = L0::zesFrequencyOcSetFrequencyTarget;
|
||||||
pDdiTable->pfnOcGetVoltageTarget = zesFrequencyOcGetVoltageTarget;
|
pDdiTable->pfnOcGetVoltageTarget = L0::zesFrequencyOcGetVoltageTarget;
|
||||||
pDdiTable->pfnOcSetVoltageTarget = zesFrequencyOcSetVoltageTarget;
|
pDdiTable->pfnOcSetVoltageTarget = L0::zesFrequencyOcSetVoltageTarget;
|
||||||
pDdiTable->pfnOcSetMode = zesFrequencyOcSetMode;
|
pDdiTable->pfnOcSetMode = L0::zesFrequencyOcSetMode;
|
||||||
pDdiTable->pfnOcGetMode = zesFrequencyOcGetMode;
|
pDdiTable->pfnOcGetMode = L0::zesFrequencyOcGetMode;
|
||||||
pDdiTable->pfnOcGetIccMax = zesFrequencyOcGetIccMax;
|
pDdiTable->pfnOcGetIccMax = L0::zesFrequencyOcGetIccMax;
|
||||||
pDdiTable->pfnOcSetIccMax = zesFrequencyOcSetIccMax;
|
pDdiTable->pfnOcSetIccMax = L0::zesFrequencyOcSetIccMax;
|
||||||
pDdiTable->pfnOcGetTjMax = zesFrequencyOcGetTjMax;
|
pDdiTable->pfnOcGetTjMax = L0::zesFrequencyOcGetTjMax;
|
||||||
pDdiTable->pfnOcSetTjMax = zesFrequencyOcSetTjMax;
|
pDdiTable->pfnOcSetTjMax = L0::zesFrequencyOcSetTjMax;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -289,10 +290,10 @@ zesGetLedProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesLedGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesLedGetProperties;
|
||||||
pDdiTable->pfnGetState = zesLedGetState;
|
pDdiTable->pfnGetState = L0::zesLedGetState;
|
||||||
pDdiTable->pfnSetState = zesLedSetState;
|
pDdiTable->pfnSetState = L0::zesLedSetState;
|
||||||
pDdiTable->pfnSetColor = zesLedSetColor;
|
pDdiTable->pfnSetColor = L0::zesLedSetColor;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -316,9 +317,9 @@ zesGetMemoryProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesMemoryGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesMemoryGetProperties;
|
||||||
pDdiTable->pfnGetState = zesMemoryGetState;
|
pDdiTable->pfnGetState = L0::zesMemoryGetState;
|
||||||
pDdiTable->pfnGetBandwidth = zesMemoryGetBandwidth;
|
pDdiTable->pfnGetBandwidth = L0::zesMemoryGetBandwidth;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -342,9 +343,9 @@ zesGetPerformanceFactorProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesPerformanceFactorGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesPerformanceFactorGetProperties;
|
||||||
pDdiTable->pfnGetConfig = zesPerformanceFactorGetConfig;
|
pDdiTable->pfnGetConfig = L0::zesPerformanceFactorGetConfig;
|
||||||
pDdiTable->pfnSetConfig = zesPerformanceFactorSetConfig;
|
pDdiTable->pfnSetConfig = L0::zesPerformanceFactorSetConfig;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -368,12 +369,12 @@ zesGetPowerProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesPowerGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesPowerGetProperties;
|
||||||
pDdiTable->pfnGetEnergyCounter = zesPowerGetEnergyCounter;
|
pDdiTable->pfnGetEnergyCounter = L0::zesPowerGetEnergyCounter;
|
||||||
pDdiTable->pfnGetLimits = zesPowerGetLimits;
|
pDdiTable->pfnGetLimits = L0::zesPowerGetLimits;
|
||||||
pDdiTable->pfnSetLimits = zesPowerSetLimits;
|
pDdiTable->pfnSetLimits = L0::zesPowerSetLimits;
|
||||||
pDdiTable->pfnGetEnergyThreshold = zesPowerGetEnergyThreshold;
|
pDdiTable->pfnGetEnergyThreshold = L0::zesPowerGetEnergyThreshold;
|
||||||
pDdiTable->pfnSetEnergyThreshold = zesPowerSetEnergyThreshold;
|
pDdiTable->pfnSetEnergyThreshold = L0::zesPowerSetEnergyThreshold;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -397,8 +398,8 @@ zesGetPsuProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesPsuGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesPsuGetProperties;
|
||||||
pDdiTable->pfnGetState = zesPsuGetState;
|
pDdiTable->pfnGetState = L0::zesPsuGetState;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -422,10 +423,10 @@ zesGetRasProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesRasGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesRasGetProperties;
|
||||||
pDdiTable->pfnGetConfig = zesRasGetConfig;
|
pDdiTable->pfnGetConfig = L0::zesRasGetConfig;
|
||||||
pDdiTable->pfnSetConfig = zesRasSetConfig;
|
pDdiTable->pfnSetConfig = L0::zesRasSetConfig;
|
||||||
pDdiTable->pfnGetState = zesRasGetState;
|
pDdiTable->pfnGetState = L0::zesRasGetState;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -449,14 +450,14 @@ zesGetSchedulerProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesSchedulerGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesSchedulerGetProperties;
|
||||||
pDdiTable->pfnGetCurrentMode = zesSchedulerGetCurrentMode;
|
pDdiTable->pfnGetCurrentMode = L0::zesSchedulerGetCurrentMode;
|
||||||
pDdiTable->pfnGetTimeoutModeProperties = zesSchedulerGetTimeoutModeProperties;
|
pDdiTable->pfnGetTimeoutModeProperties = L0::zesSchedulerGetTimeoutModeProperties;
|
||||||
pDdiTable->pfnGetTimesliceModeProperties = zesSchedulerGetTimesliceModeProperties;
|
pDdiTable->pfnGetTimesliceModeProperties = L0::zesSchedulerGetTimesliceModeProperties;
|
||||||
pDdiTable->pfnSetTimeoutMode = zesSchedulerSetTimeoutMode;
|
pDdiTable->pfnSetTimeoutMode = L0::zesSchedulerSetTimeoutMode;
|
||||||
pDdiTable->pfnSetTimesliceMode = zesSchedulerSetTimesliceMode;
|
pDdiTable->pfnSetTimesliceMode = L0::zesSchedulerSetTimesliceMode;
|
||||||
pDdiTable->pfnSetExclusiveMode = zesSchedulerSetExclusiveMode;
|
pDdiTable->pfnSetExclusiveMode = L0::zesSchedulerSetExclusiveMode;
|
||||||
pDdiTable->pfnSetComputeUnitDebugMode = zesSchedulerSetComputeUnitDebugMode;
|
pDdiTable->pfnSetComputeUnitDebugMode = L0::zesSchedulerSetComputeUnitDebugMode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -480,9 +481,9 @@ zesGetStandbyProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesStandbyGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesStandbyGetProperties;
|
||||||
pDdiTable->pfnGetMode = zesStandbyGetMode;
|
pDdiTable->pfnGetMode = L0::zesStandbyGetMode;
|
||||||
pDdiTable->pfnSetMode = zesStandbySetMode;
|
pDdiTable->pfnSetMode = L0::zesStandbySetMode;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -506,10 +507,10 @@ zesGetTemperatureProcAddrTable(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pDdiTable->pfnGetProperties = zesTemperatureGetProperties;
|
pDdiTable->pfnGetProperties = L0::zesTemperatureGetProperties;
|
||||||
pDdiTable->pfnGetConfig = zesTemperatureGetConfig;
|
pDdiTable->pfnGetConfig = L0::zesTemperatureGetConfig;
|
||||||
pDdiTable->pfnSetConfig = zesTemperatureSetConfig;
|
pDdiTable->pfnSetConfig = L0::zesTemperatureSetConfig;
|
||||||
pDdiTable->pfnGetState = zesTemperatureGetState;
|
pDdiTable->pfnGetState = L0::zesTemperatureGetState;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,778 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "sysman/sysman.h"
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceGetProperties(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_device_properties_t *pProperties) {
|
|
||||||
return L0::SysmanDevice::deviceGetProperties(hDevice, pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceGetState(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_device_state_t *pState) {
|
|
||||||
return L0::SysmanDevice::deviceGetState(hDevice, pState);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumSchedulers(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_sched_handle_t *phScheduler) {
|
|
||||||
return L0::SysmanDevice::schedulerGet(hDevice, pCount, phScheduler);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerGetProperties(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
zes_sched_properties_t *pProperties) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->schedulerGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerGetCurrentMode(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
zes_sched_mode_t *pMode) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->getCurrentMode(pMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerGetTimeoutModeProperties(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
ze_bool_t getDefaults,
|
|
||||||
zes_sched_timeout_properties_t *pConfig) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->getTimeoutModeProperties(getDefaults, pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerGetTimesliceModeProperties(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
ze_bool_t getDefaults,
|
|
||||||
zes_sched_timeslice_properties_t *pConfig) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->getTimesliceModeProperties(getDefaults, pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerSetTimeoutMode(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
zes_sched_timeout_properties_t *pProperties,
|
|
||||||
ze_bool_t *pNeedReload) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->setTimeoutMode(pProperties, pNeedReload);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerSetTimesliceMode(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
zes_sched_timeslice_properties_t *pProperties,
|
|
||||||
ze_bool_t *pNeedReload) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->setTimesliceMode(pProperties, pNeedReload);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerSetExclusiveMode(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
ze_bool_t *pNeedReload) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->setExclusiveMode(pNeedReload);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesSchedulerSetComputeUnitDebugMode(
|
|
||||||
zes_sched_handle_t hScheduler,
|
|
||||||
ze_bool_t *pNeedReload) {
|
|
||||||
return L0::Scheduler::fromHandle(hScheduler)->setComputeUnitDebugMode(pNeedReload);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceProcessesGetState(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_process_state_t *pProcesses) {
|
|
||||||
return L0::SysmanDevice::processesGetState(hDevice, pCount, pProcesses);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceReset(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
ze_bool_t force) {
|
|
||||||
return L0::SysmanDevice::deviceReset(hDevice, force);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDevicePciGetProperties(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_pci_properties_t *pProperties) {
|
|
||||||
return L0::SysmanDevice::pciGetProperties(hDevice, pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDevicePciGetState(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_pci_state_t *pState) {
|
|
||||||
return L0::SysmanDevice::pciGetState(hDevice, pState);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDevicePciGetBars(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_pci_bar_properties_t *pProperties) {
|
|
||||||
return L0::SysmanDevice::pciGetBars(hDevice, pCount, pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDevicePciGetStats(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_pci_stats_t *pStats) {
|
|
||||||
return L0::SysmanDevice::pciGetStats(hDevice, pStats);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumPowerDomains(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_pwr_handle_t *phPower) {
|
|
||||||
return L0::SysmanDevice::powerGet(hDevice, pCount, phPower);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceGetCardPowerDomain(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_pwr_handle_t *phPower) {
|
|
||||||
return L0::SysmanDevice::powerGetCardDomain(hDevice, phPower);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPowerGetProperties(
|
|
||||||
zes_pwr_handle_t hPower,
|
|
||||||
zes_power_properties_t *pProperties) {
|
|
||||||
return L0::Power::fromHandle(hPower)->powerGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPowerGetEnergyCounter(
|
|
||||||
zes_pwr_handle_t hPower,
|
|
||||||
zes_power_energy_counter_t *pEnergy) {
|
|
||||||
return L0::Power::fromHandle(hPower)->powerGetEnergyCounter(pEnergy);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPowerGetLimits(
|
|
||||||
zes_pwr_handle_t hPower,
|
|
||||||
zes_power_sustained_limit_t *pSustained,
|
|
||||||
zes_power_burst_limit_t *pBurst,
|
|
||||||
zes_power_peak_limit_t *pPeak) {
|
|
||||||
return L0::Power::fromHandle(hPower)->powerGetLimits(pSustained, pBurst, pPeak);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPowerSetLimits(
|
|
||||||
zes_pwr_handle_t hPower,
|
|
||||||
const zes_power_sustained_limit_t *pSustained,
|
|
||||||
const zes_power_burst_limit_t *pBurst,
|
|
||||||
const zes_power_peak_limit_t *pPeak) {
|
|
||||||
return L0::Power::fromHandle(hPower)->powerSetLimits(pSustained, pBurst, pPeak);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPowerGetEnergyThreshold(
|
|
||||||
zes_pwr_handle_t hPower,
|
|
||||||
zes_energy_threshold_t *pThreshold) {
|
|
||||||
return L0::Power::fromHandle(hPower)->powerGetEnergyThreshold(pThreshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPowerSetEnergyThreshold(
|
|
||||||
zes_pwr_handle_t hPower,
|
|
||||||
double threshold) {
|
|
||||||
return L0::Power::fromHandle(hPower)->powerSetEnergyThreshold(threshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumFrequencyDomains(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_freq_handle_t *phFrequency) {
|
|
||||||
return L0::SysmanDevice::frequencyGet(hDevice, pCount, phFrequency);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyGetProperties(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_freq_properties_t *pProperties) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyGetAvailableClocks(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
uint32_t *pCount,
|
|
||||||
double *phFrequency) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyGetAvailableClocks(pCount, phFrequency);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyGetRange(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_freq_range_t *pLimits) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyGetRange(pLimits);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencySetRange(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
const zes_freq_range_t *pLimits) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencySetRange(pLimits);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyGetState(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_freq_state_t *pState) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyGetState(pState);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyGetThrottleTime(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_freq_throttle_time_t *pThrottleTime) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyGetThrottleTime(pThrottleTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcGetFrequencyTarget(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double *pCurrentOcFrequency) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcGetFrequencyTarget(pCurrentOcFrequency);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcSetFrequencyTarget(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double currentOcFrequency) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcSetFrequencyTarget(currentOcFrequency);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcGetVoltageTarget(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double *pCurrentVoltageTarget,
|
|
||||||
double *pCurrentVoltageOffset) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcGetVoltageTarget(pCurrentVoltageTarget, pCurrentVoltageOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcSetVoltageTarget(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double currentVoltageTarget,
|
|
||||||
double currentVoltageOffset) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcSetVoltageTarget(currentVoltageTarget, currentVoltageOffset);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcSetMode(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_oc_mode_t currentOcMode) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcSetMode(currentOcMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcGetMode(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_oc_mode_t *pCurrentOcMode) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcGetMode(pCurrentOcMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcGetCapabilities(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
zes_oc_capabilities_t *pOcCapabilities) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcGetCapabilities(pOcCapabilities);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcGetIccMax(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double *pOcIccMax) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcGetIccMax(pOcIccMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcSetIccMax(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double ocIccMax) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcSetIccMax(ocIccMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcGetTjMax(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double *pOcTjMax) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcGeTjMax(pOcTjMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFrequencyOcSetTjMax(
|
|
||||||
zes_freq_handle_t hFrequency,
|
|
||||||
double ocTjMax) {
|
|
||||||
return L0::Frequency::fromHandle(hFrequency)->frequencyOcSetTjMax(ocTjMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumEngineGroups(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_engine_handle_t *phEngine) {
|
|
||||||
return L0::SysmanDevice::engineGet(hDevice, pCount, phEngine);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesEngineGetProperties(
|
|
||||||
zes_engine_handle_t hEngine,
|
|
||||||
zes_engine_properties_t *pProperties) {
|
|
||||||
return L0::Engine::fromHandle(hEngine)->engineGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesEngineGetActivity(
|
|
||||||
zes_engine_handle_t hEngine,
|
|
||||||
zes_engine_stats_t *pStats) {
|
|
||||||
return L0::Engine::fromHandle(hEngine)->engineGetActivity(pStats);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumStandbyDomains(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_standby_handle_t *phStandby) {
|
|
||||||
return L0::SysmanDevice::standbyGet(hDevice, pCount, phStandby);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesStandbyGetProperties(
|
|
||||||
zes_standby_handle_t hStandby,
|
|
||||||
zes_standby_properties_t *pProperties) {
|
|
||||||
return L0::Standby::fromHandle(hStandby)->standbyGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesStandbyGetMode(
|
|
||||||
zes_standby_handle_t hStandby,
|
|
||||||
zes_standby_promo_mode_t *pMode) {
|
|
||||||
return L0::Standby::fromHandle(hStandby)->standbyGetMode(pMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesStandbySetMode(
|
|
||||||
zes_standby_handle_t hStandby,
|
|
||||||
zes_standby_promo_mode_t mode) {
|
|
||||||
return L0::Standby::fromHandle(hStandby)->standbySetMode(mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumFirmwares(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_firmware_handle_t *phFirmware) {
|
|
||||||
return L0::SysmanDevice::firmwareGet(hDevice, pCount, phFirmware);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFirmwareGetProperties(
|
|
||||||
zes_firmware_handle_t hFirmware,
|
|
||||||
zes_firmware_properties_t *pProperties) {
|
|
||||||
return L0::Firmware::fromHandle(hFirmware)->firmwareGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFirmwareFlash(
|
|
||||||
zes_firmware_handle_t hFirmware,
|
|
||||||
void *pImage,
|
|
||||||
uint32_t size) {
|
|
||||||
return L0::Firmware::fromHandle(hFirmware)->firmwareFlash(pImage, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumMemoryModules(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_mem_handle_t *phMemory) {
|
|
||||||
return L0::SysmanDevice::memoryGet(hDevice, pCount, phMemory);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesMemoryGetProperties(
|
|
||||||
zes_mem_handle_t hMemory,
|
|
||||||
zes_mem_properties_t *pProperties) {
|
|
||||||
return L0::Memory::fromHandle(hMemory)->memoryGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesMemoryGetState(
|
|
||||||
zes_mem_handle_t hMemory,
|
|
||||||
zes_mem_state_t *pState) {
|
|
||||||
return L0::Memory::fromHandle(hMemory)->memoryGetState(pState);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesMemoryGetBandwidth(
|
|
||||||
zes_mem_handle_t hMemory,
|
|
||||||
zes_mem_bandwidth_t *pBandwidth) {
|
|
||||||
return L0::Memory::fromHandle(hMemory)->memoryGetBandwidth(pBandwidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumFabricPorts(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_fabric_port_handle_t *phPort) {
|
|
||||||
return L0::SysmanDevice::fabricPortGet(hDevice, pCount, phPort);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFabricPortGetProperties(
|
|
||||||
zes_fabric_port_handle_t hPort,
|
|
||||||
zes_fabric_port_properties_t *pProperties) {
|
|
||||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFabricPortGetLinkType(
|
|
||||||
zes_fabric_port_handle_t hPort,
|
|
||||||
zes_fabric_link_type_t *pLinkType) {
|
|
||||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetLinkType(pLinkType);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFabricPortGetConfig(
|
|
||||||
zes_fabric_port_handle_t hPort,
|
|
||||||
zes_fabric_port_config_t *pConfig) {
|
|
||||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFabricPortSetConfig(
|
|
||||||
zes_fabric_port_handle_t hPort,
|
|
||||||
const zes_fabric_port_config_t *pConfig) {
|
|
||||||
return L0::FabricPort::fromHandle(hPort)->fabricPortSetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFabricPortGetState(
|
|
||||||
zes_fabric_port_handle_t hPort,
|
|
||||||
zes_fabric_port_state_t *pState) {
|
|
||||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetState(pState);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFabricPortGetThroughput(
|
|
||||||
zes_fabric_port_handle_t hPort,
|
|
||||||
zes_fabric_port_throughput_t *pThroughput) {
|
|
||||||
return L0::FabricPort::fromHandle(hPort)->fabricPortGetThroughput(pThroughput);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumTemperatureSensors(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_temp_handle_t *phTemperature) {
|
|
||||||
return L0::SysmanDevice::temperatureGet(hDevice, pCount, phTemperature);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesTemperatureGetProperties(
|
|
||||||
zes_temp_handle_t hTemperature,
|
|
||||||
zes_temp_properties_t *pProperties) {
|
|
||||||
return L0::Temperature::fromHandle(hTemperature)->temperatureGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesTemperatureGetConfig(
|
|
||||||
zes_temp_handle_t hTemperature,
|
|
||||||
zes_temp_config_t *pConfig) {
|
|
||||||
return L0::Temperature::fromHandle(hTemperature)->temperatureGetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesTemperatureSetConfig(
|
|
||||||
zes_temp_handle_t hTemperature,
|
|
||||||
const zes_temp_config_t *pConfig) {
|
|
||||||
return L0::Temperature::fromHandle(hTemperature)->temperatureSetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesTemperatureGetState(
|
|
||||||
zes_temp_handle_t hTemperature,
|
|
||||||
double *pTemperature) {
|
|
||||||
return L0::Temperature::fromHandle(hTemperature)->temperatureGetState(pTemperature);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumPsus(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_psu_handle_t *phPsu) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPsuGetProperties(
|
|
||||||
zes_psu_handle_t hPsu,
|
|
||||||
zes_psu_properties_t *pProperties) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPsuGetState(
|
|
||||||
zes_psu_handle_t hPsu,
|
|
||||||
zes_psu_state_t *pState) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumFans(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_fan_handle_t *phFan) {
|
|
||||||
return L0::SysmanDevice::fanGet(hDevice, pCount, phFan);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFanGetProperties(
|
|
||||||
zes_fan_handle_t hFan,
|
|
||||||
zes_fan_properties_t *pProperties) {
|
|
||||||
return L0::Fan::fromHandle(hFan)->fanGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFanGetConfig(
|
|
||||||
zes_fan_handle_t hFan,
|
|
||||||
zes_fan_config_t *pConfig) {
|
|
||||||
return L0::Fan::fromHandle(hFan)->fanGetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFanSetDefaultMode(
|
|
||||||
zes_fan_handle_t hFan) {
|
|
||||||
return L0::Fan::fromHandle(hFan)->fanSetDefaultMode();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFanSetFixedSpeedMode(
|
|
||||||
zes_fan_handle_t hFan,
|
|
||||||
const zes_fan_speed_t *speed) {
|
|
||||||
return L0::Fan::fromHandle(hFan)->fanSetFixedSpeedMode(speed);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFanSetSpeedTableMode(
|
|
||||||
zes_fan_handle_t hFan,
|
|
||||||
const zes_fan_speed_table_t *speedTable) {
|
|
||||||
return L0::Fan::fromHandle(hFan)->fanSetSpeedTableMode(speedTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesFanGetState(
|
|
||||||
zes_fan_handle_t hFan,
|
|
||||||
zes_fan_speed_units_t units,
|
|
||||||
int32_t *pSpeed) {
|
|
||||||
return L0::Fan::fromHandle(hFan)->fanGetState(units, pSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumLeds(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_led_handle_t *phLed) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesLedGetProperties(
|
|
||||||
zes_led_handle_t hLed,
|
|
||||||
zes_led_properties_t *pProperties) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesLedGetState(
|
|
||||||
zes_led_handle_t hLed,
|
|
||||||
zes_led_state_t *pState) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesLedSetState(
|
|
||||||
zes_led_handle_t hLed,
|
|
||||||
ze_bool_t enable) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesLedSetColor(
|
|
||||||
zes_led_handle_t hLed,
|
|
||||||
const zes_led_color_t *pColor) {
|
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumRasErrorSets(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_ras_handle_t *phRas) {
|
|
||||||
return L0::SysmanDevice::rasGet(hDevice, pCount, phRas);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesRasGetProperties(
|
|
||||||
zes_ras_handle_t hRas,
|
|
||||||
zes_ras_properties_t *pProperties) {
|
|
||||||
return L0::Ras::fromHandle(hRas)->rasGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesRasGetConfig(
|
|
||||||
zes_ras_handle_t hRas,
|
|
||||||
zes_ras_config_t *pConfig) {
|
|
||||||
return L0::Ras::fromHandle(hRas)->rasGetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesRasSetConfig(
|
|
||||||
zes_ras_handle_t hRas,
|
|
||||||
const zes_ras_config_t *pConfig) {
|
|
||||||
return L0::Ras::fromHandle(hRas)->rasSetConfig(pConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesRasGetState(
|
|
||||||
zes_ras_handle_t hRas,
|
|
||||||
ze_bool_t clear,
|
|
||||||
zes_ras_state_t *pState) {
|
|
||||||
return L0::Ras::fromHandle(hRas)->rasGetState(pState, clear);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEventRegister(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_event_type_flags_t events) {
|
|
||||||
return L0::SysmanDevice::deviceEventRegister(hDevice, events);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDriverEventListen(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
uint32_t timeout,
|
|
||||||
uint32_t count,
|
|
||||||
zes_device_handle_t *phDevices,
|
|
||||||
uint32_t *pNumDeviceEvents,
|
|
||||||
zes_event_type_flags_t *pEvents) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->sysmanEventsListen(timeout, count, phDevices, pNumDeviceEvents, pEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDriverEventListenEx(
|
|
||||||
ze_driver_handle_t hDriver,
|
|
||||||
uint64_t timeout,
|
|
||||||
uint32_t count,
|
|
||||||
zes_device_handle_t *phDevices,
|
|
||||||
uint32_t *pNumDeviceEvents,
|
|
||||||
zes_event_type_flags_t *pEvents) {
|
|
||||||
return L0::DriverHandle::fromHandle(hDriver)->sysmanEventsListenEx(timeout, count, phDevices, pNumDeviceEvents, pEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumDiagnosticTestSuites(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_diag_handle_t *phDiagnostics) {
|
|
||||||
return L0::SysmanDevice::diagnosticsGet(hDevice, pCount, phDiagnostics);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDiagnosticsGetProperties(
|
|
||||||
zes_diag_handle_t hDiagnostics,
|
|
||||||
zes_diag_properties_t *pProperties) {
|
|
||||||
return L0::Diagnostics::fromHandle(hDiagnostics)->diagnosticsGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDiagnosticsGetTests(
|
|
||||||
zes_diag_handle_t hDiagnostics,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_diag_test_t *pTests) {
|
|
||||||
return L0::Diagnostics::fromHandle(hDiagnostics)->diagnosticsGetTests(pCount, pTests);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDiagnosticsRunTests(
|
|
||||||
zes_diag_handle_t hDiagnostics,
|
|
||||||
uint32_t startIndex,
|
|
||||||
uint32_t endIndex,
|
|
||||||
zes_diag_result_t *pResult) {
|
|
||||||
return L0::Diagnostics::fromHandle(hDiagnostics)->diagnosticsRunTests(startIndex, endIndex, pResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEnumPerformanceFactorDomains(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zes_perf_handle_t *phPerf) {
|
|
||||||
return L0::SysmanDevice::performanceGet(hDevice, pCount, phPerf);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPerformanceFactorGetProperties(
|
|
||||||
zes_perf_handle_t hPerf,
|
|
||||||
zes_perf_properties_t *pProperties) {
|
|
||||||
return L0::Performance::fromHandle(hPerf)->performanceGetProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPerformanceFactorGetConfig(
|
|
||||||
zes_perf_handle_t hPerf,
|
|
||||||
double *pFactor) {
|
|
||||||
return L0::Performance::fromHandle(hPerf)->performanceGetConfig(pFactor);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesPerformanceFactorSetConfig(
|
|
||||||
zes_perf_handle_t hPerf,
|
|
||||||
double factor) {
|
|
||||||
return L0::Performance::fromHandle(hPerf)->performanceSetConfig(factor);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEccAvailable(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
ze_bool_t *pAvailable) {
|
|
||||||
return L0::SysmanDevice::deviceEccAvailable(hDevice, pAvailable);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceEccConfigurable(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
ze_bool_t *pConfigurable) {
|
|
||||||
return L0::SysmanDevice::deviceEccConfigurable(hDevice, pConfigurable);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceGetEccState(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
zes_device_ecc_properties_t *pState) {
|
|
||||||
return L0::SysmanDevice::deviceGetEccState(hDevice, pState);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zesDeviceSetEccState(
|
|
||||||
zes_device_handle_t hDevice,
|
|
||||||
const zes_device_ecc_desc_t *newState,
|
|
||||||
zes_device_ecc_properties_t *pState) {
|
|
||||||
return L0::SysmanDevice::deviceSetEccState(hDevice, newState, pState);
|
|
||||||
}
|
|
||||||
9
level_zero/api/sysman/zes_sysman_all_api_entrypoints.h
Normal file
9
level_zero/api/sysman/zes_sysman_all_api_entrypoints.h
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "zes_sysman_api_entrypoints.h"
|
||||||
1597
level_zero/api/sysman/zes_sysman_api_entrypoints.h
Normal file
1597
level_zero/api/sysman/zes_sysman_api_entrypoints.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,14 @@
|
|||||||
#
|
#
|
||||||
# Copyright (C) 2020 Intel Corporation
|
# Copyright (C) 2020-2022 Intel Corporation
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
#
|
#
|
||||||
|
|
||||||
set(L0_TOOLS_API
|
set(L0_TOOLS_API
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/ze_tools_loader.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/ze_tools_loader.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/zet_debug.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/zet_debug_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/zet_metric.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/zet_metric_api_entrypoints.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/zet_module.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/zet_module_api_entrypoints.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/zet_tools_all_api_entrypoints.h
|
||||||
)
|
)
|
||||||
set_property(GLOBAL PROPERTY L0_TOOLS_API ${L0_TOOLS_API})
|
set_property(GLOBAL PROPERTY L0_TOOLS_API ${L0_TOOLS_API})
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "level_zero/api/driver_experimental/tracing/zet_tracing.h"
|
||||||
#include "level_zero/source/inc/ze_intel_gpu.h"
|
#include "level_zero/source/inc/ze_intel_gpu.h"
|
||||||
#include <level_zero/ze_api.h>
|
#include <level_zero/ze_api.h>
|
||||||
#include <level_zero/ze_ddi.h>
|
#include <level_zero/ze_ddi.h>
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
#include <level_zero/zet_ddi.h>
|
#include <level_zero/zet_ddi.h>
|
||||||
|
|
||||||
#include "ze_ddi_tables.h"
|
#include "ze_ddi_tables.h"
|
||||||
|
#include "zet_tools_all_api_entrypoints.h"
|
||||||
|
|
||||||
extern ze_gpu_driver_dditable_t driver_ddiTable;
|
extern ze_gpu_driver_dditable_t driver_ddiTable;
|
||||||
|
|
||||||
@@ -27,7 +29,7 @@ zetGetContextProcAddrTable(
|
|||||||
if (ZE_MAJOR_VERSION(driver_ddiTable.version) != ZE_MAJOR_VERSION(version) ||
|
if (ZE_MAJOR_VERSION(driver_ddiTable.version) != ZE_MAJOR_VERSION(version) ||
|
||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
pDdiTable->pfnActivateMetricGroups = zetContextActivateMetricGroups;
|
pDdiTable->pfnActivateMetricGroups = L0::zetContextActivateMetricGroups;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,9 +44,9 @@ zetGetMetricStreamerProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
|
|
||||||
pDdiTable->pfnOpen = zetMetricStreamerOpen;
|
pDdiTable->pfnOpen = L0::zetMetricStreamerOpen;
|
||||||
pDdiTable->pfnClose = zetMetricStreamerClose;
|
pDdiTable->pfnClose = L0::zetMetricStreamerClose;
|
||||||
pDdiTable->pfnReadData = zetMetricStreamerReadData;
|
pDdiTable->pfnReadData = L0::zetMetricStreamerReadData;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -59,11 +61,11 @@ zetGetTracerExpProcAddrTable(
|
|||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zetTracerExpCreate;
|
pDdiTable->pfnCreate = L0::zetTracerExpCreate;
|
||||||
pDdiTable->pfnDestroy = zetTracerExpDestroy;
|
pDdiTable->pfnDestroy = L0::zetTracerExpDestroy;
|
||||||
pDdiTable->pfnSetPrologues = zetTracerExpSetPrologues;
|
pDdiTable->pfnSetPrologues = L0::zetTracerExpSetPrologues;
|
||||||
pDdiTable->pfnSetEpilogues = zetTracerExpSetEpilogues;
|
pDdiTable->pfnSetEpilogues = L0::zetTracerExpSetEpilogues;
|
||||||
pDdiTable->pfnSetEnabled = zetTracerExpSetEnabled;
|
pDdiTable->pfnSetEnabled = L0::zetTracerExpSetEnabled;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,10 +79,10 @@ zetGetCommandListProcAddrTable(
|
|||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnAppendMetricStreamerMarker = zetCommandListAppendMetricStreamerMarker;
|
pDdiTable->pfnAppendMetricStreamerMarker = L0::zetCommandListAppendMetricStreamerMarker;
|
||||||
pDdiTable->pfnAppendMetricQueryBegin = zetCommandListAppendMetricQueryBegin;
|
pDdiTable->pfnAppendMetricQueryBegin = L0::zetCommandListAppendMetricQueryBegin;
|
||||||
pDdiTable->pfnAppendMetricQueryEnd = zetCommandListAppendMetricQueryEnd;
|
pDdiTable->pfnAppendMetricQueryEnd = L0::zetCommandListAppendMetricQueryEnd;
|
||||||
pDdiTable->pfnAppendMetricMemoryBarrier = zetCommandListAppendMetricMemoryBarrier;
|
pDdiTable->pfnAppendMetricMemoryBarrier = L0::zetCommandListAppendMetricMemoryBarrier;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +96,7 @@ zetGetModuleProcAddrTable(
|
|||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGetDebugInfo = zetModuleGetDebugInfo;
|
pDdiTable->pfnGetDebugInfo = L0::zetModuleGetDebugInfo;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +110,7 @@ zetGetKernelProcAddrTable(
|
|||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGetProfileInfo = zetKernelGetProfileInfo;
|
pDdiTable->pfnGetProfileInfo = L0::zetKernelGetProfileInfo;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,9 +124,9 @@ zetGetMetricGroupProcAddrTable(
|
|||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGet = zetMetricGroupGet;
|
pDdiTable->pfnGet = L0::zetMetricGroupGet;
|
||||||
pDdiTable->pfnGetProperties = zetMetricGroupGetProperties;
|
pDdiTable->pfnGetProperties = L0::zetMetricGroupGetProperties;
|
||||||
pDdiTable->pfnCalculateMetricValues = zetMetricGroupCalculateMetricValues;
|
pDdiTable->pfnCalculateMetricValues = L0::zetMetricGroupCalculateMetricValues;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,8 +141,8 @@ zetGetMetricProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGet = zetMetricGet;
|
pDdiTable->pfnGet = L0::zetMetricGet;
|
||||||
pDdiTable->pfnGetProperties = zetMetricGetProperties;
|
pDdiTable->pfnGetProperties = L0::zetMetricGetProperties;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,8 +156,8 @@ zetGetMetricQueryPoolProcAddrTable(
|
|||||||
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
ZE_MINOR_VERSION(driver_ddiTable.version) > ZE_MINOR_VERSION(version))
|
||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zetMetricQueryPoolCreate;
|
pDdiTable->pfnCreate = L0::zetMetricQueryPoolCreate;
|
||||||
pDdiTable->pfnDestroy = zetMetricQueryPoolDestroy;
|
pDdiTable->pfnDestroy = L0::zetMetricQueryPoolDestroy;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,10 +172,10 @@ zetGetMetricQueryProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCreate = zetMetricQueryCreate;
|
pDdiTable->pfnCreate = L0::zetMetricQueryCreate;
|
||||||
pDdiTable->pfnDestroy = zetMetricQueryDestroy;
|
pDdiTable->pfnDestroy = L0::zetMetricQueryDestroy;
|
||||||
pDdiTable->pfnReset = zetMetricQueryReset;
|
pDdiTable->pfnReset = L0::zetMetricQueryReset;
|
||||||
pDdiTable->pfnGetData = zetMetricQueryGetData;
|
pDdiTable->pfnGetData = L0::zetMetricQueryGetData;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +190,7 @@ zetGetDeviceProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnGetDebugProperties = zetDeviceGetDebugProperties;
|
pDdiTable->pfnGetDebugProperties = L0::zetDeviceGetDebugProperties;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,17 +205,17 @@ zetGetDebugProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnAttach = zetDebugAttach;
|
pDdiTable->pfnAttach = L0::zetDebugAttach;
|
||||||
pDdiTable->pfnDetach = zetDebugDetach;
|
pDdiTable->pfnDetach = L0::zetDebugDetach;
|
||||||
pDdiTable->pfnReadEvent = zetDebugReadEvent;
|
pDdiTable->pfnReadEvent = L0::zetDebugReadEvent;
|
||||||
pDdiTable->pfnAcknowledgeEvent = zetDebugAcknowledgeEvent;
|
pDdiTable->pfnAcknowledgeEvent = L0::zetDebugAcknowledgeEvent;
|
||||||
pDdiTable->pfnInterrupt = zetDebugInterrupt;
|
pDdiTable->pfnInterrupt = L0::zetDebugInterrupt;
|
||||||
pDdiTable->pfnResume = zetDebugResume;
|
pDdiTable->pfnResume = L0::zetDebugResume;
|
||||||
pDdiTable->pfnReadMemory = zetDebugReadMemory;
|
pDdiTable->pfnReadMemory = L0::zetDebugReadMemory;
|
||||||
pDdiTable->pfnWriteMemory = zetDebugWriteMemory;
|
pDdiTable->pfnWriteMemory = L0::zetDebugWriteMemory;
|
||||||
pDdiTable->pfnGetRegisterSetProperties = zetDebugGetRegisterSetProperties;
|
pDdiTable->pfnGetRegisterSetProperties = L0::zetDebugGetRegisterSetProperties;
|
||||||
pDdiTable->pfnReadRegisters = zetDebugReadRegisters;
|
pDdiTable->pfnReadRegisters = L0::zetDebugReadRegisters;
|
||||||
pDdiTable->pfnWriteRegisters = zetDebugWriteRegisters;
|
pDdiTable->pfnWriteRegisters = L0::zetDebugWriteRegisters;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -229,7 +231,7 @@ zetGetMetricGroupExpProcAddrTable(
|
|||||||
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
return ZE_RESULT_ERROR_UNSUPPORTED_VERSION;
|
||||||
|
|
||||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||||
pDdiTable->pfnCalculateMultipleMetricValuesExp = zetMetricGroupCalculateMultipleMetricValuesExp;
|
pDdiTable->pfnCalculateMultipleMetricValuesExp = L0::zetMetricGroupCalculateMultipleMetricValuesExp;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,110 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/device/device.h"
|
|
||||||
#include "level_zero/tools/source/debug/debug_handlers.h"
|
|
||||||
#include <level_zero/zet_api.h>
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDeviceGetDebugProperties(
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
zet_device_debug_properties_t *pDebugProperties) {
|
|
||||||
return L0::Device::fromHandle(hDevice)->getDebugProperties(pDebugProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugAttach(
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
const zet_debug_config_t *config,
|
|
||||||
zet_debug_session_handle_t *phDebug) {
|
|
||||||
return L0::DebugApiHandlers::debugAttach(hDevice, config, phDebug);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugDetach(
|
|
||||||
zet_debug_session_handle_t hDebug) {
|
|
||||||
return L0::DebugApiHandlers::debugDetach(hDebug);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugReadEvent(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
uint64_t timeout,
|
|
||||||
zet_debug_event_t *event) {
|
|
||||||
return L0::DebugApiHandlers::debugReadEvent(hDebug, timeout, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugInterrupt(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
ze_device_thread_t thread) {
|
|
||||||
return L0::DebugApiHandlers::debugInterrupt(hDebug, thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugResume(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
ze_device_thread_t thread) {
|
|
||||||
return L0::DebugApiHandlers::debugResume(hDebug, thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugReadMemory(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
ze_device_thread_t thread,
|
|
||||||
const zet_debug_memory_space_desc_t *desc,
|
|
||||||
size_t size,
|
|
||||||
void *buffer) {
|
|
||||||
return L0::DebugApiHandlers::debugReadMemory(hDebug, thread, desc, size, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugWriteMemory(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
ze_device_thread_t thread,
|
|
||||||
const zet_debug_memory_space_desc_t *desc,
|
|
||||||
size_t size,
|
|
||||||
const void *buffer) {
|
|
||||||
return L0::DebugApiHandlers::debugWriteMemory(hDebug, thread, desc, size, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugAcknowledgeEvent(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
const zet_debug_event_t *event) {
|
|
||||||
return L0::DebugApiHandlers::debugAcknowledgeEvent(hDebug, event);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugGetRegisterSetProperties(
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zet_debug_regset_properties_t *pRegisterSetProperties) {
|
|
||||||
return L0::DebugApiHandlers::debugGetRegisterSetProperties(hDevice, pCount, pRegisterSetProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugReadRegisters(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
ze_device_thread_t thread,
|
|
||||||
uint32_t type,
|
|
||||||
uint32_t start,
|
|
||||||
uint32_t count,
|
|
||||||
void *pRegisterValues) {
|
|
||||||
return L0::DebugApiHandlers::debugReadRegisters(hDebug, thread, type, start, count, pRegisterValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetDebugWriteRegisters(
|
|
||||||
zet_debug_session_handle_t hDebug,
|
|
||||||
ze_device_thread_t thread,
|
|
||||||
uint32_t type,
|
|
||||||
uint32_t start,
|
|
||||||
uint32_t count,
|
|
||||||
void *pRegisterValues) {
|
|
||||||
return L0::DebugApiHandlers::debugWriteRegisters(hDebug, thread, type, start, count, pRegisterValues);
|
|
||||||
}
|
|
||||||
232
level_zero/api/tools/zet_debug_api_entrypoints.h
Normal file
232
level_zero/api/tools/zet_debug_api_entrypoints.h
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/device/device.h"
|
||||||
|
#include "level_zero/tools/source/debug/debug_handlers.h"
|
||||||
|
#include <level_zero/zet_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zetDeviceGetDebugProperties(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
zet_device_debug_properties_t *pDebugProperties) {
|
||||||
|
return L0::Device::fromHandle(hDevice)->getDebugProperties(pDebugProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugAttach(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
const zet_debug_config_t *config,
|
||||||
|
zet_debug_session_handle_t *phDebug) {
|
||||||
|
return L0::DebugApiHandlers::debugAttach(hDevice, config, phDebug);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugDetach(
|
||||||
|
zet_debug_session_handle_t hDebug) {
|
||||||
|
return L0::DebugApiHandlers::debugDetach(hDebug);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugReadEvent(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
uint64_t timeout,
|
||||||
|
zet_debug_event_t *event) {
|
||||||
|
return L0::DebugApiHandlers::debugReadEvent(hDebug, timeout, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugInterrupt(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread) {
|
||||||
|
return L0::DebugApiHandlers::debugInterrupt(hDebug, thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugResume(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread) {
|
||||||
|
return L0::DebugApiHandlers::debugResume(hDebug, thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugReadMemory(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
const zet_debug_memory_space_desc_t *desc,
|
||||||
|
size_t size,
|
||||||
|
void *buffer) {
|
||||||
|
return L0::DebugApiHandlers::debugReadMemory(hDebug, thread, desc, size, buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugWriteMemory(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
const zet_debug_memory_space_desc_t *desc,
|
||||||
|
size_t size,
|
||||||
|
const void *buffer) {
|
||||||
|
return L0::DebugApiHandlers::debugWriteMemory(hDebug, thread, desc, size, buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugAcknowledgeEvent(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
const zet_debug_event_t *event) {
|
||||||
|
return L0::DebugApiHandlers::debugAcknowledgeEvent(hDebug, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugGetRegisterSetProperties(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
zet_debug_regset_properties_t *pRegisterSetProperties) {
|
||||||
|
return L0::DebugApiHandlers::debugGetRegisterSetProperties(hDevice, pCount, pRegisterSetProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugReadRegisters(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
uint32_t type,
|
||||||
|
uint32_t start,
|
||||||
|
uint32_t count,
|
||||||
|
void *pRegisterValues) {
|
||||||
|
return L0::DebugApiHandlers::debugReadRegisters(hDebug, thread, type, start, count, pRegisterValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetDebugWriteRegisters(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
uint32_t type,
|
||||||
|
uint32_t start,
|
||||||
|
uint32_t count,
|
||||||
|
void *pRegisterValues) {
|
||||||
|
return L0::DebugApiHandlers::debugWriteRegisters(hDebug, thread, type, start, count, pRegisterValues);
|
||||||
|
}
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDeviceGetDebugProperties(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
zet_device_debug_properties_t *pDebugProperties) {
|
||||||
|
return L0::zetDeviceGetDebugProperties(
|
||||||
|
hDevice,
|
||||||
|
pDebugProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugAttach(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
const zet_debug_config_t *config,
|
||||||
|
zet_debug_session_handle_t *phDebug) {
|
||||||
|
return L0::zetDebugAttach(
|
||||||
|
hDevice,
|
||||||
|
config,
|
||||||
|
phDebug);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugDetach(
|
||||||
|
zet_debug_session_handle_t hDebug) {
|
||||||
|
return L0::zetDebugDetach(
|
||||||
|
hDebug);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugReadEvent(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
uint64_t timeout,
|
||||||
|
zet_debug_event_t *event) {
|
||||||
|
return L0::zetDebugReadEvent(
|
||||||
|
hDebug,
|
||||||
|
timeout,
|
||||||
|
event);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugAcknowledgeEvent(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
const zet_debug_event_t *event) {
|
||||||
|
return L0::zetDebugAcknowledgeEvent(
|
||||||
|
hDebug,
|
||||||
|
event);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugInterrupt(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread) {
|
||||||
|
return L0::zetDebugInterrupt(
|
||||||
|
hDebug,
|
||||||
|
thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugResume(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread) {
|
||||||
|
return L0::zetDebugResume(
|
||||||
|
hDebug,
|
||||||
|
thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugReadMemory(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
const zet_debug_memory_space_desc_t *desc,
|
||||||
|
size_t size,
|
||||||
|
void *buffer) {
|
||||||
|
return L0::zetDebugReadMemory(
|
||||||
|
hDebug,
|
||||||
|
thread,
|
||||||
|
desc,
|
||||||
|
size,
|
||||||
|
buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugWriteMemory(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
const zet_debug_memory_space_desc_t *desc,
|
||||||
|
size_t size,
|
||||||
|
const void *buffer) {
|
||||||
|
return L0::zetDebugWriteMemory(
|
||||||
|
hDebug,
|
||||||
|
thread,
|
||||||
|
desc,
|
||||||
|
size,
|
||||||
|
buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugGetRegisterSetProperties(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
zet_debug_regset_properties_t *pRegisterSetProperties) {
|
||||||
|
return L0::zetDebugGetRegisterSetProperties(
|
||||||
|
hDevice,
|
||||||
|
pCount,
|
||||||
|
pRegisterSetProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugReadRegisters(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
uint32_t type,
|
||||||
|
uint32_t start,
|
||||||
|
uint32_t count,
|
||||||
|
void *pRegisterValues) {
|
||||||
|
return L0::zetDebugReadRegisters(
|
||||||
|
hDebug,
|
||||||
|
thread,
|
||||||
|
type,
|
||||||
|
start,
|
||||||
|
count,
|
||||||
|
pRegisterValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetDebugWriteRegisters(
|
||||||
|
zet_debug_session_handle_t hDebug,
|
||||||
|
ze_device_thread_t thread,
|
||||||
|
uint32_t type,
|
||||||
|
uint32_t start,
|
||||||
|
uint32_t count,
|
||||||
|
void *pRegisterValues) {
|
||||||
|
return L0::zetDebugWriteRegisters(
|
||||||
|
hDebug,
|
||||||
|
thread,
|
||||||
|
type,
|
||||||
|
start,
|
||||||
|
count,
|
||||||
|
pRegisterValues);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2022 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
|
||||||
#include "level_zero/core/source/device/device.h"
|
|
||||||
#include "level_zero/tools/source/metrics/metric.h"
|
|
||||||
#include <level_zero/zet_api.h>
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricGroupGet(
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zet_metric_group_handle_t *phMetricGroups) {
|
|
||||||
return L0::metricGroupGet(hDevice, pCount, phMetricGroups);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricGroupGetProperties(
|
|
||||||
zet_metric_group_handle_t hMetricGroup,
|
|
||||||
zet_metric_group_properties_t *pProperties) {
|
|
||||||
return L0::MetricGroup::fromHandle(hMetricGroup)->getProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricGet(
|
|
||||||
zet_metric_group_handle_t hMetricGroup,
|
|
||||||
uint32_t *pCount,
|
|
||||||
zet_metric_handle_t *phMetrics) {
|
|
||||||
return L0::MetricGroup::fromHandle(hMetricGroup)->metricGet(pCount, phMetrics);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricGetProperties(
|
|
||||||
zet_metric_handle_t hMetric,
|
|
||||||
zet_metric_properties_t *pProperties) {
|
|
||||||
return L0::Metric::fromHandle(hMetric)->getProperties(pProperties);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricGroupCalculateMetricValues(
|
|
||||||
zet_metric_group_handle_t hMetricGroup,
|
|
||||||
zet_metric_group_calculation_type_t type,
|
|
||||||
size_t rawDataSize,
|
|
||||||
const uint8_t *pRawData,
|
|
||||||
uint32_t *pMetricValueCount,
|
|
||||||
zet_typed_value_t *pMetricValues) {
|
|
||||||
return L0::MetricGroup::fromHandle(hMetricGroup)->calculateMetricValues(type, rawDataSize, pRawData, pMetricValueCount, pMetricValues);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetContextActivateMetricGroups(
|
|
||||||
zet_context_handle_t hContext,
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
uint32_t count,
|
|
||||||
zet_metric_group_handle_t *phMetricGroups) {
|
|
||||||
return L0::Context::fromHandle(hContext)->activateMetricGroups(hDevice, count, phMetricGroups);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricStreamerOpen(
|
|
||||||
zet_context_handle_t hContext,
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
zet_metric_group_handle_t hMetricGroup,
|
|
||||||
zet_metric_streamer_desc_t *pDesc,
|
|
||||||
ze_event_handle_t hNotificationEvent,
|
|
||||||
zet_metric_streamer_handle_t *phMetricStreamer) {
|
|
||||||
return L0::metricStreamerOpen(hContext, hDevice, hMetricGroup, pDesc, hNotificationEvent, phMetricStreamer);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetCommandListAppendMetricStreamerMarker(
|
|
||||||
ze_command_list_handle_t hCommandList,
|
|
||||||
zet_metric_streamer_handle_t hMetricStreamer,
|
|
||||||
uint32_t value) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMetricStreamerMarker(hMetricStreamer, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricStreamerClose(
|
|
||||||
zet_metric_streamer_handle_t hMetricStreamer) {
|
|
||||||
return L0::MetricStreamer::fromHandle(hMetricStreamer)->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricStreamerReadData(
|
|
||||||
zet_metric_streamer_handle_t hMetricStreamer,
|
|
||||||
uint32_t maxReportCount,
|
|
||||||
size_t *pRawDataSize,
|
|
||||||
uint8_t *pRawData) {
|
|
||||||
return L0::MetricStreamer::fromHandle(hMetricStreamer)->readData(maxReportCount, pRawDataSize, pRawData);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricQueryPoolCreate(
|
|
||||||
zet_context_handle_t hContext,
|
|
||||||
zet_device_handle_t hDevice,
|
|
||||||
zet_metric_group_handle_t hMetricGroup,
|
|
||||||
const zet_metric_query_pool_desc_t *desc,
|
|
||||||
zet_metric_query_pool_handle_t *phMetricQueryPool) {
|
|
||||||
return L0::metricQueryPoolCreate(hContext, hDevice, hMetricGroup, desc, phMetricQueryPool);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricQueryPoolDestroy(
|
|
||||||
zet_metric_query_pool_handle_t hMetricQueryPool) {
|
|
||||||
return L0::MetricQueryPool::fromHandle(hMetricQueryPool)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricQueryCreate(
|
|
||||||
zet_metric_query_pool_handle_t hMetricQueryPool,
|
|
||||||
uint32_t index,
|
|
||||||
zet_metric_query_handle_t *phMetricQuery) {
|
|
||||||
return L0::MetricQueryPool::fromHandle(hMetricQueryPool)->metricQueryCreate(index, phMetricQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricQueryDestroy(
|
|
||||||
zet_metric_query_handle_t hMetricQuery) {
|
|
||||||
return L0::MetricQuery::fromHandle(hMetricQuery)->destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricQueryReset(
|
|
||||||
zet_metric_query_handle_t hMetricQuery) {
|
|
||||||
return L0::MetricQuery::fromHandle(hMetricQuery)->reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetCommandListAppendMetricQueryBegin(
|
|
||||||
zet_command_list_handle_t hCommandList,
|
|
||||||
zet_metric_query_handle_t hMetricQuery) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMetricQueryBegin(hMetricQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetCommandListAppendMetricQueryEnd(
|
|
||||||
zet_command_list_handle_t hCommandList,
|
|
||||||
zet_metric_query_handle_t hMetricQuery,
|
|
||||||
ze_event_handle_t hSignalEvent,
|
|
||||||
uint32_t numWaitEvents,
|
|
||||||
ze_event_handle_t *phWaitEvents) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMetricQueryEnd(hMetricQuery, hSignalEvent, numWaitEvents, phWaitEvents);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetCommandListAppendMetricMemoryBarrier(
|
|
||||||
zet_command_list_handle_t hCommandList) {
|
|
||||||
return L0::CommandList::fromHandle(hCommandList)->appendMetricMemoryBarrier();
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetMetricQueryGetData(
|
|
||||||
zet_metric_query_handle_t hMetricQuery,
|
|
||||||
size_t *pRawDataSize,
|
|
||||||
uint8_t *pRawData) {
|
|
||||||
return L0::MetricQuery::fromHandle(hMetricQuery)->getData(pRawDataSize, pRawData);
|
|
||||||
}
|
|
||||||
338
level_zero/api/tools/zet_metric_api_entrypoints.h
Normal file
338
level_zero/api/tools/zet_metric_api_entrypoints.h
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/cmdlist/cmdlist.h"
|
||||||
|
#include "level_zero/core/source/device/device.h"
|
||||||
|
#include "level_zero/tools/source/metrics/metric.h"
|
||||||
|
#include <level_zero/zet_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zetMetricGroupGet(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
zet_metric_group_handle_t *phMetricGroups) {
|
||||||
|
return L0::metricGroupGet(hDevice, pCount, phMetricGroups);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricGroupGetProperties(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_group_properties_t *pProperties) {
|
||||||
|
return L0::MetricGroup::fromHandle(hMetricGroup)->getProperties(pProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricGet(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
uint32_t *pCount,
|
||||||
|
zet_metric_handle_t *phMetrics) {
|
||||||
|
return L0::MetricGroup::fromHandle(hMetricGroup)->metricGet(pCount, phMetrics);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricGetProperties(
|
||||||
|
zet_metric_handle_t hMetric,
|
||||||
|
zet_metric_properties_t *pProperties) {
|
||||||
|
return L0::Metric::fromHandle(hMetric)->getProperties(pProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricGroupCalculateMetricValues(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_group_calculation_type_t type,
|
||||||
|
size_t rawDataSize,
|
||||||
|
const uint8_t *pRawData,
|
||||||
|
uint32_t *pMetricValueCount,
|
||||||
|
zet_typed_value_t *pMetricValues) {
|
||||||
|
return L0::MetricGroup::fromHandle(hMetricGroup)->calculateMetricValues(type, rawDataSize, pRawData, pMetricValueCount, pMetricValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetContextActivateMetricGroups(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
uint32_t count,
|
||||||
|
zet_metric_group_handle_t *phMetricGroups) {
|
||||||
|
return L0::Context::fromHandle(hContext)->activateMetricGroups(hDevice, count, phMetricGroups);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricStreamerOpen(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_streamer_desc_t *pDesc,
|
||||||
|
ze_event_handle_t hNotificationEvent,
|
||||||
|
zet_metric_streamer_handle_t *phMetricStreamer) {
|
||||||
|
return L0::metricStreamerOpen(hContext, hDevice, hMetricGroup, pDesc, hNotificationEvent, phMetricStreamer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetCommandListAppendMetricStreamerMarker(
|
||||||
|
ze_command_list_handle_t hCommandList,
|
||||||
|
zet_metric_streamer_handle_t hMetricStreamer,
|
||||||
|
uint32_t value) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMetricStreamerMarker(hMetricStreamer, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricStreamerClose(
|
||||||
|
zet_metric_streamer_handle_t hMetricStreamer) {
|
||||||
|
return L0::MetricStreamer::fromHandle(hMetricStreamer)->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricStreamerReadData(
|
||||||
|
zet_metric_streamer_handle_t hMetricStreamer,
|
||||||
|
uint32_t maxReportCount,
|
||||||
|
size_t *pRawDataSize,
|
||||||
|
uint8_t *pRawData) {
|
||||||
|
return L0::MetricStreamer::fromHandle(hMetricStreamer)->readData(maxReportCount, pRawDataSize, pRawData);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricQueryPoolCreate(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
const zet_metric_query_pool_desc_t *desc,
|
||||||
|
zet_metric_query_pool_handle_t *phMetricQueryPool) {
|
||||||
|
return L0::metricQueryPoolCreate(hContext, hDevice, hMetricGroup, desc, phMetricQueryPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricQueryPoolDestroy(
|
||||||
|
zet_metric_query_pool_handle_t hMetricQueryPool) {
|
||||||
|
return L0::MetricQueryPool::fromHandle(hMetricQueryPool)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricQueryCreate(
|
||||||
|
zet_metric_query_pool_handle_t hMetricQueryPool,
|
||||||
|
uint32_t index,
|
||||||
|
zet_metric_query_handle_t *phMetricQuery) {
|
||||||
|
return L0::MetricQueryPool::fromHandle(hMetricQueryPool)->metricQueryCreate(index, phMetricQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricQueryDestroy(
|
||||||
|
zet_metric_query_handle_t hMetricQuery) {
|
||||||
|
return L0::MetricQuery::fromHandle(hMetricQuery)->destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricQueryReset(
|
||||||
|
zet_metric_query_handle_t hMetricQuery) {
|
||||||
|
return L0::MetricQuery::fromHandle(hMetricQuery)->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetCommandListAppendMetricQueryBegin(
|
||||||
|
zet_command_list_handle_t hCommandList,
|
||||||
|
zet_metric_query_handle_t hMetricQuery) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMetricQueryBegin(hMetricQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetCommandListAppendMetricQueryEnd(
|
||||||
|
zet_command_list_handle_t hCommandList,
|
||||||
|
zet_metric_query_handle_t hMetricQuery,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMetricQueryEnd(hMetricQuery, hSignalEvent, numWaitEvents, phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetCommandListAppendMetricMemoryBarrier(
|
||||||
|
zet_command_list_handle_t hCommandList) {
|
||||||
|
return L0::CommandList::fromHandle(hCommandList)->appendMetricMemoryBarrier();
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetMetricQueryGetData(
|
||||||
|
zet_metric_query_handle_t hMetricQuery,
|
||||||
|
size_t *pRawDataSize,
|
||||||
|
uint8_t *pRawData) {
|
||||||
|
return L0::MetricQuery::fromHandle(hMetricQuery)->getData(pRawDataSize, pRawData);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupGet(
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
uint32_t *pCount,
|
||||||
|
zet_metric_group_handle_t *phMetricGroups) {
|
||||||
|
return L0::zetMetricGroupGet(
|
||||||
|
hDevice,
|
||||||
|
pCount,
|
||||||
|
phMetricGroups);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupGetProperties(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_group_properties_t *pProperties) {
|
||||||
|
return L0::zetMetricGroupGetProperties(
|
||||||
|
hMetricGroup,
|
||||||
|
pProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGroupCalculateMetricValues(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_group_calculation_type_t type,
|
||||||
|
size_t rawDataSize,
|
||||||
|
const uint8_t *pRawData,
|
||||||
|
uint32_t *pMetricValueCount,
|
||||||
|
zet_typed_value_t *pMetricValues) {
|
||||||
|
return L0::zetMetricGroupCalculateMetricValues(
|
||||||
|
hMetricGroup,
|
||||||
|
type,
|
||||||
|
rawDataSize,
|
||||||
|
pRawData,
|
||||||
|
pMetricValueCount,
|
||||||
|
pMetricValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGet(
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
uint32_t *pCount,
|
||||||
|
zet_metric_handle_t *phMetrics) {
|
||||||
|
return L0::zetMetricGet(
|
||||||
|
hMetricGroup,
|
||||||
|
pCount,
|
||||||
|
phMetrics);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGetProperties(
|
||||||
|
zet_metric_handle_t hMetric,
|
||||||
|
zet_metric_properties_t *pProperties) {
|
||||||
|
return L0::zetMetricGetProperties(
|
||||||
|
hMetric,
|
||||||
|
pProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetContextActivateMetricGroups(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
uint32_t count,
|
||||||
|
zet_metric_group_handle_t *phMetricGroups) {
|
||||||
|
return L0::zetContextActivateMetricGroups(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
count,
|
||||||
|
phMetricGroups);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricStreamerOpen(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
zet_metric_streamer_desc_t *desc,
|
||||||
|
ze_event_handle_t hNotificationEvent,
|
||||||
|
zet_metric_streamer_handle_t *phMetricStreamer) {
|
||||||
|
return L0::zetMetricStreamerOpen(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
hMetricGroup,
|
||||||
|
desc,
|
||||||
|
hNotificationEvent,
|
||||||
|
phMetricStreamer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetCommandListAppendMetricStreamerMarker(
|
||||||
|
zet_command_list_handle_t hCommandList,
|
||||||
|
zet_metric_streamer_handle_t hMetricStreamer,
|
||||||
|
uint32_t value) {
|
||||||
|
return L0::zetCommandListAppendMetricStreamerMarker(
|
||||||
|
hCommandList,
|
||||||
|
hMetricStreamer,
|
||||||
|
value);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricStreamerClose(
|
||||||
|
zet_metric_streamer_handle_t hMetricStreamer) {
|
||||||
|
return L0::zetMetricStreamerClose(
|
||||||
|
hMetricStreamer);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricStreamerReadData(
|
||||||
|
zet_metric_streamer_handle_t hMetricStreamer,
|
||||||
|
uint32_t maxReportCount,
|
||||||
|
size_t *pRawDataSize,
|
||||||
|
uint8_t *pRawData) {
|
||||||
|
return L0::zetMetricStreamerReadData(
|
||||||
|
hMetricStreamer,
|
||||||
|
maxReportCount,
|
||||||
|
pRawDataSize,
|
||||||
|
pRawData);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricQueryPoolCreate(
|
||||||
|
zet_context_handle_t hContext,
|
||||||
|
zet_device_handle_t hDevice,
|
||||||
|
zet_metric_group_handle_t hMetricGroup,
|
||||||
|
const zet_metric_query_pool_desc_t *desc,
|
||||||
|
zet_metric_query_pool_handle_t *phMetricQueryPool) {
|
||||||
|
return L0::zetMetricQueryPoolCreate(
|
||||||
|
hContext,
|
||||||
|
hDevice,
|
||||||
|
hMetricGroup,
|
||||||
|
desc,
|
||||||
|
phMetricQueryPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricQueryPoolDestroy(
|
||||||
|
zet_metric_query_pool_handle_t hMetricQueryPool) {
|
||||||
|
return L0::zetMetricQueryPoolDestroy(
|
||||||
|
hMetricQueryPool);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricQueryCreate(
|
||||||
|
zet_metric_query_pool_handle_t hMetricQueryPool,
|
||||||
|
uint32_t index,
|
||||||
|
zet_metric_query_handle_t *phMetricQuery) {
|
||||||
|
return L0::zetMetricQueryCreate(
|
||||||
|
hMetricQueryPool,
|
||||||
|
index,
|
||||||
|
phMetricQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricQueryDestroy(
|
||||||
|
zet_metric_query_handle_t hMetricQuery) {
|
||||||
|
return L0::zetMetricQueryDestroy(
|
||||||
|
hMetricQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricQueryReset(
|
||||||
|
zet_metric_query_handle_t hMetricQuery) {
|
||||||
|
return L0::zetMetricQueryReset(
|
||||||
|
hMetricQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetCommandListAppendMetricQueryBegin(
|
||||||
|
zet_command_list_handle_t hCommandList,
|
||||||
|
zet_metric_query_handle_t hMetricQuery) {
|
||||||
|
return L0::zetCommandListAppendMetricQueryBegin(
|
||||||
|
hCommandList,
|
||||||
|
hMetricQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetCommandListAppendMetricQueryEnd(
|
||||||
|
zet_command_list_handle_t hCommandList,
|
||||||
|
zet_metric_query_handle_t hMetricQuery,
|
||||||
|
ze_event_handle_t hSignalEvent,
|
||||||
|
uint32_t numWaitEvents,
|
||||||
|
ze_event_handle_t *phWaitEvents) {
|
||||||
|
return L0::zetCommandListAppendMetricQueryEnd(
|
||||||
|
hCommandList,
|
||||||
|
hMetricQuery,
|
||||||
|
hSignalEvent,
|
||||||
|
numWaitEvents,
|
||||||
|
phWaitEvents);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetCommandListAppendMetricMemoryBarrier(
|
||||||
|
zet_command_list_handle_t hCommandList) {
|
||||||
|
return L0::zetCommandListAppendMetricMemoryBarrier(
|
||||||
|
hCommandList);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricQueryGetData(
|
||||||
|
zet_metric_query_handle_t hMetricQuery,
|
||||||
|
size_t *pRawDataSize,
|
||||||
|
uint8_t *pRawData) {
|
||||||
|
return L0::zetMetricQueryGetData(
|
||||||
|
hMetricQuery,
|
||||||
|
pRawDataSize,
|
||||||
|
pRawData);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2020-2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "level_zero/core/source/module/module.h"
|
|
||||||
#include <level_zero/zet_api.h>
|
|
||||||
|
|
||||||
ZE_DLLEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetModuleGetDebugInfo(
|
|
||||||
zet_module_handle_t hModule,
|
|
||||||
zet_module_debug_info_format_t format,
|
|
||||||
size_t *pSize,
|
|
||||||
uint8_t *pDebugInfo) {
|
|
||||||
return L0::Module::fromHandle(hModule)->getDebugInfo(pSize, pDebugInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
ZE_APIEXPORT ze_result_t ZE_APICALL
|
|
||||||
zetKernelGetProfileInfo(
|
|
||||||
zet_kernel_handle_t hKernel,
|
|
||||||
zet_profile_properties_t *pProfileProperties) {
|
|
||||||
return L0::Kernel::fromHandle(hKernel)->getProfileInfo(pProfileProperties);
|
|
||||||
}
|
|
||||||
48
level_zero/api/tools/zet_module_api_entrypoints.h
Normal file
48
level_zero/api/tools/zet_module_api_entrypoints.h
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "level_zero/core/source/module/module.h"
|
||||||
|
#include <level_zero/zet_api.h>
|
||||||
|
|
||||||
|
namespace L0 {
|
||||||
|
ze_result_t zetModuleGetDebugInfo(
|
||||||
|
zet_module_handle_t hModule,
|
||||||
|
zet_module_debug_info_format_t format,
|
||||||
|
size_t *pSize,
|
||||||
|
uint8_t *pDebugInfo) {
|
||||||
|
return L0::Module::fromHandle(hModule)->getDebugInfo(pSize, pDebugInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
ze_result_t zetKernelGetProfileInfo(
|
||||||
|
zet_kernel_handle_t hKernel,
|
||||||
|
zet_profile_properties_t *pProfileProperties) {
|
||||||
|
return L0::Kernel::fromHandle(hKernel)->getProfileInfo(pProfileProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace L0
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetModuleGetDebugInfo(
|
||||||
|
zet_module_handle_t hModule,
|
||||||
|
zet_module_debug_info_format_t format,
|
||||||
|
size_t *pSize,
|
||||||
|
uint8_t *pDebugInfo) {
|
||||||
|
return L0::zetModuleGetDebugInfo(
|
||||||
|
hModule,
|
||||||
|
format,
|
||||||
|
pSize,
|
||||||
|
pDebugInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
ZE_APIEXPORT ze_result_t ZE_APICALL zetKernelGetProfileInfo(
|
||||||
|
zet_kernel_handle_t hKernel,
|
||||||
|
zet_profile_properties_t *pProfileProperties) {
|
||||||
|
return L0::zetKernelGetProfileInfo(hKernel, pProfileProperties);
|
||||||
|
}
|
||||||
|
}
|
||||||
11
level_zero/api/tools/zet_tools_all_api_entrypoints.h
Normal file
11
level_zero/api/tools/zet_tools_all_api_entrypoints.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "zet_debug_api_entrypoints.h"
|
||||||
|
#include "zet_metric_api_entrypoints.h"
|
||||||
|
#include "zet_module_api_entrypoints.h"
|
||||||
@@ -13,7 +13,7 @@ namespace L0 {
|
|||||||
std::unordered_map<std::string, void *> getExtensionFunctionsLookupMap() {
|
std::unordered_map<std::string, void *> getExtensionFunctionsLookupMap() {
|
||||||
std::unordered_map<std::string, void *> lookupMap;
|
std::unordered_map<std::string, void *> lookupMap;
|
||||||
|
|
||||||
#define addToMap(map, x) map[#x] = reinterpret_cast<void *>(&x)
|
#define addToMap(map, x) map[#x] = reinterpret_cast<void *>(&L0::x)
|
||||||
addToMap(lookupMap, zexDriverImportExternalPointer);
|
addToMap(lookupMap, zexDriverImportExternalPointer);
|
||||||
addToMap(lookupMap, zexDriverReleaseImportedPointer);
|
addToMap(lookupMap, zexDriverReleaseImportedPointer);
|
||||||
addToMap(lookupMap, zexDriverGetHostPointerBaseAddress);
|
addToMap(lookupMap, zexDriverGetHostPointerBaseAddress);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "shared/test/common/test_macros/test.h"
|
#include "shared/test/common/test_macros/test.h"
|
||||||
|
|
||||||
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
#include "level_zero/api/driver_experimental/public/zex_api.h"
|
||||||
|
#include "level_zero/api/driver_experimental/public/zex_driver.h"
|
||||||
#include "level_zero/core/source/driver/driver_handle_imp.h"
|
#include "level_zero/core/source/driver/driver_handle_imp.h"
|
||||||
#include "level_zero/core/source/driver/driver_imp.h"
|
#include "level_zero/core/source/driver/driver_imp.h"
|
||||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||||
@@ -653,10 +654,10 @@ struct HostImportApiFixture : public HostPointerManagerFixure {
|
|||||||
using DriverExperimentalApiTest = Test<HostImportApiFixture>;
|
using DriverExperimentalApiTest = Test<HostImportApiFixture>;
|
||||||
|
|
||||||
TEST_F(DriverExperimentalApiTest, whenRetrievingApiFunctionThenExpectProperPointer) {
|
TEST_F(DriverExperimentalApiTest, whenRetrievingApiFunctionThenExpectProperPointer) {
|
||||||
decltype(&zexDriverImportExternalPointer) expectedImport = zexDriverImportExternalPointer;
|
decltype(&zexDriverImportExternalPointer) expectedImport = L0::zexDriverImportExternalPointer;
|
||||||
decltype(&zexDriverReleaseImportedPointer) expectedRelease = zexDriverReleaseImportedPointer;
|
decltype(&zexDriverReleaseImportedPointer) expectedRelease = L0::zexDriverReleaseImportedPointer;
|
||||||
decltype(&zexDriverGetHostPointerBaseAddress) expectedGet = zexDriverGetHostPointerBaseAddress;
|
decltype(&zexDriverGetHostPointerBaseAddress) expectedGet = L0::zexDriverGetHostPointerBaseAddress;
|
||||||
decltype(&zexKernelGetBaseAddress) expectedKernelGetBaseAddress = zexKernelGetBaseAddress;
|
decltype(&zexKernelGetBaseAddress) expectedKernelGetBaseAddress = L0::zexKernelGetBaseAddress;
|
||||||
|
|
||||||
void *funPtr = nullptr;
|
void *funPtr = nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -216,15 +216,15 @@ TEST_F(MetricIpSamplingCalculateMetricsTest, GivenEnumerationIsSuccessfulWhenCal
|
|||||||
uint32_t setCount = 0;
|
uint32_t setCount = 0;
|
||||||
uint32_t totalMetricValueCount = 0;
|
uint32_t totalMetricValueCount = 0;
|
||||||
std::vector<uint32_t> metricCounts(2);
|
std::vector<uint32_t> metricCounts(2);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
||||||
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
||||||
&setCount, &totalMetricValueCount, metricCounts.data(), nullptr),
|
&setCount, &totalMetricValueCount, metricCounts.data(), nullptr),
|
||||||
ZE_RESULT_SUCCESS);
|
ZE_RESULT_SUCCESS);
|
||||||
EXPECT_TRUE(setCount == 1);
|
EXPECT_TRUE(setCount == 1);
|
||||||
EXPECT_TRUE(totalMetricValueCount == 40);
|
EXPECT_TRUE(totalMetricValueCount == 40);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
||||||
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
||||||
&setCount, &totalMetricValueCount, metricCounts.data(), metricValues.data()),
|
&setCount, &totalMetricValueCount, metricCounts.data(), metricValues.data()),
|
||||||
ZE_RESULT_SUCCESS);
|
ZE_RESULT_SUCCESS);
|
||||||
EXPECT_TRUE(setCount == 1);
|
EXPECT_TRUE(setCount == 1);
|
||||||
EXPECT_TRUE(totalMetricValueCount == 20);
|
EXPECT_TRUE(totalMetricValueCount == 20);
|
||||||
@@ -255,9 +255,9 @@ TEST_F(MetricIpSamplingCalculateMetricsTest, GivenEnumerationIsSuccessfulWhenCal
|
|||||||
uint32_t setCount = 0;
|
uint32_t setCount = 0;
|
||||||
uint32_t totalMetricValueCount = 0;
|
uint32_t totalMetricValueCount = 0;
|
||||||
std::vector<uint32_t> metricCounts(2);
|
std::vector<uint32_t> metricCounts(2);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
||||||
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize + 1, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize + 1, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
||||||
&setCount, &totalMetricValueCount, metricCounts.data(), nullptr),
|
&setCount, &totalMetricValueCount, metricCounts.data(), nullptr),
|
||||||
ZE_RESULT_ERROR_INVALID_SIZE);
|
ZE_RESULT_ERROR_INVALID_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,15 +283,15 @@ TEST_F(MetricIpSamplingCalculateMetricsTest, GivenEnumerationIsSuccessfulWhenCal
|
|||||||
uint32_t setCount = 0;
|
uint32_t setCount = 0;
|
||||||
uint32_t totalMetricValueCount = 0;
|
uint32_t totalMetricValueCount = 0;
|
||||||
std::vector<uint32_t> metricCounts(2);
|
std::vector<uint32_t> metricCounts(2);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
||||||
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
||||||
&setCount, &totalMetricValueCount, metricCounts.data(), nullptr),
|
&setCount, &totalMetricValueCount, metricCounts.data(), nullptr),
|
||||||
ZE_RESULT_SUCCESS);
|
ZE_RESULT_SUCCESS);
|
||||||
EXPECT_TRUE(setCount == 1);
|
EXPECT_TRUE(setCount == 1);
|
||||||
EXPECT_TRUE(totalMetricValueCount == 40);
|
EXPECT_TRUE(totalMetricValueCount == 40);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroups[0],
|
||||||
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize + 1, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawDataVectorSize + 1, reinterpret_cast<uint8_t *>(rawDataVector.data()),
|
||||||
&setCount, &totalMetricValueCount, metricCounts.data(), metricValues.data()),
|
&setCount, &totalMetricValueCount, metricCounts.data(), metricValues.data()),
|
||||||
ZE_RESULT_ERROR_INVALID_SIZE);
|
ZE_RESULT_ERROR_INVALID_SIZE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1703,13 +1703,13 @@ TEST_F(MetricEnumerationTest, givenIncorrectRawReportSizeWhenZetMetricGroupCalcu
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
||||||
EXPECT_EQ(dataCount, 0u);
|
EXPECT_EQ(dataCount, 0u);
|
||||||
EXPECT_EQ(totalMetricCount, 0u);
|
EXPECT_EQ(totalMetricCount, 0u);
|
||||||
|
|
||||||
// Invalid raw buffer size provided by the driver.
|
// Invalid raw buffer size provided by the driver.
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
||||||
EXPECT_EQ(dataCount, 0u);
|
EXPECT_EQ(dataCount, 0u);
|
||||||
EXPECT_EQ(totalMetricCount, 0u);
|
EXPECT_EQ(totalMetricCount, 0u);
|
||||||
}
|
}
|
||||||
@@ -1783,14 +1783,14 @@ TEST_F(MetricEnumerationTest, givenCorrectRawReportSizeWhenZetMetricGroupCalcula
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_EQ(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_EQ(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(dataCount, 1u);
|
EXPECT_EQ(dataCount, 1u);
|
||||||
EXPECT_EQ(totalMetricCount, metricsSetParams.MetricsCount);
|
EXPECT_EQ(totalMetricCount, metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
// Copy calculated metrics.
|
// Copy calculated metrics.
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(metricCounts[0], totalMetricCount);
|
EXPECT_EQ(metricCounts[0], totalMetricCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1861,14 +1861,14 @@ TEST_F(MetricEnumerationTest, givenFailedCalculateMetricsWhenZetMetricGroupCalcu
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_EQ(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_EQ(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(dataCount, 1u);
|
EXPECT_EQ(dataCount, 1u);
|
||||||
EXPECT_EQ(totalMetricCount, metricsSetParams.MetricsCount);
|
EXPECT_EQ(totalMetricCount, metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
// Copy calculated metrics.
|
// Copy calculated metrics.
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_ERROR_UNKNOWN);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_ERROR_UNKNOWN);
|
||||||
EXPECT_EQ(metricCounts[0], 0u);
|
EXPECT_EQ(metricCounts[0], 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1946,7 +1946,7 @@ TEST_F(MetricEnumerationTest, givenInvalidQueryReportSizeWhenZetMetricGroupCalcu
|
|||||||
// Invalid raw buffer size provided by the driver.
|
// Invalid raw buffer size provided by the driver.
|
||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
||||||
EXPECT_EQ(dataCount, 0u);
|
EXPECT_EQ(dataCount, 0u);
|
||||||
EXPECT_EQ(totalMetricCount, 0u);
|
EXPECT_EQ(totalMetricCount, 0u);
|
||||||
}
|
}
|
||||||
@@ -2032,14 +2032,14 @@ TEST_F(MetricEnumerationTest, givenCorrectRawDataHeaderWhenZetMetricGroupCalcula
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(dataCount, 1u);
|
EXPECT_EQ(dataCount, 1u);
|
||||||
EXPECT_EQ(totalMetricCount, metricsSetParams.MetricsCount);
|
EXPECT_EQ(totalMetricCount, metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
// Copy calculated metrics.
|
// Copy calculated metrics.
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(metricCounts[0], totalMetricCount);
|
EXPECT_EQ(metricCounts[0], totalMetricCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -328,14 +328,14 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenCorrectRawDataHeaderWhenZetMetricG
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(dataCount, subDeviceCount);
|
EXPECT_EQ(dataCount, subDeviceCount);
|
||||||
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount);
|
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
// Copy calculated metrics.
|
// Copy calculated metrics.
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(metricCounts[0], metricsSetParams.MetricsCount);
|
EXPECT_EQ(metricCounts[0], metricsSetParams.MetricsCount);
|
||||||
EXPECT_EQ(metricCounts[1], metricsSetParams.MetricsCount);
|
EXPECT_EQ(metricCounts[1], metricsSetParams.MetricsCount);
|
||||||
}
|
}
|
||||||
@@ -421,7 +421,7 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenInvalidDataCountAndTotalMetricCoun
|
|||||||
uint32_t dataCount = 1000;
|
uint32_t dataCount = 1000;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(subDeviceCount, dataCount);
|
EXPECT_EQ(subDeviceCount, dataCount);
|
||||||
EXPECT_EQ(subDeviceCount * metricsSetParams.MetricsCount, totalMetricCount);
|
EXPECT_EQ(subDeviceCount * metricsSetParams.MetricsCount, totalMetricCount);
|
||||||
|
|
||||||
@@ -429,7 +429,7 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenInvalidDataCountAndTotalMetricCoun
|
|||||||
dataCount = 0;
|
dataCount = 0;
|
||||||
totalMetricCount = 1000;
|
totalMetricCount = 1000;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(subDeviceCount, dataCount);
|
EXPECT_EQ(subDeviceCount, dataCount);
|
||||||
EXPECT_EQ(subDeviceCount * metricsSetParams.MetricsCount, totalMetricCount);
|
EXPECT_EQ(subDeviceCount * metricsSetParams.MetricsCount, totalMetricCount);
|
||||||
}
|
}
|
||||||
@@ -515,7 +515,7 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenInvalidQueryReportSizeWhenZetMetri
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_ERROR_UNKNOWN);
|
||||||
EXPECT_EQ(dataCount, 0u);
|
EXPECT_EQ(dataCount, 0u);
|
||||||
EXPECT_EQ(totalMetricCount, 0u);
|
EXPECT_EQ(totalMetricCount, 0u);
|
||||||
}
|
}
|
||||||
@@ -605,14 +605,14 @@ TEST_F(MetricEnumerationMultiDeviceTest, givenErrorGeneralOnCalculateMetricsWhen
|
|||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
EXPECT_NE(metricsSetParams.QueryReportSize, rawResultsSize);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(dataCount, subDeviceCount);
|
EXPECT_EQ(dataCount, subDeviceCount);
|
||||||
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount);
|
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
// Copy calculated metrics. CalculateMetrics returns CC_ERROR_GENERAL for first sub device.
|
// Copy calculated metrics. CalculateMetrics returns CC_ERROR_GENERAL for first sub device.
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_ERROR_UNKNOWN);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawResultsSize, rawResults, &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_ERROR_UNKNOWN);
|
||||||
EXPECT_EQ(metricCounts[0], 0u);
|
EXPECT_EQ(metricCounts[0], 0u);
|
||||||
EXPECT_EQ(metricCounts[1], 0u);
|
EXPECT_EQ(metricCounts[1], 0u);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1497,13 +1497,13 @@ TEST_F(MultiDeviceMetricQueryPoolTest, givenValidArgumentsWhenZetMetricGroupCalc
|
|||||||
|
|
||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(dataCount, subDeviceCount);
|
EXPECT_EQ(dataCount, subDeviceCount);
|
||||||
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount);
|
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(metricCounts[0], metricsSetParams.MetricsCount);
|
EXPECT_EQ(metricCounts[0], metricsSetParams.MetricsCount);
|
||||||
EXPECT_EQ(metricCounts[1], metricsSetParams.MetricsCount);
|
EXPECT_EQ(metricCounts[1], metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
|
|||||||
@@ -250,12 +250,12 @@ TEST_F(MetricStreamerMultiDeviceTest, givenValidArgumentsWhenZetMetricGroupCalcu
|
|||||||
|
|
||||||
uint32_t dataCount = 0;
|
uint32_t dataCount = 0;
|
||||||
uint32_t totalMetricCount = 0;
|
uint32_t totalMetricCount = 0;
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, nullptr, nullptr), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount * reportCount);
|
EXPECT_EQ(totalMetricCount, subDeviceCount * metricsSetParams.MetricsCount * reportCount);
|
||||||
|
|
||||||
std::vector<uint32_t> metricCounts(dataCount);
|
std::vector<uint32_t> metricCounts(dataCount);
|
||||||
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
std::vector<zet_typed_value_t> caculatedRawResults(totalMetricCount);
|
||||||
EXPECT_EQ(zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
EXPECT_EQ(L0::zetMetricGroupCalculateMultipleMetricValuesExp(metricGroupHandle, ZET_METRIC_GROUP_CALCULATION_TYPE_METRIC_VALUES, rawSize, rawData.data(), &dataCount, &totalMetricCount, metricCounts.data(), caculatedRawResults.data()), ZE_RESULT_SUCCESS);
|
||||||
EXPECT_EQ(metricCounts[0], metricsSetParams.MetricsCount);
|
EXPECT_EQ(metricCounts[0], metricsSetParams.MetricsCount);
|
||||||
EXPECT_EQ(metricCounts[1], metricsSetParams.MetricsCount);
|
EXPECT_EQ(metricCounts[1], metricsSetParams.MetricsCount);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user