mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
Add a check for onnxruntime_USE_MKLML AND onnxruntime_USE_OPENMP (#1131)
* Add a check for onnxruntime_USE_MKLML AND onnxruntime_USE_OPENMP
This commit is contained in:
parent
4e231ad907
commit
66a6f2b0e3
2 changed files with 14 additions and 1 deletions
|
|
@ -82,6 +82,19 @@ set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE)
|
|||
set(NSYNC_ENABLE_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE)
|
||||
set(ONNX_ML 1)
|
||||
|
||||
if(onnxruntime_USE_OPENMP AND UNIX)
|
||||
#if you enabled both of them, the code can still be built and run, but you may see
|
||||
# 10x performance degradation, because one process should only have one openmp implementation
|
||||
# mkl(or mklml) depends on Intel OpenMP
|
||||
# GCC does not support linking against the Intel OpenMP runtime library
|
||||
# Clang should be ok, but it's not in our consideration right now.
|
||||
if(onnxruntime_USE_MKLML)
|
||||
message(FATAL_ERROR "Please use only one of onnxruntime_USE_MKLML, onnxruntime_USE_OPENMP")
|
||||
endif()
|
||||
if(onnxruntime_USE_NGRAPH)
|
||||
message(FATAL_ERROR "Please use only one of onnxruntime_USE_NGRAPH, onnxruntime_USE_OPENMP")
|
||||
endif()
|
||||
endif()
|
||||
if(onnxruntime_ENABLE_LTO)
|
||||
#TODO: figure out why nsync doesn't work
|
||||
if(onnxruntime_USE_NSYNC)
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ def generate_build_tree(cmake_path, source_dir, build_dir, cuda_home, cudnn_home
|
|||
"-Donnxruntime_USE_MKLDNN=" + ("ON" if args.use_mkldnn else "OFF"),
|
||||
"-Donnxruntime_USE_MKLML=" + ("ON" if args.use_mklml else "OFF"),
|
||||
"-Donnxruntime_USE_NGRAPH=" + ("ON" if args.use_ngraph else "OFF"),
|
||||
"-Donnxruntime_USE_OPENMP=" + ("ON" if args.use_openmp else "OFF"),
|
||||
"-Donnxruntime_USE_OPENMP=" + ("ON" if args.use_openmp and not args.use_mklml and not args.use_ngraph else "OFF"),
|
||||
"-Donnxruntime_USE_TVM=" + ("ON" if args.use_tvm else "OFF"),
|
||||
"-Donnxruntime_USE_LLVM=" + ("ON" if args.use_llvm else "OFF"),
|
||||
"-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=" + ("ON" if args.enable_msinternal else "OFF"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue