Skip to content

Commit

Permalink
Move tensorflow/lite/experimental/lrt to tensorflow/lite/experimental…
Browse files Browse the repository at this point in the history
…/litert

PiperOrigin-RevId: 689239882
  • Loading branch information
tensorflower-gardener committed Oct 24, 2024
1 parent 2519c13 commit 1ab2aac
Show file tree
Hide file tree
Showing 199 changed files with 1,208 additions and 1,186 deletions.
3 changes: 1 addition & 2 deletions tensorflow/compiler/mlir/lite/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ package_group(
"//third_party/iree/...",
"//third_party/odml/infra/...",
"//tensorflow/compiler/mlir/...",
"//tensorflow/lite/experimental/lrt/...",
"//tensorflow/lite/python/...",
"//tensorflow/lite/...",
"//waymo/accelerator/alpine/tools/...",
"//waymo/ml/compiler/mlir/...",
# Allow visibility from the mlir language server.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = ["//tensorflow/lite/experimental/lrt:__subpackages__"],
default_visibility = ["//tensorflow/lite/experimental/litert:__subpackages__"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = ["//tensorflow/lite/experimental/lrt:__subpackages__"],
default_visibility = ["//tensorflow/lite/experimental/litert:__subpackages__"],
)

exports_files(srcs = ["export_litert_only.lds"])
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ _SYS_ELF_INTERPRETER_LINKOPT_X86_64 = make_linkopt("--dynamic-linker={}".format(
####################################################################################################
# Symbol Hiding

_EXPORT_LRT_ONLY_SCRIPT = "//tensorflow/lite/experimental/lrt/build_common:export_litert_only.lds"
_EXPORT_LRT_ONLY_SCRIPT = "//tensorflow/lite/experimental/litert/build_common:export_litert_only.lds"
_EXPORT_LRT_ONLY_LINKOPT = _make_script_linkopt(_EXPORT_LRT_ONLY_SCRIPT)

####################################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package(
# copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
default_visibility = ["//tensorflow/lite/experimental/lrt:__subpackages__"],
default_visibility = ["//tensorflow/lite/experimental/litert:__subpackages__"],
)

cc_library(
Expand Down Expand Up @@ -74,7 +74,7 @@ cc_library(
deps = [
":litert_c_api",
":litert_logging",
"//tensorflow/lite/experimental/lrt/core:tensor_buffer",
"//tensorflow/lite/experimental/litert/core:tensor_buffer",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/types:span",
Expand All @@ -93,7 +93,7 @@ cc_test(
deps = [
":litert_c_api",
":litert_tensor_buffer",
"//tensorflow/lite/experimental/lrt/core:tensor_buffer",
"//tensorflow/lite/experimental/litert/core:tensor_buffer",
"@com_google_googletest//:gtest_main",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_COMMON_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_COMMON_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_COMMON_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_COMMON_H_

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -83,4 +83,4 @@ typedef enum {
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_COMMON_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_COMMON_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_DISPATCH_DELEGATE_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_DISPATCH_DELEGATE_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_DISPATCH_DELEGATE_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_DISPATCH_DELEGATE_H_

#include <cstddef>

Expand Down Expand Up @@ -79,4 +79,4 @@ tflite::TfLiteOpaqueDelegateUniquePtr DispatchDelegateCreatePtr(
} // namespace litert
#endif

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_DISPATCH_DELEGATE_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_DISPATCH_DELEGATE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow/lite/experimental/lrt/c/litert_event.h"
#include "tensorflow/lite/experimental/litert/c/litert_event.h"

#include <fcntl.h>
#include <poll.h>
#include <unistd.h>

#include <cerrno>
#include <cstddef>
#include <cstdint>
#include <cstring>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/core/event.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/core/event.h"

#if LITERT_HAS_SYNC_FENCE_SUPPORT
LiteRtStatus LiteRtEventCreateFromSyncFenceFd(int sync_fence_fd, bool owns_fd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_EVENT_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_EVENT_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_EVENT_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_EVENT_H_

#include <stdint.h>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -41,4 +41,4 @@ void LiteRtEventDestroy(LiteRtEvent event);
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_EVENT_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_EVENT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow/lite/experimental/lrt/c/litert_logging.h"
#include "tensorflow/lite/experimental/litert/c/litert_logging.h"

#include <cstdarg>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/logger.h"
#include "tensorflow/lite/minimal_logging.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_LOGGING_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_LOGGING_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_LOGGING_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_LOGGING_H_

#include <stdarg.h>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -84,4 +84,4 @@ LiteRtStatus LiteRtDefaultLoggerLog(LiteRtLogSeverity severity,
#define LITERT_LOG(severity, format, ...) \
LITERT_LOGGER_LOG(LiteRtGetDefaultLogger(), severity, format, ##__VA_ARGS__);

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_LOGGING_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_LOGGING_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow/lite/experimental/lrt/c/litert_logging.h"
#include "tensorflow/lite/experimental/litert/c/litert_logging.h"

#include <gtest/gtest.h> // NOLINT: Need when ANDROID_API_LEVEL >= 26
#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"

TEST(Layout, Creation) {
LiteRtLogger logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_MODEL_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_MODEL_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_MODEL_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_MODEL_H_

#include <stddef.h>
#include <stdint.h>

#include "tensorflow/lite/core/c/c_api_types.h"
#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/c/litert_op_code.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_op_code.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -194,4 +194,4 @@ LiteRtStatus PushOp(LiteRtOpList op_list, LiteRtOp op);
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_MODEL_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_MODEL_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_OP_CODE_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_OP_CODE_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_OP_CODE_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_OP_CODE_H_

#include "tensorflow/lite/builtin_ops.h"

Expand Down Expand Up @@ -242,4 +242,4 @@ typedef enum {
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_OP_CODE_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_OP_CODE_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_OPTIONS_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_OPTIONS_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_OPTIONS_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_OPTIONS_H_

#include <cstdint>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -160,4 +160,4 @@ LiteRtStatus LiteRtReshapeGetNewShapeOption(LiteRtOp op, int32_t** new_shape,
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_OPTIONS_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_OPTIONS_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_SUPPORT_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_SUPPORT_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_SUPPORT_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_SUPPORT_H_

#include <alloca.h>
#include <stdio.h>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h" // IWYU pragma: keep
#include "tensorflow/lite/experimental/litert/c/litert_common.h" // IWYU pragma: keep

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -60,4 +60,4 @@ extern "C" {
} // extern "C"
#endif

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_SUPPORT_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_SUPPORT_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow/lite/experimental/lrt/c/litert_tensor_buffer.h"
#include "tensorflow/lite/experimental/litert/c/litert_tensor_buffer.h"

#include <cstddef>
#include <cstdint>

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/types/span.h"
#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/c/litert_event.h"
#include "tensorflow/lite/experimental/lrt/c/litert_logging.h"
#include "tensorflow/lite/experimental/lrt/c/litert_model.h"
#include "tensorflow/lite/experimental/lrt/core/tensor_buffer.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_event.h"
#include "tensorflow/lite/experimental/litert/c/litert_logging.h"
#include "tensorflow/lite/experimental/litert/c/litert_model.h"
#include "tensorflow/lite/experimental/litert/core/tensor_buffer.h"

LiteRtStatus LiteRtCreateTensorBufferFromHostMemory(
const LiteRtRankedTensorType* tensor_type, void* host_buffer_addr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_TENSOR_BUFFER_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_TENSOR_BUFFER_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_TENSOR_BUFFER_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_TENSOR_BUFFER_H_

#include <memory.h>
#include <stddef.h>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/c/litert_event.h"
#include "tensorflow/lite/experimental/lrt/c/litert_model.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_event.h"
#include "tensorflow/lite/experimental/litert/c/litert_model.h"

#if LITERT_HAS_AHWB_SUPPORT
#include <android/hardware_buffer.h>
Expand Down Expand Up @@ -179,4 +179,4 @@ void LiteRtDestroyTensorBuffer(LiteRtTensorBuffer buffer);
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_TENSOR_BUFFER_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_TENSOR_BUFFER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow/lite/experimental/lrt/c/litert_tensor_buffer_requirements.h"
#include "tensorflow/lite/experimental/litert/c/litert_tensor_buffer_requirements.h"

#include <cstddef>
#include <vector>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/c/litert_tensor_buffer.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_tensor_buffer.h"

class LiteRtTensorBufferRequirementsT {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_TENSOR_BUFFER_REQUIREMENTS_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_TENSOR_BUFFER_REQUIREMENTS_H_
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_TENSOR_BUFFER_REQUIREMENTS_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_TENSOR_BUFFER_REQUIREMENTS_H_

#include <cstddef>

#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/c/litert_tensor_buffer.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_tensor_buffer.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -48,4 +48,4 @@ void LiteRtDestroyTensorBufferRequirements(
}
#endif // __cplusplus

#endif // TENSORFLOW_LITE_EXPERIMENTAL_LRT_C_LITERT_TENSOR_BUFFER_REQUIREMENTS_H_
#endif // TENSORFLOW_LITE_EXPERIMENTAL_LITERT_C_LITERT_TENSOR_BUFFER_REQUIREMENTS_H_
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "tensorflow/lite/experimental/litert/c/litert_tensor_buffer_requirements.h"

#include <cstring>

#include <gtest/gtest.h> // NOLINT: Need when ANDROID_API_LEVEL >= 26
#include "tensorflow/lite/experimental/lrt/c/litert_common.h"
#include "tensorflow/lite/experimental/lrt/c/litert_tensor_buffer.h"
#include "tensorflow/lite/experimental/lrt/c/litert_tensor_buffer_requirements.h"
#include "tensorflow/lite/experimental/litert/c/litert_common.h"
#include "tensorflow/lite/experimental/litert/c/litert_tensor_buffer.h"

namespace {

Expand Down
Loading

0 comments on commit 1ab2aac

Please sign in to comment.