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 <CL/sycl/sampler.hpp>
12 #include <detail/sampler_impl.hpp>
13 
15 namespace sycl {
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 
26  return impl->get_addressing_mode();
27 }
28 
30  return impl->get_filtering_mode();
31 }
32 
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 <> __SYCL_EXPORT bool sampler::has_property<param_type>() const { \
48  return impl->has_property<param_type>(); \
49  }
50 #include <CL/sycl/detail/properties_traits.def>
51 
52 #undef __SYCL_PARAM_TRAITS_SPEC
53 
54 #define __SYCL_PARAM_TRAITS_SPEC(param_type) \
55  template <> \
56  __SYCL_EXPORT param_type sampler::get_property<param_type>() const { \
57  return impl->get_property<param_type>(); \
58  }
59 #include <CL/sycl/detail/properties_traits.def>
60 
61 #undef __SYCL_PARAM_TRAITS_SPEC
62 
63 } // namespace sycl
64 } // __SYCL_INLINE_NAMESPACE(cl)
property_list.hpp
cl::sycl::sampler::sampler
sampler(coordinate_normalization_mode normalizationMode, addressing_mode addressingMode, filtering_mode filteringMode, const property_list &propList={})
Definition: sampler.cpp:16
cl::sycl::sampler::operator!=
bool operator!=(const sampler &rhs) const
Definition: sampler.cpp:42
cl::sycl::sampler
Encapsulates a configuration for sampling an image accessor.
Definition: sampler.hpp:66
sycl
Definition: invoke_simd.hpp:68
cl::sycl::property_list
Objects of the property_list class are containers for the SYCL properties.
Definition: property_list.hpp:26
cl::sycl::detail::sampler_impl
Definition: sampler_impl.hpp:26
cl::sycl::sampler::get_addressing_mode
addressing_mode get_addressing_mode() const
Definition: sampler.cpp:25
all_properties.hpp
cl
We provide new interfaces for matrix muliply in this patch:
Definition: access.hpp:13
cl::sycl::coordinate_normalization_mode
coordinate_normalization_mode
Definition: sampler.hpp:33
cl::sycl::addressing_mode
addressing_mode
Definition: sampler.hpp:20
std
Definition: accessor.hpp:2617
cl::sycl::context
The context class represents a SYCL context on which kernel functions may be executed.
Definition: context.hpp:38
sampler.hpp
cl::sycl::sampler::get_coordinate_normalization_mode
coordinate_normalization_mode get_coordinate_normalization_mode() const
Definition: sampler.cpp:34
cl::sycl::filtering_mode
filtering_mode
Definition: sampler.hpp:28
cl::sycl::sampler::operator==
bool operator==(const sampler &rhs) const
Definition: sampler.cpp:38
cl::sycl::sampler::get_filtering_mode
filtering_mode get_filtering_mode() const
Definition: sampler.cpp:29
sampler_impl.hpp
__SYCL_INLINE_NAMESPACE
#define __SYCL_INLINE_NAMESPACE(X)
Definition: defines_elementary.hpp:12