Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@ option(ENABLE_DEBUG "if to enable print debug information, this may reduce perfo
# Whether to build fastdeply with vision/text/... examples, only for testings.
option(WITH_VISION_EXAMPLES "Whether to build fastdeply with vision examples" OFF)

# Check for 32bit system
if(WIN32)
if(NOT CMAKE_CL_64)
message("***********************Compile on non 64-bit system now**********************")
add_definitions(-DNON_64_PLATFORM)
if(WITH_GPU)
message(FATAL_ERROR "-DWITH_GPU=ON doesn't support on non 64-bit system now.")
endif()
if(ENABLE_PADDLE_BACKEND)
message(FATAL_ERROR "-DENABLE_PADDLE_BACKEND=ON doesn't support on non 64-bit system now.")
endif()
if(ENABLE_VISION)
message(FATAL_ERROR "-DENABLE_VISION=ON doesn't support on non 64-bit system now.")
endif()
endif()
endif()

if(ENABLE_DEBUG)
add_definitions(-DFASTDEPLOY_DEBUG)
endif()
Expand Down
4 changes: 4 additions & 0 deletions csrcs/fastdeploy/backends/ort/ops/multiclass_nms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef NON_64_PLATFORM

#include "fastdeploy/backends/ort/ops/multiclass_nms.h"
#include <algorithm>
#include "fastdeploy/core/fd_tensor.h"
Expand Down Expand Up @@ -255,3 +257,5 @@ void MultiClassNmsKernel::GetAttribute(const OrtKernelInfo* info) {
score_threshold = ort_.KernelInfoGetAttribute<float>(info, "score_threshold");
}
} // namespace fastdeploy

#endif
5 changes: 5 additions & 0 deletions csrcs/fastdeploy/backends/ort/ops/multiclass_nms.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
// limitations under the License.

#pragma once

#include <map>

#ifndef NON_64_PLATFORM
#include "onnxruntime_cxx_api.h" // NOLINT

namespace fastdeploy {
Expand Down Expand Up @@ -74,3 +77,5 @@ struct MultiClassNmsOp
};

} // namespace fastdeploy

#endif
2 changes: 2 additions & 0 deletions csrcs/fastdeploy/backends/ort/ort_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ TensorInfo OrtBackend::GetOutputInfo(int index) {
}

void OrtBackend::InitCustomOperators() {
#ifndef NON_64_PLATFORM
if (custom_operators_.size() == 0) {
MultiClassNmsOp* custom_op = new MultiClassNmsOp{};
custom_operators_.push_back(custom_op);
Expand All @@ -300,6 +301,7 @@ void OrtBackend::InitCustomOperators() {
custom_op_domain_.Add(custom_operators_[i]);
}
session_options_.Add(custom_op_domain_);
#endif
}

} // namespace fastdeploy
2 changes: 2 additions & 0 deletions csrcs/fastdeploy/backends/ort/ort_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ class OrtBackend : public BaseBackend {
std::shared_ptr<Ort::IoBinding> binding_;
std::vector<OrtValueInfo> inputs_desc_;
std::vector<OrtValueInfo> outputs_desc_;
#ifndef NON_64_PLATFORM
Ort::CustomOpDomain custom_op_domain_ = Ort::CustomOpDomain("Paddle");
#endif
OrtBackendOption option_;
void CopyToCpu(const Ort::Value& value, FDTensor* tensor);
};
Expand Down
3 changes: 3 additions & 0 deletions external/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ if(WIN32)
else()
set(ONNXRUNTIME_FILENAME "onnxruntime-win-x64-${ONNXRUNTIME_VERSION}.zip")
endif()
if(NOT CMAKE_CL_64)
set(ONNXRUNTIME_FILENAME "onnxruntime-win-x86-${ONNXRUNTIME_VERSION}.zip")
endif()
elseif(APPLE)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")
set(ONNXRUNTIME_FILENAME "onnxruntime-osx-arm64-${ONNXRUNTIME_VERSION}.tgz")
Expand Down
3 changes: 3 additions & 0 deletions external/paddle2onnx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ set(PADDLE2ONNX_URL_BASE "https://bj.bcebos.com/paddle2onnx/libs/")
set(PADDLE2ONNX_VERSION "1.0.0rc2")
if(WIN32)
set(PADDLE2ONNX_FILE "paddle2onnx-win-x64-${PADDLE2ONNX_VERSION}.zip")
if(NOT CMAKE_CL_64)
set(PADDLE2ONNX_FILE "paddle2onnx-win-x86-${PADDLE2ONNX_VERSION}.zip")
endif()
elseif(APPLE)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")
set(PADDLE2ONNX_FILE "paddle2onnx-osx-arm64-${PADDLE2ONNX_VERSION}.tgz")
Expand Down