-
Notifications
You must be signed in to change notification settings - Fork 67
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
Minor fixes on the file permission, host allocation flag, and worker thread initialization #637
Conversation
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
namespace kvikio { | ||
|
||
template <typename pool_type> | ||
class thread_pool_wrapper : public pool_type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a thread pool wrapper to avoid burdening the defaults
class with the detail of worker_thread_init_func
.
void reset(unsigned int nthreads) { pool_type::reset(nthreads, worker_thread_init_func); } | ||
|
||
private: | ||
inline static std::function<void()> worker_thread_init_func{[] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline
here permits in-class definition of the static data member with a brace initializer. Ref https://eel.is/c++draft/class.static#data-4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
a100f78
to
842603f
Compare
Just fixed a style consistency issue ( |
/merge |
This PR makes the following minor fixes:
644
code.cuMemHostAlloc
call.thread_local
call-once section (which may negatively affect performance; see Enable tracing of thread pool tasks using NVTX #630 (comment)) with more idiomatic worker thread initialization function.