Pass allocation type to import handle functions

This to allow flexibilty on choosing the allocation type from the
callers in layers above on the driver.

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2022-12-15 03:59:35 +00:00
committed by Compute-Runtime-Automation
parent 5a29cf8508
commit 050e4fb1da
16 changed files with 71 additions and 41 deletions

View File

@@ -7,6 +7,7 @@
#pragma once
#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/unified_memory/unified_memory.h"
#include <level_zero/ze_api.h>
@@ -154,7 +155,7 @@ struct Context : _ze_context_handle_t {
const ze_image_desc_t *desc,
ze_image_handle_t *phImage) = 0;
virtual bool isShareableMemory(const void *exportDesc, bool exportableMemory, NEO::Device *neoDevice) = 0;
virtual void *getMemHandlePtr(ze_device_handle_t hDevice, uint64_t handle, ze_ipc_memory_flags_t flags) = 0;
virtual void *getMemHandlePtr(ze_device_handle_t hDevice, uint64_t handle, NEO::AllocationType allocationType, ze_ipc_memory_flags_t flags) = 0;
static Context *fromHandle(ze_context_handle_t handle) { return static_cast<Context *>(handle); }
inline ze_context_handle_t toHandle() { return this; }