mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-08 17:17:15 +00:00
check TVM target for CPU (#10926)
Co-authored-by: Valery Chernov <valery.chernov@deelvin.com>
This commit is contained in:
parent
a46b00499a
commit
766e6ac4fd
4 changed files with 8 additions and 2 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 ||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ std::unique_ptr<IDataTransfer> TvmExecutionProvider::GetDataTransfer() const {
|
|||
//TODO(vvchernov): target or target host?
|
||||
if (TvmEPOptionsHelper::checkGPUTarget(options_.target)) {
|
||||
return std::make_unique<XPUDataTransfer>();
|
||||
} else if (options_.target.find("llvm") != std::string::npos) {
|
||||
} else if (TvmEPOptionsHelper::checkCPUTarget(options_.target)) {
|
||||
return std::make_unique<TvmCPUDataTransfer>();
|
||||
} else {
|
||||
ORT_NOT_IMPLEMENTED("TVM GetDataTransfer is not implemented for target ", options_.target);
|
||||
|
|
|
|||
Loading…
Reference in a new issue