42 if (device.mpi_prop.is_mpi_direct_capable) {
51 template<CommunicationProtocol comm_mode>
57 std::shared_ptr<sham::DeviceScheduler> dev_sched;
63 u64 bytelen, std::shared_ptr<sham::DeviceScheduler> dev_sched)
64 : dev_sched(dev_sched), usm_buf(bytelen, dev_sched) {}
68 std::shared_ptr<sham::DeviceScheduler> dev_sched)
69 : dev_sched(dev_sched),
72 inline std::unique_ptr<CommunicationBuffer> duplicate_to_ptr() {
73 std::unique_ptr<CommunicationBuffer> ret
74 = std::make_unique<CommunicationBuffer>(usm_buf.
copy(), dev_sched);
78 inline u64 get_size() {
return usm_buf.
get_size(); }
100 std::shared_ptr<sham::DeviceScheduler> dev_sched;
106 u64 bytelen, std::shared_ptr<sham::DeviceScheduler> dev_sched)
107 : dev_sched(dev_sched), usm_buf(bytelen, dev_sched) {}
111 std::shared_ptr<sham::DeviceScheduler> dev_sched)
112 : dev_sched(dev_sched),
115 inline std::unique_ptr<CommunicationBuffer> duplicate_to_ptr() {
116 std::unique_ptr<CommunicationBuffer> ret
117 = std::make_unique<CommunicationBuffer>(usm_buf.
copy(), dev_sched);
125 inline u64 get_size() {
return usm_buf.
get_size(); }
128 return std::move(buf.usm_buf);
This file contains the declaration of the USMPtrHolder class.
std::uint8_t u8
8 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
void complete_event_state(sycl::event e) const
Complete the event state of the buffer.
T * get_write_access(sham::EventList &depends_list, SourceLocation src_loc=SourceLocation{})
Get a read-write pointer to the buffer's data.
DeviceBuffer< T, new_target > copy_to() const
Copy the content of the buffer to a new buffer with a different USM target.
size_t get_size() const
Gets the number of elements in the buffer.
DeviceBuffer< T, target > copy() const
Copy the current buffer.
Represents a SYCL device.
Class to manage a list of SYCL events.
void wait_and_throw()
Wait for all events in the list to be finished and throw an exception if one has occurred.
This header file contains utility functions related to exception handling in the code.
Namespace for internal details of the logs module.
namespace for communication related stuff
@ CopyToHost
copy data to the host and then perform the call
@ DirectGPU
copy data straight from the GPU