Skip to content

Commit

Permalink
#0: Adding accessors to get num host channels, their size, and base a…
Browse files Browse the repository at this point in the history
…ddress to Cluster
  • Loading branch information
abhullar-tt committed Oct 25, 2023
1 parent 806e5ab commit 38baa95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tt_metal/llrt/tt_cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,18 @@ void Cluster::l1_barrier(chip_id_t chip_id) const {
this->device_->l1_membar(chip_id, "LARGE_WRITE_TLB");
}

uint32_t Cluster::get_num_host_channels(chip_id_t device_id) const {
return this->device_->get_num_host_channels(device_id);
}

uint32_t Cluster::get_host_channel_size(chip_id_t device_id, uint32_t channel) const {
return this->device_->get_host_channel_size(device_id, channel);
}

void *Cluster::host_dma_address(uint64_t offset, chip_id_t src_device_id, uint16_t channel) const {
return this->device_->host_dma_address(offset, src_device_id, channel);
}

} // namespace tt

std::ostream &operator<<(std::ostream &os, tt_target_dram const &dram) {
Expand Down
5 changes: 5 additions & 0 deletions tt_metal/llrt/tt_cluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ class Cluster {
void dram_barrier(chip_id_t chip_id) const;
void l1_barrier(chip_id_t chip_id) const;

uint32_t get_num_host_channels(chip_id_t device_id) const;
uint32_t get_host_channel_size(chip_id_t device_id, uint32_t channel) const;
// Returns address in host space
void *host_dma_address(uint64_t offset, chip_id_t src_device_id, uint16_t channel) const;

private:
Cluster();
~Cluster();
Expand Down

0 comments on commit 38baa95

Please sign in to comment.