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

[Runtime] Add TVM_DLL to threading backend funcs #16630

Merged
Merged
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
22 changes: 11 additions & 11 deletions include/tvm/runtime/threading_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ class ThreadGroup {
* `worker_callback` will only be called for values >= 1. This
* allows use of the main thread as a worker.
*/
ThreadGroup(int num_workers, std::function<void(int)> worker_callback,
bool exclude_worker0 = false);
~ThreadGroup();
TVM_DLL ThreadGroup(int num_workers, std::function<void(int)> worker_callback,
bool exclude_worker0 = false);
TVM_DLL ~ThreadGroup();

/*!
* \brief Blocks until all non-main threads in the pool finish.
*/
void Join();
TVM_DLL void Join();

enum AffinityMode : int {
kBig = 1,
Expand All @@ -106,8 +106,8 @@ class ThreadGroup {
*
* \return The number of workers to use.
*/
int Configure(AffinityMode mode, int nthreads, bool exclude_worker0,
std::vector<unsigned int> cpus = {});
TVM_DLL int Configure(AffinityMode mode, int nthreads, bool exclude_worker0,
std::vector<unsigned int> cpus = {});

private:
Impl* impl_;
Expand All @@ -116,22 +116,22 @@ class ThreadGroup {
/*!
* \brief Platform-agnostic no-op.
*/
void Yield();
TVM_DLL void Yield();
/*!
* \return the maximum number of effective workers for this system.
*/
int MaxConcurrency();
TVM_DLL int MaxConcurrency();
/*!
* \brief Setting the maximum number of available cores.
*/
void SetMaxConcurrency(int value);
TVM_DLL void SetMaxConcurrency(int value);
/*!
* \brief Reset the threads in the pool. All current threads are destroyed and
* new ones are created.
*
* Note that this does nothing when openmp is used.
*/
void ResetThreadPool();
TVM_DLL void ResetThreadPool();

/*!
* \brief Configuring the CPU affinity mode for the working threads.
Expand All @@ -147,7 +147,7 @@ TVM_DLL void Configure(tvm::runtime::threading::ThreadGroup::AffinityMode mode,
* \brief Get the number of threads being used by the TVM runtime
* \returns The number of threads used.
*/
int32_t NumThreads();
TVM_DLL int32_t NumThreads();

} // namespace threading

Expand Down
Loading