Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backends/aoti/slim/c10/core/Contiguity.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#pragma once

#include <executorch/backends/aoti/slim/c10/util/ArrayRef.h>
#include <executorch/backends/aoti/slim/c10/util/irange.h>
#include <executorch/runtime/core/array_ref.h>

#include <algorithm>
#include <cstdint>
#include <vector>

namespace executorch::backends::aoti::slim::c10 {

using ::executorch::runtime::ArrayRef;
using ::executorch::runtime::IntArrayRef;

template <typename T>
bool _compute_contiguous(ArrayRef<T> sizes, ArrayRef<T> strides, T numel) {
if (numel == 0) {
Expand Down
24 changes: 5 additions & 19 deletions backends/aoti/slim/c10/core/MemoryFormat.h
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
#pragma once

#include <executorch/backends/aoti/slim/c10/util/ArrayRef.h>
#include <executorch/runtime/core/array_ref.h>
#include <executorch/runtime/platform/assert.h>

#include <cstdint>
#include <ostream>
#include <vector>

// Memory format is not the property of a Tensor. It is the way to tell an
// operator how the result should be organized in memory and nothing more. That
// means memory format should never be used as return value for any tensor state
// interrogation functions (internally and externally).
//
// Possible options are:
// Preserve:
// If any of the input tensors is in channels_last format, operator output
// should be in channels_last format
//
// Contiguous:
// Regardless of input tensors format, the output should be contiguous
// Tensor.
//
// ChannelsLast:
// Regardless of input tensors format, the output should be in channels_last
// format.

namespace executorch::backends::aoti::slim::c10 {

using ::executorch::runtime::ArrayRef;
using ::executorch::runtime::IntArrayRef;

enum class MemoryFormat : int8_t {
Contiguous,
Preserve,
Expand Down
4 changes: 3 additions & 1 deletion backends/aoti/slim/c10/core/SizesAndStrides.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
#include <cstring>

#include <executorch/backends/aoti/slim/c10/macros/Macros.h>
#include <executorch/backends/aoti/slim/c10/util/ArrayRef.h>
#include <executorch/runtime/core/array_ref.h>
#include <executorch/runtime/platform/assert.h>

#define STANDALONE_SIZES_AND_STRIDES_MAX_INLINE_SIZE 5

namespace executorch::backends::aoti::slim::c10 {

using ::executorch::runtime::IntArrayRef;

// Packed container for TensorImpl sizes and strides.
// This design improves on the previous approach of using a pair of
// c10::SmallVector<int64_t, 5> by specializing for the operations we
Expand Down
1 change: 1 addition & 0 deletions backends/aoti/slim/c10/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def define_common_targets():
),
visibility = ["@EXECUTORCH_CLIENTS"],
exported_deps = [
"//executorch/runtime/core:core",
"//executorch/runtime/platform:platform",
],
)
Expand Down
Loading
Loading