diff --git a/onnxruntime/core/providers/tvm/tvm_defaults.h b/onnxruntime/core/providers/tvm/tvm_defaults.h index e7928a1941..030a4ea05d 100644 --- a/onnxruntime/core/providers/tvm/tvm_defaults.h +++ b/onnxruntime/core/providers/tvm/tvm_defaults.h @@ -11,7 +11,7 @@ constexpr const char* default_executor_type = "vm"; constexpr const char* vm_executor_type = "vm"; constexpr const char* graph_executor_type = "graph"; -constexpr const char* default_target_str = "cpu"; +constexpr const char* default_target_str = "llvm"; constexpr const char* llvm_target_str = "llvm"; constexpr const char* cpu_target_str = "cpu"; diff --git a/onnxruntime/core/providers/tvm/tvm_ep_options.cc b/onnxruntime/core/providers/tvm/tvm_ep_options.cc index 3b20bbc917..6e2a077835 100644 --- a/onnxruntime/core/providers/tvm/tvm_ep_options.cc +++ b/onnxruntime/core/providers/tvm/tvm_ep_options.cc @@ -134,6 +134,11 @@ void TvmEPOptionsHelper::optionsPostprocess(TvmEPOptions& options) { optLevelPostprocess(options.opt_level); } +bool TvmEPOptionsHelper::checkCPUTarget(const std::string& target) { + bool check = target.find("llvm") != std::string::npos; + return check; +} + bool TvmEPOptionsHelper::checkGPUTarget(const std::string& target) { bool check = ( target.find("cuda") != std::string::npos || diff --git a/onnxruntime/core/providers/tvm/tvm_ep_options.h b/onnxruntime/core/providers/tvm/tvm_ep_options.h index 4d323698b0..7918b37a6b 100644 --- a/onnxruntime/core/providers/tvm/tvm_ep_options.h +++ b/onnxruntime/core/providers/tvm/tvm_ep_options.h @@ -54,6 +54,7 @@ public: static TvmEPOptions FromProviderOptions(const ProviderOptions& options); static std::string whitespace_trimming(const std::string& str); + static bool checkCPUTarget(const std::string& target); static bool checkGPUTarget(const std::string& target); private: diff --git a/onnxruntime/core/providers/tvm/tvm_execution_provider.cc b/onnxruntime/core/providers/tvm/tvm_execution_provider.cc index 60b6c8469f..12eae2262c 100644 --- a/onnxruntime/core/providers/tvm/tvm_execution_provider.cc +++ b/onnxruntime/core/providers/tvm/tvm_execution_provider.cc @@ -152,7 +152,7 @@ std::unique_ptr TvmExecutionProvider::GetDataTransfer() const { //TODO(vvchernov): target or target host? if (TvmEPOptionsHelper::checkGPUTarget(options_.target)) { return std::make_unique(); - } else if (options_.target.find("llvm") != std::string::npos) { + } else if (TvmEPOptionsHelper::checkCPUTarget(options_.target)) { return std::make_unique(); } else { ORT_NOT_IMPLEMENTED("TVM GetDataTransfer is not implemented for target ", options_.target);