DPC++ Runtime
Runtime libraries for oneAPI DPC++
virtual_mem.hpp
Go to the documentation of this file.
1
//==- virtual_mem.hpp - sycl_ext_oneapi_virtual_mem virtual mem free funcs -==//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#pragma once
10
11
#include <
sycl/access/access.hpp
>
12
#include <
sycl/context.hpp
>
13
#include <
sycl/detail/common.hpp
>
14
#include <
sycl/device.hpp
>
15
#include <
sycl/ext/oneapi/virtual_mem/physical_mem.hpp
>
16
#include <
sycl/queue.hpp
>
17
18
#include <optional>
19
20
namespace
sycl
{
21
inline
namespace
_V1 {
22
namespace
ext::oneapi::experimental {
23
24
enum class
granularity_mode
: char {
25
minimum
= 0,
26
recommended
= 1,
27
};
28
29
__SYCL_EXPORT
size_t
30
get_mem_granularity
(
const
device
&SyclDevice,
const
context
&SyclContext,
31
granularity_mode
Mode
=
granularity_mode::recommended
);
32
33
__SYCL_EXPORT
size_t
34
get_mem_granularity
(
const
context
&SyclContext,
35
granularity_mode
Mode
=
granularity_mode::recommended
);
36
37
__SYCL_EXPORT uintptr_t
reserve_virtual_mem
(uintptr_t Start,
size_t
NumBytes,
38
const
context
&SyclContext);
39
40
inline
uintptr_t
reserve_virtual_mem
(
size_t
NumBytes,
41
const
context
&SyclContext) {
42
return
reserve_virtual_mem
(0, NumBytes, SyclContext);
43
}
44
45
__SYCL_EXPORT
void
free_virtual_mem
(uintptr_t Ptr,
size_t
NumBytes,
46
const
context
&SyclContext);
47
48
__SYCL_EXPORT
void
set_access_mode
(
const
void
*Ptr,
size_t
NumBytes,
49
address_access_mode
Mode
,
50
const
context
&SyclContext);
51
52
__SYCL_EXPORT
address_access_mode
get_access_mode
(
const
void
*Ptr,
53
size_t
NumBytes,
54
const
context
&SyclContext);
55
56
__SYCL_EXPORT
void
unmap
(
const
void
*Ptr,
size_t
NumBytes,
57
const
context
&SyclContext);
58
59
}
// Namespace ext::oneapi::experimental
60
}
// namespace _V1
61
}
// Namespace sycl
access.hpp
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition:
context.hpp:50
sycl::_V1::device
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
Definition:
device.hpp:64
context.hpp
common.hpp
sycl::_V1::ext::oneapi::experimental::address_access_mode
address_access_mode
Definition:
physical_mem.hpp:27
sycl::_V1::ext::oneapi::experimental::granularity_mode
granularity_mode
Definition:
virtual_mem.hpp:24
sycl::_V1::ext::oneapi::experimental::granularity_mode::recommended
@ recommended
sycl::_V1::ext::oneapi::experimental::get_mem_granularity
size_t get_mem_granularity(const device &SyclDevice, const context &SyclContext, granularity_mode Mode=granularity_mode::recommended)
Definition:
virtual_mem.cpp:25
sycl::_V1::ext::oneapi::experimental::unmap
void unmap(const void *Ptr, size_t NumBytes, const context &SyclContext)
Definition:
virtual_mem.cpp:175
sycl::_V1::ext::oneapi::experimental::set_access_mode
void set_access_mode(const void *Ptr, size_t NumBytes, address_access_mode Mode, const context &SyclContext)
Definition:
virtual_mem.cpp:137
sycl::_V1::ext::oneapi::experimental::get_access_mode
address_access_mode get_access_mode(const void *Ptr, size_t NumBytes, const context &SyclContext)
Definition:
virtual_mem.cpp:148
sycl::_V1::ext::oneapi::experimental::free_virtual_mem
void free_virtual_mem(uintptr_t Ptr, size_t NumBytes, const context &SyclContext)
Definition:
virtual_mem.cpp:128
sycl::_V1::ext::oneapi::experimental::reserve_virtual_mem
uintptr_t reserve_virtual_mem(uintptr_t Start, size_t NumBytes, const context &SyclContext)
Definition:
virtual_mem.cpp:107
sycl::_V1::Mode
Mode
Definition:
multi_ptr.hpp:504
sycl
Definition:
access.hpp:18
physical_mem.hpp
queue.hpp
sycl::minimum
Definition:
functional.hpp:39
device.hpp
include
sycl
ext
oneapi
virtual_mem
virtual_mem.hpp
Generated by
1.9.1