DPC++ Runtime
Runtime libraries for oneAPI DPC++
sampler_impl.hpp
Go to the documentation of this file.
1
//==----------------- sampler_impl.hpp - SYCL standard header file ---------==//
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 <
CL/__spirv/spirv_types.hpp
>
12
#include <
sycl/context.hpp
>
13
#include <
sycl/detail/export.hpp
>
14
#include <
sycl/detail/pi.hpp
>
15
#include <
sycl/property_list.hpp
>
16
17
#include <mutex>
18
#include <unordered_map>
19
20
namespace
sycl
{
21
inline
namespace
_V1 {
22
23
enum class
addressing_mode
: unsigned int;
24
enum class
filtering_mode
: unsigned int;
25
enum class
coordinate_normalization_mode
: unsigned int;
26
27
namespace detail {
28
class
__SYCL_EXPORT
sampler_impl
{
29
public
:
30
sampler_impl
(
coordinate_normalization_mode
normalizationMode,
31
addressing_mode
addressingMode,
filtering_mode
filteringMode,
32
const
property_list
&propList);
33
34
sampler_impl
(cl_sampler clSampler,
const
context
&syclContext);
35
36
addressing_mode
get_addressing_mode()
const
;
37
38
filtering_mode
get_filtering_mode()
const
;
39
40
coordinate_normalization_mode
get_coordinate_normalization_mode()
const
;
41
42
sycl::detail::pi::PiSampler
getOrCreateSampler(
const
context
&Context);
43
47
template
<
typename
propertyT>
bool
has_property
() const
noexcept
{
48
return
MPropList.has_property<propertyT>();
49
}
50
57
template
<
typename
propertyT> propertyT
get_property
()
const
{
58
return
MPropList.get_property<propertyT>();
59
}
60
61
~
sampler_impl
();
62
63
private
:
65
std::mutex MMutex;
66
67
std::unordered_map<context, sycl::detail::pi::PiSampler> MContextToSampler;
68
69
coordinate_normalization_mode
MCoordNormMode;
70
addressing_mode
MAddrMode;
71
filtering_mode
MFiltMode;
72
property_list
MPropList;
73
};
74
75
}
// namespace detail
76
}
// namespace _V1
77
}
// namespace sycl
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition:
context.hpp:51
sycl::_V1::detail::sampler_impl
Definition:
sampler_impl.hpp:28
sycl::_V1::detail::sampler_impl::get_property
propertyT get_property() const
Gets the specified property of this sampler_impl.
Definition:
sampler_impl.hpp:57
sycl::_V1::detail::sampler_impl::has_property
bool has_property() const noexcept
Checks if this sampler_impl has a property of type propertyT.
Definition:
sampler_impl.hpp:47
sycl::_V1::property_list
Objects of the property_list class are containers for the SYCL properties.
Definition:
property_list.hpp:31
context.hpp
export.hpp
sycl::_V1::filtering_mode
filtering_mode
Definition:
sampler.hpp:31
sycl::_V1::coordinate_normalization_mode
coordinate_normalization_mode
Definition:
sampler.hpp:36
sycl::_V1::addressing_mode
addressing_mode
Definition:
sampler.hpp:23
sycl
Definition:
access.hpp:18
pi.hpp
C++ wrapper of extern "C" PI interfaces.
property_list.hpp
spirv_types.hpp
noexcept
_Abi const simd< _Tp, _Abi > & noexcept
Definition:
simd.hpp:1324
_pi_sampler
Definition:
pi_cuda.hpp:76
source
detail
sampler_impl.hpp
Generated by
1.9.1