MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / bulk_enqueue

Method bulk_enqueue

include/exec/static_thread_pool.hpp:934–946  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932
933 template <std::derived_from<task_base> Task>
934 void _static_thread_pool::bulk_enqueue(std::span<Task> tasks) noexcept
935 {
936 auto& queue = *this->get_remote_queue();
937 for (std::uint32_t i = 0; i < tasks.size(); ++i)
938 {
939 std::uint32_t index = i % this->available_parallelism();
940 queue.queues_[index].push_front(&tasks[i]);
941 thread_states_[index]->notify();
942 }
943 // At this point the calling thread can exit and the pool will take over.
944 // Ultimately, the last completing thread passes the result forward.
945 // See `if (is_last_thread)` above.
946 }
947
948 inline void _static_thread_pool::bulk_enqueue(remote_queue& queue,
949 __intrusive_queue<&task_base::next> tasks,

Callers 3

enqueueMethod · 0.80
enqueueMethod · 0.80
startMethod · 0.80

Calls 13

get_idFunction · 0.85
get_remote_queueFunction · 0.85
even_shareFunction · 0.85
push_localMethod · 0.80
available_parallelismFunction · 0.70
sizeMethod · 0.45
available_parallelismMethod · 0.45
push_frontMethod · 0.45
notifyMethod · 0.45
numa_nodeMethod · 0.45
push_backMethod · 0.45
pop_frontMethod · 0.45

Tested by

no test coverage detected