Skip to content

Commit

Permalink
Remove TaskThreadPool (#1713)
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn authored Aug 29, 2019
1 parent 73312b8 commit 81ad480
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 384 deletions.
9 changes: 5 additions & 4 deletions cmake/onnxruntime_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ target_include_directories(onnxruntime_common PRIVATE ${CMAKE_CURRENT_BINARY_DIR
if(onnxruntime_USE_NSYNC)
target_compile_definitions(onnxruntime_common PUBLIC USE_NSYNC)
endif()
if(onnxruntime_USE_EIGEN_THREADPOOL)
target_include_directories(onnxruntime_common PRIVATE ${eigen_INCLUDE_DIRS})
target_compile_definitions(onnxruntime_common PUBLIC USE_EIGEN_THREADPOOL)
add_dependencies(onnxruntime_common ${onnxruntime_EXTERNAL_DEPENDENCIES})

target_include_directories(onnxruntime_common PUBLIC ${eigen_INCLUDE_DIRS})
if(NOT onnxruntime_USE_OPENMP)
target_compile_definitions(onnxruntime_common PUBLIC EIGEN_USE_THREADS)
endif()
add_dependencies(onnxruntime_common ${onnxruntime_EXTERNAL_DEPENDENCIES})

install(DIRECTORY ${PROJECT_SOURCE_DIR}/../include/onnxruntime/core/common DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/onnxruntime/core)
set_target_properties(onnxruntime_common PROPERTIES LINKER_LANGUAGE CXX)
Expand Down
2 changes: 1 addition & 1 deletion cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ else()
endif()

add_library(onnxruntime_mlas STATIC ${mlas_common_srcs} ${mlas_platform_srcs})
target_include_directories(onnxruntime_mlas PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc ${ONNXRUNTIME_ROOT}/core/mlas/lib)
target_include_directories(onnxruntime_mlas PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc ${ONNXRUNTIME_ROOT}/core/mlas/lib ${eigen_INCLUDE_DIRS})
set_target_properties(onnxruntime_mlas PROPERTIES FOLDER "ONNXRuntime")
23 changes: 17 additions & 6 deletions include/onnxruntime/core/platform/threadpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@
#include <functional>
#include <memory>

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#else
#pragma warning(push)
#pragma warning(disable : 4267)
#endif
#include <unsupported/Eigen/CXX11/ThreadPool>
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#else
#pragma warning(pop)
#endif

namespace onnxruntime {

namespace concurrency {

/**
* Generic class for instantiating thread pools.
* Don't put any object of this type into a global variable in a Win32 DLL.
*/
class ThreadPool {
public:
Expand Down Expand Up @@ -43,14 +58,10 @@ class ThreadPool {

int CurrentThreadId() const;

/*
Ensure that the pool has terminated and cleaned up all threads cleanly.
*/
~ThreadPool();
Eigen::ThreadPool& GetHandler() { return impl_; }

private:
class Impl;
std::unique_ptr<Impl> impl_;
Eigen::ThreadPool impl_;
};

} // namespace concurrency
Expand Down
213 changes: 0 additions & 213 deletions onnxruntime/core/common/task_thread_pool.h

This file was deleted.

Loading

0 comments on commit 81ad480

Please sign in to comment.