Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TaskThreadPool #1713

Merged
merged 1 commit into from
Aug 29, 2019
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
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