File indexing completed on 2024-04-06 12:03:45
0001 #ifndef CUDADataFormats_Common_Product_h
0002 #define CUDADataFormats_Common_Product_h
0003
0004 #include <memory>
0005
0006 #include "CUDADataFormats/Common/interface/ProductBase.h"
0007
0008 namespace edm {
0009 template <typename T>
0010 class Wrapper;
0011 }
0012
0013 namespace cms {
0014 namespace cuda {
0015 namespace impl {
0016 class ScopedContextGetterBase;
0017 }
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 template <typename T>
0034 class Product : public ProductBase {
0035 public:
0036 Product() = default;
0037
0038 Product(const Product&) = delete;
0039 Product& operator=(const Product&) = delete;
0040 Product(Product&&) = default;
0041 Product& operator=(Product&&) = default;
0042
0043 private:
0044 friend class impl::ScopedContextGetterBase;
0045 friend class ScopedContextProduce;
0046 friend class edm::Wrapper<Product<T>>;
0047
0048 explicit Product(int device, SharedStreamPtr stream, SharedEventPtr event, T data)
0049 : ProductBase(device, std::move(stream), std::move(event)), data_(std::move(data)) {}
0050
0051 template <typename... Args>
0052 explicit Product(int device, SharedStreamPtr stream, SharedEventPtr event, Args&&... args)
0053 : ProductBase(device, std::move(stream), std::move(event)), data_(std::forward<Args>(args)...) {}
0054
0055 T data_;
0056 };
0057 }
0058 }
0059
0060 #endif