Skip to content

Commit

Permalink
Remove easylogging dependence from demo (#32)
Browse files Browse the repository at this point in the history
* Fix onnx-related issues

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* refactor: remove easylogging from demo
  • Loading branch information
zhaoyiluo authored Oct 11, 2021
1 parent 93d0bb6 commit 4d7358d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 287 deletions.
4 changes: 0 additions & 4 deletions demo/fwd_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ option(ENABLE_TENSORFLOW "Enable TensorFlow" OFF)
# Enable ONNX
option(ENABLE_ONNX "Enable ONNX" OFF)

# easylogging
add_definitions(-DELPP_THREAD_SAFE=1)
include_directories(${PROJECT_SOURCE_DIR}/../../source/third_party/easyloggingpp)

# CUDA
find_package(CUDA)

Expand Down
10 changes: 1 addition & 9 deletions demo/fwd_cpp/include/common/trt_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

#include <NvInfer.h>
#include <cuda_runtime_api.h>
#include <easylogging++.h>

#include <fstream>
#include <functional>
#include <memory>
#include <numeric>
Expand All @@ -39,7 +39,6 @@
#include <vector>

#include "common/fwd_common.h"
#include "common/trt_utils.h"

#undef max
#undef min
Expand Down Expand Up @@ -93,7 +92,6 @@ inline bool CheckAndCopyFile(const std::string& dest_path, const std::string& sr
// check if desc_file is existed
std::ifstream file(dest_path);
if (file.is_open()) {
LOG(INFO) << dest_path << " has already been existed.";
file.close();
return true;
}
Expand All @@ -102,13 +100,11 @@ inline bool CheckAndCopyFile(const std::string& dest_path, const std::string& sr

std::ifstream src_file(src_path, std::ios::binary);
if (!src_file.is_open()) {
LOG(ERROR) << "Open src file " << src_path << "failed! ";
return false;
}

std::ofstream desc_file(dest_path, std::ios::binary);
if (!desc_file.is_open()) {
LOG(ERROR) << "Open dest file " << dest_path << "failed! ";
return false;
}

Expand Down Expand Up @@ -153,8 +149,6 @@ inline size_t ResetMaxWorkspaceSize(size_t size) {
// 限制一下需要的显存大小
if (size > free * 4 / 5) {
size = free * 4 / 5;

LOG(WARNING) << "Reset max workspace size to " << size;
}

return size;
Expand All @@ -174,8 +168,6 @@ inline std::vector<int> GetOutputOrder(nvinfer1::ICudaEngine* engine,
const auto output = network->getOutput(i);
const int pos = engine->getBindingIndex(output->getName());
output_pos.push_back(pos);
LOG(INFO) << output->getName() << TrtUtils::ShapeStrOf(output->getDimensions())
<< " in position " << pos;
}
return output_pos;
}
Expand Down
274 changes: 0 additions & 274 deletions demo/fwd_cpp/include/common/trt_utils.h

This file was deleted.

0 comments on commit 4d7358d

Please sign in to comment.