scran
C++ library for basic single-cell RNA-seq analyses
Loading...
Searching...
No Matches
macros.hpp
Go to the documentation of this file.
1#ifndef SCRAN_MACROS_HPP
2#define SCRAN_MACROS_HPP
3
31// Synchronizing all parallelization schemes.
32#ifdef SCRAN_CUSTOM_PARALLEL
33
34#ifndef TATAMI_CUSTOM_PARALLEL
35#define TATAMI_CUSTOM_PARALLEL SCRAN_CUSTOM_PARALLEL
36#endif
37
38#ifndef IRLBA_CUSTOM_PARALLEL
39namespace scran {
40
41template<class Function>
42void irlba_parallelize_(int nthreads, Function fun) {
43 SCRAN_CUSTOM_PARALLEL([&](size_t, size_t f, size_t l) -> void {
44 // This loop should be trivial if f + 1== l when nthreads == njobs.
45 // Nonetheless, we still have a loop just in case the arbitrary
46 // scheduling does wacky things.
47 for (size_t i = 0; i < l; ++i) {
48 fun(f + i);
49 }
50 }, nthreads, nthreads);
51}
52
53}
54
55#define IRLBA_CUSTOM_PARALLEL scran::irlba_parallelize_
56#endif
57
58#endif
59
60#endif
Functions for single-cell RNA-seq analyses.
Definition AggregateAcrossCells.hpp:18