Files
compute-runtime/runtime/os_interface/linux/drm_limited_range.h
Maciej Plewka 9e52684f5b Change namespace from OCLRT to NEO
Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2019-03-26 15:48:19 +01:00

35 lines
767 B
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/helpers/aligned_memory.h"
#include "runtime/helpers/basic_math.h"
#include "runtime/helpers/ptr_math.h"
#include "runtime/utilities/heap_allocator.h"
#include <memory>
#include <stdint.h>
#include <sys/mman.h>
namespace NEO {
class AllocatorLimitedRange {
public:
AllocatorLimitedRange(uint64_t base, uint64_t size);
AllocatorLimitedRange() = delete;
~AllocatorLimitedRange() = default;
uint64_t allocate(size_t &size);
void free(uint64_t ptr, size_t size);
uint64_t getBase() const;
protected:
uint64_t base = 0;
uint64_t size = 0;
std::unique_ptr<HeapAllocator> heapAllocator;
};
} // namespace NEO