-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved optional simple device into creation header, other nit fixes
- Loading branch information
1 parent
2426a8d
commit 796b656
Showing
5 changed files
with
88 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-FileCopyrightText: © 2024 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "ttnn/operations/creation.hpp" | ||
|
||
#include <optional> | ||
|
||
#include "ttnn/simple_device.hpp" | ||
|
||
namespace ttnn::operations::creation::detail { | ||
|
||
OptionalSimpleDevice::OptionalSimpleDevice(std::nullopt_t) {} | ||
OptionalSimpleDevice::OptionalSimpleDevice(ttnn::SimpleDevice device) : | ||
device_(std::make_optional<ttnn::SimpleDevice>(device)) {} | ||
|
||
// TODO: some of these won't be needed, as we unify the APIs. | ||
OptionalSimpleDevice::OptionalSimpleDevice(const std::optional<std::reference_wrapper<tt::tt_metal::Device>>& device) : | ||
device_(device.has_value() ? std::make_optional<SimpleDevice>(&device->get()) : std::nullopt) {} | ||
OptionalSimpleDevice::OptionalSimpleDevice( | ||
const std::optional<std::reference_wrapper<tt::tt_metal::distributed::MeshDevice>>& mesh_device) : | ||
device_(mesh_device.has_value() ? std::make_optional<SimpleDevice>(&mesh_device->get()) : std::nullopt) {} | ||
OptionalSimpleDevice::OptionalSimpleDevice(std::reference_wrapper<tt::tt_metal::Device> device) : | ||
device_(std::make_optional<SimpleDevice>(&device.get())) {} | ||
OptionalSimpleDevice::OptionalSimpleDevice(std::reference_wrapper<tt::tt_metal::distributed::MeshDevice> mesh_device) : | ||
device_(std::make_optional<SimpleDevice>(&mesh_device.get())) {} | ||
|
||
OptionalSimpleDevice::OptionalSimpleDevice(tt::tt_metal::Device& device) : | ||
device_(std::make_optional<SimpleDevice>(&device)) {} | ||
OptionalSimpleDevice::OptionalSimpleDevice(tt::tt_metal::distributed::MeshDevice& mesh_device) : | ||
device_(std::make_optional<SimpleDevice>(&mesh_device)) {} | ||
|
||
} // namespace ttnn::operations::creation::detail |
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