Skip to content

Commit

Permalink
Rename device to cluster in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanevskiTT committed Dec 16, 2024
1 parent 1e214f4 commit f4da414
Show file tree
Hide file tree
Showing 11 changed files with 417 additions and 417 deletions.
2 changes: 1 addition & 1 deletion tests/blackhole/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(UNIT_TESTS_BH_SRCS test_silicon_driver_bh.cpp)
set(UNIT_TESTS_BH_SRCS test_cluster_bh.cpp)

add_executable(unit_tests_blackhole ${UNIT_TESTS_BH_SRCS})
target_link_libraries(unit_tests_blackhole PRIVATE test_common)
Expand Down
22 changes: 11 additions & 11 deletions tests/blackhole/test_bh_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ using namespace tt::umd;

namespace tt::umd::test::utils {

static void set_params_for_remote_txn(Cluster& device) {
static void set_params_for_remote_txn(Cluster& cluster) {
// Populate address map and NOC parameters that the driver needs for remote transactions
device.set_device_l1_address_params(
cluster.set_device_l1_address_params(
{l1_mem::address_map::L1_BARRIER_BASE,
eth_l1_mem::address_map::ERISC_BARRIER_BASE,
eth_l1_mem::address_map::FW_VERSION_ADDR});
Expand All @@ -26,7 +26,7 @@ class BlackholeTestFixture : public ::testing::Test {
// You can remove any or all of the following functions if their bodies would
// be empty.

std::unique_ptr<Cluster> device;
std::unique_ptr<Cluster> cluster;

BlackholeTestFixture() {}

Expand Down Expand Up @@ -54,18 +54,18 @@ class BlackholeTestFixture : public ::testing::Test {
std::iota(devices.begin(), devices.end(), 0);
std::set<chip_id_t> target_devices = {devices.begin(), devices.end()};
uint32_t num_host_mem_ch_per_mmio_device = 1;
device = std::make_unique<Cluster>(num_host_mem_ch_per_mmio_device, false, true, true);
assert(device != nullptr);
assert(device->get_cluster_description()->get_number_of_chips() == get_detected_num_chips());
cluster = std::make_unique<Cluster>(num_host_mem_ch_per_mmio_device, false, true, true);
assert(cluster != nullptr);
assert(cluster->get_cluster_description()->get_number_of_chips() == get_detected_num_chips());

set_params_for_remote_txn(*device);
set_params_for_remote_txn(*cluster);

tt_device_params default_params;
device->start_device(default_params);
cluster->start_device(default_params);

device->deassert_risc_reset();
cluster->deassert_risc_reset();

device->wait_for_non_mmio_flush();
cluster->wait_for_non_mmio_flush();
}

void TearDown() override {
Expand All @@ -74,7 +74,7 @@ class BlackholeTestFixture : public ::testing::Test {

if (!is_test_skipped()) {
// std::cout << "Tearing Down Test." << std::endl;
device->close_device();
cluster->close_device();
}
}
};
Expand Down

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions tests/galaxy/test_umd_remote_api_stability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ uint32_t WormholeGalaxyStabilityTestFixture::scale_number_of_tests = 1;
TEST_F(WormholeGalaxyStabilityTestFixture, MixedRemoteTransfers) {
int seed = 0;

assert(device != nullptr);
assert(cluster != nullptr);
log_info(LogSiliconDriver, "Started MixedRemoteTransfers");
std::vector<remote_transfer_sample_t> command_history;
try {
RunMixedTransfersUniformDistributions(
*this->device,
*this->cluster,
100000 * scale_number_of_tests,
seed,
transfer_type_weights_t{.write = 0.40, .read = 0.4},
Expand All @@ -87,10 +87,10 @@ TEST_F(WormholeGalaxyStabilityTestFixture, DISABLED_MultithreadedMixedRemoteTran

log_info(LogSiliconDriver, "Started MultithreadedMixedRemoteTransfersMediumSmall");

assert(device != nullptr);
assert(cluster != nullptr);
std::thread t1([&]() {
RunMixedTransfersUniformDistributions(
*device,
*cluster,
50000 * scale_number_of_tests,
0,
transfer_type_weights_t{.write = 0.50, .read = 0.50},
Expand All @@ -110,7 +110,7 @@ TEST_F(WormholeGalaxyStabilityTestFixture, DISABLED_MultithreadedMixedRemoteTran
});
std::thread t2([&]() {
RunMixedTransfersUniformDistributions(
*device,
*cluster,
50000 * scale_number_of_tests,
100,
transfer_type_weights_t{.write = 0.25, .read = 0.50},
Expand All @@ -130,7 +130,7 @@ TEST_F(WormholeGalaxyStabilityTestFixture, DISABLED_MultithreadedMixedRemoteTran
});
std::thread t3([&]() {
RunMixedTransfersUniformDistributions(
*device,
*cluster,
50000 * scale_number_of_tests,
23,
transfer_type_weights_t{.write = 0.5, .read = 0.25},
Expand All @@ -150,7 +150,7 @@ TEST_F(WormholeGalaxyStabilityTestFixture, DISABLED_MultithreadedMixedRemoteTran
});
std::thread t4([&]() {
RunMixedTransfersUniformDistributions(
*device,
*cluster,
100000 * scale_number_of_tests,
99,
transfer_type_weights_t{.write = 0.1, .read = 0.1},
Expand Down
2 changes: 1 addition & 1 deletion tests/grayskull/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(UNIT_TESTS_GS_SRCS test_silicon_driver.cpp)
set(UNIT_TESTS_GS_SRCS test_cluster_gs.cpp)

add_executable(unit_tests_grayskull ${UNIT_TESTS_GS_SRCS})
target_link_libraries(unit_tests_grayskull PRIVATE test_common)
Expand Down
Loading

0 comments on commit f4da414

Please sign in to comment.