DPC++ Runtime
Runtime libraries for oneAPI DPC++
owner_less_base.hpp
Go to the documentation of this file.
1 //==-- owner_less_base.hpp --- Common base class for owner-based ordering --==//
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 <sycl/detail/common.hpp>
14 
15 namespace sycl {
17 namespace detail {
18 
19 // Common CRTP base class supplying a common definition of owner-before ordering
20 // for SYCL objects.
21 template <class SyclObjT> class OwnerLessBase {
22 public:
23 #ifndef __SYCL_DEVICE_ONLY__
24  bool ext_oneapi_owner_before(
31  const noexcept {
32  return getSyclObjImpl(*static_cast<const SyclObjT *>(this))
33  .owner_before(ext::oneapi::detail::getSyclWeakObjImpl(Other));
34  }
35 
41  bool ext_oneapi_owner_before(const SyclObjT &Other) const noexcept {
42  return getSyclObjImpl(*static_cast<const SyclObjT *>(this))
43  .owner_before(getSyclObjImpl(Other));
44  }
45 #endif
46 };
47 
48 } // namespace detail
49 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
50 } // namespace sycl
sycl::_V1::detail::OwnerLessBase::ext_oneapi_owner_before
bool ext_oneapi_owner_before(const SyclObjT &Other) const noexcept
Compares the object against another object using an owner-based implementation-defined ordering.
Definition: owner_less_base.hpp:41
__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
defines_elementary.hpp
sycl::_V1::ext::oneapi::detail::getSyclWeakObjImpl
decltype(weak_object_base< SYCLObjT >::MObjWeakPtr) getSyclWeakObjImpl(const weak_object_base< SYCLObjT > &WeakObj)
Definition: weak_object_base.hpp:21
sycl::_V1::detail::OwnerLessBase
Definition: owner_less_base.hpp:21
common.hpp
sycl::_V1::ext::oneapi::detail::weak_object_base
Definition: weak_object_base.hpp:16
weak_object_base.hpp
sycl::_V1::detail::getSyclObjImpl
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
Definition: common.hpp:300