| 59 | // else if work < 3*chunk, then two threads are used, and so on. |
| 60 | |
| 61 | static inline int GB_nthreads // return # of threads to use |
| 62 | ( |
| 63 | double work, // total work to do |
| 64 | double chunk, // give each thread at least this much work |
| 65 | int nthreads_max // max # of threads to use |
| 66 | ) |
| 67 | { |
| 68 | work = GB_IMAX (work, 1) ; |
| 69 | chunk = GB_IMAX (chunk, 1) ; |
| 70 | int64_t nthreads = (int64_t) floor (work / chunk) ; |
| 71 | nthreads = GB_IMIN (nthreads, nthreads_max) ; |
| 72 | nthreads = GB_IMAX (nthreads, 1) ; |
| 73 | return ((int) nthreads) ; |
| 74 | } |
| 75 | |
| 76 | #endif |
| 77 |
no outgoing calls
no test coverage detected