Skip to content

Commit

Permalink
[executorch] Create target for named_data_map
Browse files Browse the repository at this point in the history
^

Differential Revision: [D68972364](https://our.internmc.facebook.com/intern/diff/D68972364/)

ghstack-source-id: 264108696
Pull Request resolved: #8110
  • Loading branch information
lucylq committed Jan 31, 2025
1 parent 6f67038 commit 8ebfff2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 15 additions & 1 deletion runtime/core/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def define_common_targets():
"defines.h",
"error.h",
"freeable_buffer.h",
"named_data_map.h",
"result.h",
"span.h",
],
Expand Down Expand Up @@ -118,6 +117,7 @@ def define_common_targets():
],
)


runtime.cxx_library(
name = "tag",
srcs = ["tag.cpp"],
Expand All @@ -133,6 +133,20 @@ def define_common_targets():
],
)

runtime.cxx_library(
name = "named_data_map",
exported_headers = [
"named_data_map.h",
],
visibility = [
"//executorch/...",
"@EXECUTORCH_CLIENTS",
],
exported_deps = [
":tensor_layout",
],
)

runtime.cxx_library(
name = "tensor_layout",
srcs = ["tensor_layout.cpp"],
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/tensor_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Result<size_t> calculate_nbytes(
}
} // namespace

Result<TensorLayout> TensorLayout::create(
Result<const TensorLayout> TensorLayout::create(
Span<const int32_t> sizes,
Span<const uint8_t> dim_order,
executorch::aten::ScalarType scalar_type) {
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/tensor_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ET_EXPERIMENTAL TensorLayout final {
* @param[in] scalar_type The scalar type of the tensor.
* @return A Result containing the TensorLayout on success, or an error.
*/
static executorch::runtime::Result<TensorLayout> create(
static executorch::runtime::Result<const TensorLayout> create(
Span<const int32_t> sizes,
Span<const uint8_t> dim_order,
executorch::aten::ScalarType scalar_type);
Expand Down

0 comments on commit 8ebfff2

Please sign in to comment.