-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP]EP interface #18090
base: main
Are you sure you want to change the base?
[WIP]EP interface #18090
Changes from 13 commits
cdb9676
2ddea77
5fffc82
ff689b1
6c92fc7
4794e3d
0d4d3d3
858f259
dbb9871
a732a85
251a58b
e247fd8
021405f
e433f5d
4819293
a2c247a
9b0f3b1
95e1fe6
74c457d
4168d03
3586734
e440c88
60161f2
572d5f3
8d0c804
48dcc85
7defe5d
c04c1f2
839103a
1b1c069
5396642
539d679
5d450cb
f8d6a70
970a3f2
33a60f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
add_compile_definitions(USE_INTREE=1) | ||
|
||
file(GLOB_RECURSE onnxruntime_providers_intree_cc_srcs CONFIGURE_DEPENDS | ||
"${ONNXRUNTIME_INCLUDE_DIR}/core/providers/intree/*.h" | ||
"${ONNXRUNTIME_ROOT}/core/providers/intree/*.h" | ||
"${ONNXRUNTIME_ROOT}/core/providers/intree/*.cc" | ||
) | ||
|
||
source_group(TREE ${REPO_ROOT} FILES ${onnxruntime_providers_intree_cc_srcs}) | ||
onnxruntime_add_static_library(onnxruntime_providers_intree ${onnxruntime_providers_intree_cc_srcs}) | ||
onnxruntime_add_include_to_target(onnxruntime_providers_intree | ||
onnxruntime_common onnxruntime_framework onnx pthreadpool Boost::mp11 safeint_interface | ||
) | ||
|
||
add_dependencies(onnxruntime_providers_intree onnx ${onnxruntime_EXTERNAL_DEPENDENCIES}) | ||
set_target_properties(onnxruntime_providers_intree PROPERTIES FOLDER "ONNXRuntime") | ||
|
||
set_target_properties(onnxruntime_providers_intree PROPERTIES LINKER_LANGUAGE CXX) | ||
#target_include_directories(onnxruntime_providers_intree PUBLIC "/bert_ort/leca/code/onnxruntime2/include/onnxruntime") | ||
|
||
if (NOT onnxruntime_BUILD_SHARED_LIB) | ||
install(TARGETS onnxruntime_providers_intree | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
FRAMEWORK DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
Check warning Code scanning / lintrunner CLANGFORMAT/format Warning
See https://clang.llvm.org/docs/ClangFormat.html.
Run lintrunner -a to apply this patch. |
||
|
||
#include "core/framework/func_api.h" | ||
|
||
namespace onnxruntime { | ||
// if we are export the fused function to dll, the function will still in the same binary as onnxruntime | ||
// use std function to give execution provider some chance to capture some state. | ||
using CreateFunctionStateFunc = std::function<int(ComputeContext*, FunctionState*)>; | ||
using ComputeFunc = std::function<Status(FunctionState, const OrtApi*, OrtKernelContext*)>; | ||
using DestroyFunctionStateFunc = std::function<void(FunctionState)>; | ||
|
||
struct NodeComputeInfo { | ||
CreateFunctionStateFunc create_state_func; | ||
ComputeFunc compute_func; | ||
DestroyFunctionStateFunc release_state_func; | ||
}; | ||
} | ||
Check warning on line 17 in include/onnxruntime/core/framework/node_compute_info.h GitHub Actions / cpplint[cpplint] include/onnxruntime/core/framework/node_compute_info.h#L17
Raw output
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
#include "core/framework/op_node_proto_helper.h" | ||
#include "core/graph/graph_viewer.h" | ||
#include "core/common/gsl.h" | ||
#include "interface/framework/kernel.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to include kernel.h here? |
||
|
||
namespace onnxruntime { | ||
|
||
|
@@ -20,7 +21,7 @@ struct AllocPlanPerValue; | |
// A very light-weight class, which works as an aggregated | ||
// view of all data needed for constructing a Kernel instance. | ||
// NOTE: it does not own/hold any objects. | ||
class OpKernelInfo : public OpNodeProtoHelper<ProtoHelperNodeContext> { | ||
class OpKernelInfo : public OpNodeProtoHelper<ProtoHelperNodeContext>, public interface::IKernelInfo { | ||
public: | ||
explicit OpKernelInfo(const onnxruntime::Node& node, | ||
const KernelDef& kernel_def, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to include kernel.h here? I don't see any class declared in kernel.h in the changes of this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably shouldn't include interface/kernel here, as this file is for the internal kernel impl