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/ur.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
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
ur_sampler_handle_t getOrCreateSampler(
const
context
&Context);
43
44
~
sampler_impl
();
45
46
const
property_list
&
getPropList
()
const
{
return
MPropList; }
47
48
private
:
50
std::mutex MMutex;
51
52
std::unordered_map<context, ur_sampler_handle_t> MContextToSampler;
53
54
coordinate_normalization_mode
MCoordNormMode;
55
addressing_mode
MAddrMode;
56
filtering_mode
MFiltMode;
57
property_list
MPropList;
58
};
59
60
}
// namespace detail
61
}
// namespace _V1
62
}
// namespace sycl
sycl::_V1::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition:
context.hpp:50
sycl::_V1::detail::sampler_impl
Definition:
sampler_impl.hpp:28
sycl::_V1::detail::sampler_impl::getPropList
const property_list & getPropList() const
Definition:
sampler_impl.hpp:46
sycl::_V1::property_list
Objects of the property_list class are containers for the SYCL properties.
Definition:
property_list.hpp:30
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
property_list.hpp
spirv_types.hpp
ur.hpp
C++ utilities for Unified Runtime integration.
source
detail
sampler_impl.hpp
Generated by
1.9.1