Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
third_party/onnxruntime/lib/** filter=lfs diff=lfs merge=lfs -text
18 changes: 0 additions & 18 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,3 @@ http_archive(
strip_prefix = "OpenCL-Headers-2023.04.17",
url = "https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v2023.04.17.tar.gz",
)

new_git_repository(
name = "onnx_runtime",
build_file = "//third_party:onnxruntime.BUILD",
# branch= "rel-1.20.1",
commit = "5c1b7ccbff7e5141c1da7a9d963d660e5741c319",
patches = ["//third_party/patch:onnx.patch"],
recursive_init_submodules = True,
remote = "https://github.com/microsoft/onnxruntime",
)

new_git_repository(
name = "onnx_runtime_extensions",
build_file = "//third_party:onnxruntime_extensions.BUILD",
commit = "81e7799c69044c745239202085eb0a98f102937b",
patches = ["//third_party/patch:onnx_ext.patch"],
remote = "https://github.com/microsoft/onnxruntime-extensions",
)
4 changes: 3 additions & 1 deletion kernels/onnxRT/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ cc_library(
],
deps = [
"//:corevx",
"@onnx_runtime//:onnxruntime_lib",
"//third_party:onnxruntime",
],
linkstatic = True,
alwayslink = True,
visibility = ["//visibility:public"]
)
2 changes: 1 addition & 1 deletion kernels/onnxRT/ort_runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <string>
#include <vector>

#include <core/session/onnxruntime_cxx_api.h>
#include <VX/vx.h>
#include <onnxruntime_cxx_api.h>

/**
* @brief Onnx Runtime Model Runner Object
Expand Down
15 changes: 8 additions & 7 deletions targets/onnxRT/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

cc_library(
name = "onnxRT",
srcs = glob([
Expand All @@ -15,19 +14,21 @@ cc_library(
"//:corevx",
"//kernels/onnxRT:ort_kernels",
],
linkstatic = True,
alwayslink = True,
visibility = ["//visibility:public"]
)

cc_shared_library(
name = "openvx-onnxRT",
deps = [
name="openvx-onnxRT",
deps=[
":onnxRT",
],
visibility = ["//visibility:public"]
visibility=["//visibility:public"]
)

cc_import(
name = "imported_openvx_onnxRT",
shared_library = ":openvx-onnxRT",
visibility = ["//visibility:public"]
name="imported_openvx_onnxRT",
shared_library=":openvx-onnxRT",
visibility=["//visibility:public"]
)
4 changes: 4 additions & 0 deletions tests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ cc_binary(
],
deps = [
"//:corevx",
"//targets/ai_server:imported_openvx_ai_server",
"//targets/c_model:imported_openvx_c_model",
"//targets/debug:imported_openvx_debug",
"//targets/extras:imported_openvx_extras",
"//targets/liteRT:imported_openvx_liteRT",
"//targets/opencl:imported_openvx_opencl",
"//targets/onnxRT:imported_openvx_onnxRT",
"//targets/executorch:imported_openvx_torch",
"//tests/xyz:imported_xyz",
],
linkopts = select({
Expand Down
48 changes: 24 additions & 24 deletions tests/integration_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ cc_test(
size = "small"
)

# cc_test(
# name = "test_ort",
# srcs = [
# "test_ort.cpp"
# ],
# deps = [
# "//:corevx",
# "@googletest//:gtest_main",
# "//targets/c_model:imported_openvx_c_model",
# "//targets/debug:imported_openvx_debug",
# "//targets/extras:imported_openvx_extras",
# "//targets/opencl:imported_openvx_opencl",
# "//targets/onnxRT:imported_openvx_onnxRT",
# ],
# linkopts = select({
# "@platforms//os:linux": ["-Wl,-rpath,$ORIGIN"],
# "@platforms//os:macos": ["-Wl,-rpath,@executable_path"],
# "//conditions:default": [],
# }),
# data = [
# "//tests/raw:models",
# ],
# size = "small"
# )
cc_test(
name="test_ort",
srcs=[
"test_ort.cpp"
],
deps=[
"//:corevx",
"@googletest//:gtest_main",
"//targets/c_model:imported_openvx_c_model",
"//targets/debug:imported_openvx_debug",
"//targets/extras:imported_openvx_extras",
"//targets/opencl:imported_openvx_opencl",
"//targets/onnxRT:imported_openvx_onnxRT",
],
linkopts=select({
"@platforms//os:linux": ["-Wl,-rpath,$ORIGIN"],
"@platforms//os:macos": ["-Wl,-rpath,@executable_path"],
"//conditions:default": [],
}),
data=[
"//tests/raw:models",
],
size="small"
)

cc_test(
name = "test_tflite",
Expand Down
29 changes: 29 additions & 0 deletions third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@
BUILD file for build defs for third party deps
"""

# ONNX Runtime
cc_import(
name="onnxruntime-providers",
shared_library=select({
"@platforms//os:linux": "onnxruntime/lib/libonnxruntime_providers_shared.so",
"//conditions:default": None,
}),
visibility=["//visibility:public"],
)

cc_import(
name="onnxruntime-prebuilt",
shared_library=select({
"@platforms//os:macos": "onnxruntime/lib/libonnxruntime.1.22.0.dylib",
"@platforms//os:linux": "onnxruntime/lib/libonnxruntime.so.1",
"//conditions:default": None,
}),
deps=[":onnxruntime-providers"],
visibility=["//visibility:public"],
)

cc_library(
name="onnxruntime",
hdrs=glob(["onnxruntime/include/**/*.h"]),
includes=["onnxruntime/include"],
deps=[":onnxruntime-prebuilt"],
visibility=["//visibility:public"],
)

# TensorFlow Lite
cc_import(
name = "tflite",
Expand Down
Loading