-
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.
Simplify Cluster constructors (#277)
Work towards removing parameters from default Cluster constructor - Remove target devices - Remove cluster descriptor - Remove soc descriptor - Add constructor with only target devices
- Loading branch information
1 parent
c49cbfb
commit 852999c
Showing
16 changed files
with
322 additions
and
186 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* SPDX-FileCopyrightText: (c) 2024 Tenstorrent Inc. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <iostream> | ||
#include <string> | ||
|
||
namespace tt::umd::utils { | ||
|
||
std::string get_abs_path(std::string path) { | ||
// Note that __FILE__ might be resolved at compile time to an absolute or relative address, depending on the | ||
// compiler. | ||
std::filesystem::path current_file_path = std::filesystem::path(__FILE__); | ||
std::filesystem::path umd_root; | ||
if (current_file_path.is_absolute()) { | ||
umd_root = current_file_path.parent_path().parent_path(); | ||
} else { | ||
std::filesystem::path umd_root_relative = | ||
std::filesystem::relative(std::filesystem::path(__FILE__).parent_path().parent_path(), "../"); | ||
umd_root = std::filesystem::canonical(umd_root_relative); | ||
} | ||
std::filesystem::path abs_path = umd_root / path; | ||
return abs_path.string(); | ||
} | ||
|
||
} // namespace tt::umd::utils |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-FileCopyrightText: (c) 2023 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
|
||
#ifdef TT_DEBUG_LOGGING | ||
#define DEBUG_LOG(str) do { std::cout << str << std::endl; } while( false ) | ||
#else | ||
#define DEBUG_LOG(str) ((void)0) | ||
#endif | ||
|
||
#include "tt_device.h" | ||
#include "device/tt_cluster_descriptor_types.h" | ||
#include <iostream> | ||
#include <fstream> | ||
#include <string> | ||
#include <vector> | ||
#include <unordered_map> | ||
#include "yaml-cpp/yaml.h" | ||
|
||
//////// | ||
// Device base | ||
//////// | ||
tt_device::tt_device() : soc_descriptor_per_chip({}) { | ||
} | ||
|
||
tt_device::~tt_device() { | ||
} | ||
|
||
const tt_SocDescriptor& tt_device::get_soc_descriptor(chip_id_t chip_id) const { | ||
return soc_descriptor_per_chip.at(chip_id); | ||
} |
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
Oops, something went wrong.