Struct GpuInfo
Defined in File gpu_info.hpp
Struct Documentation
-
struct
ripple
::
GpuInfo
The GpuInfo struct stores information about the gpu.
Public Types
-
using
PeerContainer
= std::vector<Index> Type of container used to store peer access indices.
-
using
StreamContainer
= std::array<Stream, total_streams> Type of container for streams for the device.
Public Functions
-
GpuInfo
(Index idx) noexcept Constructor to initialise the info with a specific index.
- Parameters
idx
: The index of the gpu for the info.
-
auto
is_invalid
() const noexcept -> bool Determines if the info is invalid.
- Return
true if the index matches the invalid index.
-
auto
peer_to_peer_available
() const noexcept -> bool Determines if the gpu has any peer to peer access with another device.
- Return
true if the gpu can directly access any other gpu’s memory.
-
auto
peer_to_peer_available
(Index other_id) const noexcept -> bool R Determines if this gpu can directly access the memory of the gpu with the given index.
- Return
true if this gpu can directly access the other gpu’s memory.
- Parameters
other_id
: The index of the other gpu to check peer access with.
-
auto
next_compute_stream_id
() noexcept -> Id Gets the id of the next compute stream for the device.
- Return
The id of the next compute stream for the device.
-
auto
next_transfer_stream_id
() noexcept -> Id Gets the id of the next transfer stream for the device.
- Return
The id of the next transfer stream for the device.
-
auto
prepare_barrier
() noexcept -> void Prepares he barrier for asynchronous execution, setting that the barrier is up and should be waited on.
This will then be set as down once the barrier is executed.
Public Members
-
StreamContainer
streams
= {} Streams for the device.
-
PeerContainer
peers
= {} Default to no peers.
-
Id
compute_id
= 0 Id of the current compute stream.
-
Id
transfer_id
= 0 Id of the next transfer stream.
Public Static Functions
-
auto
create_for_all_devices
() -> std::vector<GpuInfo> Creates the information for all gpus in the system.
- Return
A vector of information for all the system gpus.
Public Static Attributes
-
constexpr size_t
total_streams
= compute_streams + transfer_streams The total number of streams for the gpu.
-
constexpr Index
invalid
= 0xFFFFFFFF Value for invalid processor information.
-
constexpr size_t
padding_size
= avoid_false_sharing_size - ((sizeof(PeerContainer) + sizeof(Index) + sizeof(uint64_t) + sizeof(uint64_t) + sizeof(uint8_t) + sizeof(uint8_t) + sizeof(bool) + sizeof(StreamContainer)) % avoid_false_sharing_size) The amount of padding to avoid false sharing.
-
using