|
15 | 15 |
|
16 | 16 | #include <ethosu_driver.h> |
17 | 17 |
|
18 | | -#include "executorch/backends/arm/runtime/VelaBinStream.h" |
19 | | -#include "executorch/runtime/backend/interface.h" |
20 | | -#include "executorch/runtime/core/error.h" |
21 | | -#include "executorch/runtime/core/evalue.h" |
22 | | -#include "executorch/runtime/core/exec_aten/util/scalar_type_util.h" |
| 18 | +#include <executorch/backends/arm/runtime/VelaBinStream.h> |
| 19 | +#include <executorch/runtime/backend/interface.h> |
| 20 | +#include <executorch/runtime/core/error.h> |
| 21 | +#include <executorch/runtime/core/evalue.h> |
| 22 | +#include <executorch/runtime/core/exec_aten/util/dim_order_util.h> |
| 23 | +#include <executorch/runtime/core/exec_aten/util/scalar_type_util.h> |
23 | 24 |
|
24 | 25 | using namespace std; |
25 | 26 |
|
26 | | -namespace torch { |
27 | | -namespace executor { |
| 27 | +using executorch::aten::ScalarType; |
| 28 | +using executorch::runtime::ArrayRef; |
| 29 | +using executorch::runtime::Backend; |
| 30 | +using executorch::runtime::BackendExecutionContext; |
| 31 | +using executorch::runtime::BackendInitContext; |
| 32 | +using executorch::runtime::CompileSpec; |
| 33 | +using executorch::runtime::DelegateHandle; |
| 34 | +using executorch::runtime::Error; |
| 35 | +using executorch::runtime::EValue; |
| 36 | +using executorch::runtime::FreeableBuffer; |
| 37 | +using executorch::runtime::MemoryAllocator; |
| 38 | +using executorch::runtime::Result; |
| 39 | + |
| 40 | +namespace executorch { |
| 41 | +namespace backends { |
| 42 | +namespace arm { |
28 | 43 |
|
29 | 44 | typedef struct { |
30 | 45 | FreeableBuffer* processed; |
@@ -141,7 +156,16 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface { |
141 | 156 | Error, |
142 | 157 | "Input %d expected Integer (4 byte) or Char (1 byte) integer inputs, got ScalarType id %s", |
143 | 158 | i, |
144 | | - toString(tensor_in.scalar_type())); |
| 159 | + executorch::runtime::toString(tensor_in.scalar_type())); |
| 160 | + return Error::InvalidProgram; |
| 161 | + } |
| 162 | + supported = executorch::runtime::is_contiguous_dim_order( |
| 163 | + tensor_in.dim_order().data(), tensor_in.dim()); |
| 164 | + if (!supported) { |
| 165 | + ET_LOG( |
| 166 | + Error, |
| 167 | + "Input %d expected contiguous dim_order, but got non-contiguous dim_order", |
| 168 | + i); |
145 | 169 | return Error::InvalidProgram; |
146 | 170 | } |
147 | 171 |
|
@@ -258,7 +282,7 @@ class ArmBackend final : public ::executorch::runtime::BackendInterface { |
258 | 282 | private: |
259 | 283 | Error check_requires_permute( |
260 | 284 | int index, |
261 | | - const exec_aten::Tensor tensor, |
| 285 | + const executorch::aten::Tensor tensor, |
262 | 286 | VelaIO* io, |
263 | 287 | bool permuted_io_flag, |
264 | 288 | bool* is_permuted) const { |
@@ -333,5 +357,6 @@ Backend backend_id{"ArmBackend", &backend}; |
333 | 357 | static auto registered = register_backend(backend_id); |
334 | 358 | } // namespace |
335 | 359 |
|
336 | | -} // namespace executor |
337 | | -} // namespace torch |
| 360 | +} // namespace arm |
| 361 | +} // namespace backends |
| 362 | +} // namespace executorch |
0 commit comments