mirror of
https://github.com/intel/compute-runtime.git
synced 2025-06-28 17:58:30 +08:00

Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
32 lines
693 B
C++
32 lines
693 B
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "runtime/helpers/properties_helper.h"
|
|
|
|
#include <mutex>
|
|
#include <vector>
|
|
|
|
namespace NEO {
|
|
|
|
class MapOperationsHandler {
|
|
public:
|
|
virtual ~MapOperationsHandler() = default;
|
|
|
|
bool add(void *ptr, size_t ptrLength, cl_map_flags &mapFlags, MemObjSizeArray &size, MemObjOffsetArray &offset, uint32_t mipLevel);
|
|
void remove(void *mappedPtr);
|
|
bool find(void *mappedPtr, MapInfo &outMapInfo);
|
|
size_t size() const;
|
|
|
|
protected:
|
|
bool isOverlapping(MapInfo &inputMapInfo);
|
|
std::vector<MapInfo> mappedPointers;
|
|
mutable std::mutex mtx;
|
|
};
|
|
|
|
} // namespace NEO
|