-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
1f6829b
commit 571ba98
Showing
3 changed files
with
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-FileCopyrightText: © 2024 Tenstorrent Inc. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "tt_metal/impl/kernels/runtime_args_data.hpp" // Public API Header | ||
|
||
#include "tt_metal/common/assert.hpp" | ||
|
||
namespace tt::tt_metal { | ||
|
||
std::uint32_t & RuntimeArgsData::operator[](std::size_t index) { | ||
TT_ASSERT(index < rt_args_count, "Index specified is larger than runtime args size"); | ||
return this->rt_args_data[index]; | ||
} | ||
|
||
const std::uint32_t & RuntimeArgsData::operator[](std::size_t index) const { | ||
TT_ASSERT(index < rt_args_count, "Index specified is larger than runtime args size"); | ||
return this->rt_args_data[index]; | ||
} | ||
|
||
std::uint32_t & RuntimeArgsData::at(std::size_t index) { | ||
TT_FATAL(index < rt_args_count, "Index specified is larger than runtime args size"); | ||
return this->rt_args_data[index]; | ||
} | ||
|
||
const std::uint32_t & RuntimeArgsData::at(std::size_t index) const { | ||
TT_FATAL(index < rt_args_count, "Index specified is larger than runtime args size"); | ||
return this->rt_args_data[index]; | ||
} | ||
|
||
std::uint32_t * RuntimeArgsData::data() noexcept { | ||
return rt_args_data; | ||
} | ||
|
||
const std::uint32_t * RuntimeArgsData::data() const noexcept { | ||
return rt_args_data; | ||
} | ||
|
||
std::size_t RuntimeArgsData::size() const noexcept { | ||
return rt_args_count; | ||
} | ||
|
||
} | ||
|
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