-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe09713
commit 3df8563
Showing
11 changed files
with
122 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
// SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#include <memory> | ||
#include <thread> | ||
// // SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
// // | ||
// // SPDX-License-Identifier: Apache-2.0 | ||
// #include <memory> | ||
// #include <thread> | ||
|
||
#include "gtest/gtest.h" | ||
#include "umd/device/blackhole_arc_message_queue.h" | ||
#include "umd/device/cluster.h" | ||
#include "umd/device/tt_cluster_descriptor.h" | ||
// #include "gtest/gtest.h" | ||
// #include "umd/device/blackhole_arc_message_queue.h" | ||
// #include "umd/device/cluster.h" | ||
// #include "umd/device/tt_cluster_descriptor.h" | ||
|
||
using namespace tt::umd; | ||
// using namespace tt::umd; | ||
|
||
inline std::unique_ptr<Cluster> get_cluster() { | ||
std::vector<int> pci_device_ids = PCIDevice::enumerate_devices(); | ||
// TODO: Make this test work on a host system without any tt devices. | ||
if (pci_device_ids.empty()) { | ||
return nullptr; | ||
} | ||
return std::unique_ptr<Cluster>(new Cluster()); | ||
} | ||
// inline std::unique_ptr<Cluster> get_cluster() { | ||
// std::vector<int> pci_device_ids = PCIDevice::enumerate_devices(); | ||
// // TODO: Make this test work on a host system without any tt devices. | ||
// if (pci_device_ids.empty()) { | ||
// return nullptr; | ||
// } | ||
// return std::unique_ptr<Cluster>(new Cluster()); | ||
// } | ||
|
||
TEST(BlackholeArcMessages, BlackholeArcMessagesBasic) { | ||
const uint32_t num_loops = 100; | ||
// TEST(BlackholeArcMessages, BlackholeArcMessagesBasic) { | ||
// const uint32_t num_loops = 100; | ||
|
||
std::unique_ptr<Cluster> cluster = get_cluster(); | ||
// std::unique_ptr<Cluster> cluster = get_cluster(); | ||
|
||
std::unique_ptr<BlackholeArcMessageQueue> blackhole_arc_msg_queue = | ||
BlackholeArcMessageQueue::get_blackhole_arc_message_queue( | ||
cluster.get(), 0, BlackholeArcMessageQueueIndex::APPLICATION); | ||
// std::unique_ptr<BlackholeArcMessageQueue> blackhole_arc_msg_queue = | ||
// BlackholeArcMessageQueue::get_blackhole_arc_message_queue( | ||
// cluster.get(), 0, BlackholeArcMessageQueueIndex::APPLICATION); | ||
|
||
for (int i = 0; i < num_loops; i++) { | ||
uint32_t response = blackhole_arc_msg_queue->send_message(ArcMessageType::TEST); | ||
ASSERT_EQ(response, 0); | ||
} | ||
} | ||
// for (int i = 0; i < num_loops; i++) { | ||
// uint32_t response = blackhole_arc_msg_queue->send_message(ArcMessageType::TEST); | ||
// ASSERT_EQ(response, 0); | ||
// } | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-FileCopyrightText: (c) 2025 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#include "gtest/gtest.h" | ||
#include "umd/device/tt_device/tt_device.h" | ||
|
||
using namespace tt::umd; | ||
|
||
TEST(BlackholeChipInfo, BasicChipInfo) { | ||
std::vector<int> pci_device_ids = PCIDevice::enumerate_devices(); | ||
|
||
for (int pci_device_id : pci_device_ids) { | ||
std::unique_ptr<TTDevice> tt_device = TTDevice::create(pci_device_id); | ||
|
||
const ChipInfo chip_info = tt_device->get_chip_info(); | ||
|
||
EXPECT_TRUE(chip_info.board_type == BoardType::P100 || chip_info.board_type == BoardType::P150A); | ||
|
||
EXPECT_TRUE(chip_info.chip_uid.asic_location == 0 || chip_info.chip_uid.asic_location == 1); | ||
} | ||
} |