ROCm SMI LIB: Add rsmi_is_P2P_accessible() API
Implements rsmi_is_p2p_accessible API. The function returns True if P2P is possible between two nodes. Signed-off-by: Ori Messinger <Ori.Messinger@amd.com> Change-Id: Ic7316eebcec4480175c7ad04c21a42b2e1a4c454
Este cometimento está contido em:
@@ -3389,6 +3389,30 @@ rsmi_status_t
|
||||
rsmi_topo_get_link_type(uint32_t dv_ind_src, uint32_t dv_ind_dst,
|
||||
uint64_t *hops, RSMI_IO_LINK_TYPE *type);
|
||||
|
||||
/**
|
||||
* @brief Return P2P availability status between 2 GPUs
|
||||
*
|
||||
* @details Given a source device index @p dv_ind_src and
|
||||
* a destination device index @p dv_ind_dst, and a pointer to a
|
||||
* bool @accessible, this function will write the P2P connection status
|
||||
* between the device @p dv_ind_src and @p dv_ind_dst to the memory
|
||||
* pointed to by @p accessible.
|
||||
*
|
||||
* @param[in] dv_ind_src the source device index
|
||||
*
|
||||
* @param[in] dv_ind_dst the destination device index
|
||||
*
|
||||
* @param[inout] accessible A pointer to a bool to which the status for
|
||||
* the P2P connection availablity should be written.
|
||||
*
|
||||
* @retval ::RSMI_STATUS_SUCCESS call was successful
|
||||
* @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
|
||||
*
|
||||
*/
|
||||
rsmi_status_t
|
||||
rsmi_is_P2P_accessible(uint32_t dv_ind_src, uint32_t dv_ind_dst,
|
||||
bool *accessible);
|
||||
|
||||
/** @} */ // end of HWTopo
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -77,10 +77,15 @@ typedef enum _IO_LINK_TYPE {
|
||||
IOLINK_TYPE_SIZE = 0xFFFFFFFF
|
||||
} IO_LINK_TYPE;
|
||||
|
||||
typedef enum _LINK_DIRECTORY_TYPE {
|
||||
IO_LINK_DIRECTORY = 0,
|
||||
P2P_LINK_DIRECTORY = 1
|
||||
} LINK_DIRECTORY_TYPE;
|
||||
|
||||
class IOLink {
|
||||
public:
|
||||
explicit IOLink(uint32_t node_indx, uint32_t link_indx) :
|
||||
node_indx_(node_indx), link_indx_(link_indx) {}
|
||||
explicit IOLink(uint32_t node_indx, uint32_t link_indx, LINK_DIRECTORY_TYPE link_dir_type) :
|
||||
node_indx_(node_indx), link_indx_(link_indx), link_dir_type_(link_dir_type) {}
|
||||
~IOLink();
|
||||
|
||||
int Initialize();
|
||||
@@ -92,6 +97,7 @@ class IOLink {
|
||||
uint32_t node_from(void) const {return node_from_;}
|
||||
uint32_t node_to(void) const {return node_to_;}
|
||||
uint64_t weight(void) const {return weight_;}
|
||||
LINK_DIRECTORY_TYPE get_directory_type(void) const {return link_dir_type_;}
|
||||
|
||||
private:
|
||||
uint32_t node_indx_;
|
||||
@@ -101,16 +107,25 @@ class IOLink {
|
||||
uint32_t node_to_;
|
||||
uint64_t weight_;
|
||||
std::map<std::string, uint64_t> properties_;
|
||||
LINK_DIRECTORY_TYPE link_dir_type_;
|
||||
};
|
||||
|
||||
int
|
||||
DiscoverIOLinksPerNode(uint32_t node_indx, std::map<uint32_t,
|
||||
std::shared_ptr<IOLink>> *links);
|
||||
|
||||
int
|
||||
DiscoverP2PLinksPerNode(uint32_t node_indx, std::map<uint32_t,
|
||||
std::shared_ptr<IOLink>> *links);
|
||||
|
||||
int
|
||||
DiscoverIOLinks(std::map<std::pair<uint32_t, uint32_t>,
|
||||
std::shared_ptr<IOLink>> *links);
|
||||
|
||||
int
|
||||
DiscoverP2PLinks(std::map<std::pair<uint32_t, uint32_t>,
|
||||
std::shared_ptr<IOLink>> *links);
|
||||
|
||||
} // namespace smi
|
||||
} // namespace amd
|
||||
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador