45 using int_var_t = std::variant<
46 std::unique_ptr<details::CommunicationBuffer<CopyToHost>>,
47 std::unique_ptr<details::CommunicationBuffer<DirectGPU>>>;
52 : _int_type(std::move(moved_int_var)) {}
59 Protocol comm_mode = get_protocol(dev);
61 _int_type = std::make_unique<details::CommunicationBuffer<CopyToHost>>(
65 = std::make_unique<details::CommunicationBuffer<DirectGPU>>(bytelen, dev_sched);
74 Protocol comm_mode = get_protocol(dev);
76 _int_type = std::make_unique<details::CommunicationBuffer<CopyToHost>>(
79 _int_type = std::make_unique<details::CommunicationBuffer<DirectGPU>>(
80 std::forward<sham::DeviceBuffer<u8>>(bytebuf), dev_sched);
89 Protocol comm_mode = get_protocol(dev);
91 _int_type = std::make_unique<details::CommunicationBuffer<CopyToHost>>(
94 _int_type = std::make_unique<details::CommunicationBuffer<DirectGPU>>(
95 bytebuf.
copy(), dev_sched);
107 return arg->get_size();
112 inline u8 *get_ptr() {
115 return arg->get_ptr();
127 int_var_t tmp = std::visit(
129 return int_var_t(arg->duplicate_to_ptr());
142 return std::make_unique<CommunicationBuffer>(
duplicate());
154 using _t =
typename std::remove_reference<
decltype(*arg)>::type;
155 return _t::convert_usm(std::forward<_t>(*arg));