DPC++ Runtime
Runtime libraries for oneAPI DPC++
fusion_wrapper.cpp
Go to the documentation of this file.
1 //==------------ fusion_wrapper.cpp ----------------------------------------==//
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 
10 
12 #include <detail/queue_impl.hpp>
13 
14 namespace sycl {
16 namespace ext::codeplay::experimental {
17 
18 fusion_wrapper::fusion_wrapper(queue &Queue) {
19  if (!Queue.ext_codeplay_supports_fusion()) {
20  throw sycl::exception(
21  sycl::errc::invalid,
22  "Cannot wrap a queue for fusion which doesn't support fusion");
23  }
24  MImpl = std::make_shared<detail::fusion_wrapper_impl>(
26 }
27 
28 queue fusion_wrapper::get_queue() const {
29  return sycl::detail::createSyclObjFromImpl<sycl::queue>(MImpl->get_queue());
30 }
31 
32 bool fusion_wrapper::is_in_fusion_mode() const {
33  return MImpl->is_in_fusion_mode();
34 }
35 
36 void fusion_wrapper::start_fusion() { MImpl->start_fusion(); }
37 
38 void fusion_wrapper::cancel_fusion() { MImpl->cancel_fusion(); }
39 
40 event fusion_wrapper::complete_fusion(const property_list &PropList) {
41  return MImpl->complete_fusion(PropList);
42 }
43 
44 } // namespace ext::codeplay::experimental
45 } // __SYCL_INLINE_VER_NAMESPACE(_V1)
46 } // namespace sycl
fusion_wrapper.hpp
sycl::_V1::property_list
Objects of the property_list class are containers for the SYCL properties.
Definition: property_list.hpp:24
__SYCL_INLINE_VER_NAMESPACE
#define __SYCL_INLINE_VER_NAMESPACE(X)
Definition: defines_elementary.hpp:11
fusion_wrapper_impl.hpp
sycl
---— Error handling, matching OpenCL plugin semantics.
Definition: access.hpp:14
queue_impl.hpp
sycl::_V1::queue
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition: queue.hpp:89
sycl::_V1::queue::ext_codeplay_supports_fusion
bool ext_codeplay_supports_fusion() const
Returns true if the queue was created with the ext::codeplay::experimental::property::queue::enable_f...
Definition: queue.cpp:239
sycl::_V1::detail::getSyclObjImpl
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
Definition: common.hpp:300