onnxruntime/cmake/onnxruntime_csharp.cmake
Scott McKay d64f23fec0
EP factory creation cleanup and enhancements. (#11798)
* Rework the EP factory creation setup so we're not cut-and-pasting function declarations in multiple places.
Convert append EP for SNPE to be generic, and also use for XNNPACK.
Add XNNPACK to C# API

* Don't need stub for MIGraphX as it's using provider bridge.

* Remove old 'create' functions that aren't applicable now that the EPs are built as separate libraries.

* Only use EPs that require the layout transform if the opset is supported by the layout transformer.

* Update wasm registration of xnnpack.
2022-06-16 07:01:41 +10:00

63 lines
1.7 KiB
CMake

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
set (CSHARP_ROOT ${PROJECT_SOURCE_DIR}/../csharp)
set (CSHARP_MASTER_TARGET OnnxRuntime.CSharp)
set (CSHARP_MASTER_PROJECT ${CSHARP_ROOT}/OnnxRuntime.CSharp.proj)
if (onnxruntime_RUN_ONNX_TESTS)
set (CSHARP_DEPENDS onnxruntime ${test_data_target})
else()
set (CSHARP_DEPENDS onnxruntime)
endif()
if (onnxruntime_USE_CUDA)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_CUDA;")
endif()
if (onnxruntime_USE_DNNL)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_DNNL;")
endif()
if (onnxruntime_USE_DML)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_DML;")
endif()
if (onnxruntime_USE_MIGRAPHX)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_MIGRAPHX;")
endif()
if (onnxruntime_USE_NNAPI_BUILTIN)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_NNAPI;")
endif()
if (onnxruntime_USE_NUPHAR)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_NUPHAR;")
endif()
if (onnxruntime_USE_TVM)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_TVM,")
endif()
if (onnxruntime_USE_OPENVINO)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_OPENVINO;")
endif()
if (onnxruntime_USE_ROCM)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_ROCM;")
endif()
if (onnxruntime_USE_TENSORRT)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_TENSORRT;")
endif()
if (onnxruntime_USE_XNNPACK)
STRING(APPEND CSHARP_PREPROCESSOR_DEFINES "USE_XNNPACK;")
endif()
include(CSharpUtilities)
# generate Directory.Build.props
set(DIRECTORY_BUILD_PROPS_COMMENT "WARNING: This is a generated file, please do not check it in!")
configure_file(${CSHARP_ROOT}/Directory.Build.props.in
${CSHARP_ROOT}/Directory.Build.props
@ONLY)