Skip to content

Commit

Permalink
Moved ie_thread_affinity.hpp to private API (#5554)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored May 7, 2021
1 parent 4ea09b1 commit 3e25539
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ using cpu_set_t = void;
*
* @param mask The mask
*/
INFERENCE_ENGINE_API_CPP(void) ReleaseProcessMask(cpu_set_t* mask);
void ReleaseProcessMask(cpu_set_t* mask);

/**
* @brief Deleter for process mask
* @ingroup ie_dev_api_threading
*/
struct ReleaseProcessMaskDeleter {
/**
* @brief A callable operator to release object
*
* @param mask The mask to release
*/
/**
* @brief A callable operator to release object
*
* @param mask The mask to release
*/
void operator()(cpu_set_t* mask) const {
ReleaseProcessMask(mask);
}
Expand All @@ -52,7 +52,7 @@ using CpuSet = std::unique_ptr<cpu_set_t, ReleaseProcessMaskDeleter>;
* @ingroup ie_dev_api_threading
* @return A core affinity mask
*/
INFERENCE_ENGINE_API_CPP(std::tuple<CpuSet, int>) GetProcessMask();
std::tuple<CpuSet, int> GetProcessMask();

/**
* @brief Pins current thread to a set of cores determined by the mask
Expand All @@ -64,18 +64,18 @@ INFERENCE_ENGINE_API_CPP(std::tuple<CpuSet, int>) GetProcessMask();
* @param[in] processMask The process mask
* @return `True` in case of success, `false` otherwise
*/
INFERENCE_ENGINE_API_CPP(bool) PinThreadToVacantCore(int thrIdx, int hyperThreads, int ncores, const CpuSet& processMask);
bool PinThreadToVacantCore(int thrIdx, int hyperThreads, int ncores, const CpuSet& processMask);

/**
* @brief Pins thread to a spare core in the round-robin scheme, while respecting the given process mask.
* The function can also handle the hyper-threading (by populating the physical cores first)
* The function can also handle the hyper-threading (by populating the physical cores first)
* @ingroup ie_dev_api_threading
*
* @param[in] ncores The ncores
* @param[in] processMask The process mask
* @return `True` in case of success, `false` otherwise
*/
INFERENCE_ENGINE_API_CPP(bool) PinCurrentThreadByMask(int ncores, const CpuSet& processMask);
bool PinCurrentThreadByMask(int ncores, const CpuSet& processMask);

/**
* @brief Pins a current thread to a socket.
Expand All @@ -84,5 +84,5 @@ INFERENCE_ENGINE_API_CPP(bool) PinCurrentThreadByMask(int ncores, const CpuSet&
* @param[in] socket The socket id
* @return `True` in case of success, `false` otherwise
*/
INFERENCE_ENGINE_API_CPP(bool) PinCurrentThreadToSocket(int socket);
bool PinCurrentThreadToSocket(int socket);
} // namespace InferenceEngine
1 change: 0 additions & 1 deletion inference-engine/src/mkldnn_plugin/mkldnn_exec_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include <threading/ie_cpu_streams_executor.hpp>
#include <ie_system_conf.h>
#include <threading/ie_thread_affinity.hpp>
#include <algorithm>
#include <unordered_set>
#include <utility>
Expand Down

0 comments on commit 3e25539

Please sign in to comment.