DPC++ Runtime
Runtime libraries for oneAPI DPC++
specialization_id.hpp
Go to the documentation of this file.
1 //==---- specialization_id.hpp -- SYCL standard header file ----*- C++ -*---==//
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 namespace sycl {
13 
17 template <typename T> class __SYCL_TYPE(specialization_id) specialization_id {
18 public:
19  using value_type = T;
20 
21  template <class... Args>
22  explicit constexpr specialization_id(Args &&...args)
23  : MDefaultValue(std::forward<Args>(args)...) {}
24 
25  specialization_id(const specialization_id &rhs) = delete;
26  specialization_id(specialization_id &&rhs) = delete;
27  specialization_id &operator=(const specialization_id &rhs) = delete;
28  specialization_id &operator=(specialization_id &&rhs) = delete;
29 
30 private:
31  template <bundle_state State> friend class kernel_bundle;
32  T getDefaultValue() const noexcept { return MDefaultValue; }
33 
34  T MDefaultValue;
35 };
36 
37 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
38 } // namespace sycl
T
__SYCL_INLINE_VER_NAMESPACE
#define __SYCL_INLINE_VER_NAMESPACE(X)
Definition: defines_elementary.hpp:11
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
sycl::_V1::ext::oneapi::experimental::operator=
annotated_arg & operator=(annotated_arg &)=default
sycl::_V1::kernel_bundle
The kernel_bundle class represents collection of device images in a particular state.
Definition: kernel.hpp:29