MCPcopy Create free account
hub / github.com/davisking/dlib / parallel_for

Function parallel_for

dlib/threads/parallel_for_extension.h:205–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204 template <typename T>
205 void parallel_for (
206 thread_pool& tp,
207 long begin,
208 long end,
209 T& obj,
210 void (T::*funct)(long),
211 long chunks_per_thread = 8
212 )
213 {
214 // make sure requires clause is not broken
215 DLIB_ASSERT(begin <= end && chunks_per_thread > 0,
216 "\t void parallel_for()"
217 << "\n\t Invalid inputs were given to this function"
218 << "\n\t begin: " << begin
219 << "\n\t end: " << end
220 << "\n\t chunks_per_thread: " << chunks_per_thread
221 );
222
223 impl::helper_parallel_for<T> helper(obj, funct);
224 parallel_for_blocked(tp, begin, end, helper, &impl::helper_parallel_for<T>::process_block, chunks_per_thread);
225 }
226
227// ----------------------------------------------------------------------------------------
228

Callers 15

mainFunction · 0.85
do_trainMethod · 0.85
test_parallel_forFunction · 0.85
test_parallel_for2Function · 0.85
appendMethod · 0.85
add_image_rotationsFunction · 0.85
hash_samplesFunction · 0.85
initialize_scannersMethod · 0.85
trainMethod · 0.85

Calls 1

parallel_for_blockedFunction · 0.85

Tested by 3

test_parallel_forFunction · 0.68
test_parallel_for2Function · 0.68