Skip to content

Commit 8ebfff2

Browse files
committed
[executorch] Create target for named_data_map
^ Differential Revision: [D68972364](https://our.internmc.facebook.com/intern/diff/D68972364/) ghstack-source-id: 264108696 Pull Request resolved: #8110
1 parent 6f67038 commit 8ebfff2

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

runtime/core/targets.bzl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def define_common_targets():
4141
"defines.h",
4242
"error.h",
4343
"freeable_buffer.h",
44-
"named_data_map.h",
4544
"result.h",
4645
"span.h",
4746
],
@@ -118,6 +117,7 @@ def define_common_targets():
118117
],
119118
)
120119

120+
121121
runtime.cxx_library(
122122
name = "tag",
123123
srcs = ["tag.cpp"],
@@ -133,6 +133,20 @@ def define_common_targets():
133133
],
134134
)
135135

136+
runtime.cxx_library(
137+
name = "named_data_map",
138+
exported_headers = [
139+
"named_data_map.h",
140+
],
141+
visibility = [
142+
"//executorch/...",
143+
"@EXECUTORCH_CLIENTS",
144+
],
145+
exported_deps = [
146+
":tensor_layout",
147+
],
148+
)
149+
136150
runtime.cxx_library(
137151
name = "tensor_layout",
138152
srcs = ["tensor_layout.cpp"],

runtime/core/tensor_layout.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Result<size_t> calculate_nbytes(
3030
}
3131
} // namespace
3232

33-
Result<TensorLayout> TensorLayout::create(
33+
Result<const TensorLayout> TensorLayout::create(
3434
Span<const int32_t> sizes,
3535
Span<const uint8_t> dim_order,
3636
executorch::aten::ScalarType scalar_type) {

runtime/core/tensor_layout.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ET_EXPERIMENTAL TensorLayout final {
3333
* @param[in] scalar_type The scalar type of the tensor.
3434
* @return A Result containing the TensorLayout on success, or an error.
3535
*/
36-
static executorch::runtime::Result<TensorLayout> create(
36+
static executorch::runtime::Result<const TensorLayout> create(
3737
Span<const int32_t> sizes,
3838
Span<const uint8_t> dim_order,
3939
executorch::aten::ScalarType scalar_type);

0 commit comments

Comments
 (0)