DPC++ Runtime
Runtime libraries for oneAPI DPC++
sampler.cpp
Go to the documentation of this file.
1 //==------------------- sampler.cpp - 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 
11 #include <sycl/property_list.hpp>
12 #include <sycl/sampler.hpp>
13 
14 namespace sycl {
15 inline namespace _V1 {
16 sampler::sampler(coordinate_normalization_mode normalizationMode,
17  addressing_mode addressingMode, filtering_mode filteringMode,
18  const property_list &propList)
19  : impl(std::make_shared<detail::sampler_impl>(
20  normalizationMode, addressingMode, filteringMode, propList)) {}
21 
22 sampler::sampler(cl_sampler clSampler, const context &syclContext)
23  : impl(std::make_shared<detail::sampler_impl>(clSampler, syclContext)) {}
24 
25 addressing_mode sampler::get_addressing_mode() const {
26  return impl->get_addressing_mode();
27 }
28 
29 filtering_mode sampler::get_filtering_mode() const {
30  return impl->get_filtering_mode();
31 }
32 
34 sampler::get_coordinate_normalization_mode() const {
35  return impl->get_coordinate_normalization_mode();
36 }
37 
38 bool sampler::operator==(const sampler &rhs) const {
39  return (impl == rhs.impl);
40 }
41 
42 bool sampler::operator!=(const sampler &rhs) const {
43  return !(impl == rhs.impl);
44 }
45 
46 #define __SYCL_PARAM_TRAITS_SPEC(param_type) \
47  template <> \
48  __SYCL_EXPORT bool sampler::has_property<param_type>() const noexcept { \
49  return impl->has_property<param_type>(); \
50  }
51 #include <sycl/detail/properties_traits.def>
52 
53 #undef __SYCL_PARAM_TRAITS_SPEC
54 
55 #define __SYCL_PARAM_TRAITS_SPEC(param_type) \
56  template <> \
57  __SYCL_EXPORT param_type sampler::get_property<param_type>() const { \
58  return impl->get_property<param_type>(); \
59  }
60 #include <sycl/detail/properties_traits.def>
61 
62 #undef __SYCL_PARAM_TRAITS_SPEC
63 
64 } // namespace _V1
65 } // namespace sycl
bool operator==(const cache_config &lhs, const cache_config &rhs)
bool operator!=(const cache_config &lhs, const cache_config &rhs)
filtering_mode
Definition: sampler.hpp:31
coordinate_normalization_mode
Definition: sampler.hpp:36
addressing_mode
Definition: sampler.hpp:23
Definition: access.hpp:18