Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QueueWrapper.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file QueueWrapper.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020-2021 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
11 // Acts include(s).
13 
14 // System include(s)
15 #include <memory>
16 #include <string>
17 
19 inline namespace cl {
20 namespace sycl {
21 class queue;
22 }
23 }; // namespace cl
24 
25 namespace Acts::Sycl {
26 
27 class QueueWrapper {
28  public:
31  QueueWrapper(const std::string& = "",
32  std::unique_ptr<const Logger> logger =
33  getDefaultLogger("Sycl::QueueWrapper", Logging::INFO));
35  QueueWrapper(cl::sycl::queue& queue,
36  std::unique_ptr<const Logger> logger =
37  getDefaultLogger("Sycl::QueueWrapper", Logging::INFO));
40  QueueWrapper(QueueWrapper&& parent) noexcept;
43  QueueWrapper(const QueueWrapper& other);
46  ~QueueWrapper();
47 
51  QueueWrapper& operator=(const QueueWrapper& other);
52 
55 
57  const cl::sycl::queue* getQueue() const;
59  cl::sycl::queue* getQueue();
60 
62  const cl::sycl::queue* operator->() const;
64  cl::sycl::queue* operator->();
65 
67  const cl::sycl::queue& operator*() const;
69  cl::sycl::queue& operator*();
70 
72 
73  private:
75  cl::sycl::queue* m_queue;
79  std::unique_ptr<const Logger> m_logger;
80 
82  const Logger& logger() const { return *m_logger; }
83 
84 }; // class QueueWrapper
85 } // namespace Acts::Sycl