text
stringlengths 0
2.2M
|
---|
dim_t d0 {0}, d1 {0};
|
utils::nd_iterator_init(start, d0, D0, d1, D1);
|
for (dim_t iwork = start; iwork < end; ++iwork) {
|
f(ithr, nthr, d0, d1);
|
utils::nd_iterator_step(d0, D0, d1, D1);
|
}
|
}
|
void for_nd_ext(const int ithr, const int nthr, dim_t D0, dim_t D1, dim_t D2,
|
const F_3D_thr_t &f) {
|
const dim_t work_amount = D0 * D1 * D2;
|
if (work_amount == 0) return;
|
dim_t start {0}, end {0};
|
balance211(work_amount, nthr, ithr, start, end);
|
dim_t d0 {0}, d1 {0}, d2 {0};
|
utils::nd_iterator_init(start, d0, D0, d1, D1, d2, D2);
|
for (dim_t iwork = start; iwork < end; ++iwork) {
|
f(ithr, nthr, d0, d1, d2);
|
utils::nd_iterator_step(d0, D0, d1, D1, d2, D2);
|
}
|
}
|
void for_nd_ext(const int ithr, const int nthr, dim_t D0, dim_t D1, dim_t D2,
|
dim_t D3, const F_4D_thr_t &f) {
|
const dim_t work_amount = D0 * D1 * D2 * D3;
|
if (work_amount == 0) return;
|
dim_t start {0}, end {0};
|
balance211(work_amount, nthr, ithr, start, end);
|
dim_t d0 {0}, d1 {0}, d2 {0}, d3 {0};
|
utils::nd_iterator_init(start, d0, D0, d1, D1, d2, D2, d3, D3);
|
for (dim_t iwork = start; iwork < end; ++iwork) {
|
f(ithr, nthr, d0, d1, d2, d3);
|
utils::nd_iterator_step(d0, D0, d1, D1, d2, D2, d3, D3);
|
}
|
}
|
void for_nd_ext(const int ithr, const int nthr, dim_t D0, dim_t D1, dim_t D2,
|
dim_t D3, dim_t D4, const F_5D_thr_t &f) {
|
const dim_t work_amount = D0 * D1 * D2 * D3 * D4;
|
if (work_amount == 0) return;
|
dim_t start {0}, end {0};
|
balance211(work_amount, nthr, ithr, start, end);
|
dim_t d0 {0}, d1 {0}, d2 {0}, d3 {0}, d4 {0};
|
utils::nd_iterator_init(start, d0, D0, d1, D1, d2, D2, d3, D3, d4, D4);
|
for (dim_t iwork = start; iwork < end; ++iwork) {
|
f(ithr, nthr, d0, d1, d2, d3, d4);
|
utils::nd_iterator_step(d0, D0, d1, D1, d2, D2, d3, D3, d4, D4);
|
}
|
}
|
void for_nd_ext(const int ithr, const int nthr, dim_t D0, dim_t D1, dim_t D2,
|
dim_t D3, dim_t D4, dim_t D5, const F_6D_thr_t &f) {
|
const dim_t work_amount = D0 * D1 * D2 * D3 * D4 * D5;
|
if (work_amount == 0) return;
|
dim_t start {0}, end {0};
|
balance211(work_amount, nthr, ithr, start, end);
|
dim_t d0 {0}, d1 {0}, d2 {0}, d3 {0}, d4 {0}, d5 {0};
|
utils::nd_iterator_init(
|
start, d0, D0, d1, D1, d2, D2, d3, D3, d4, D4, d5, D5);
|
for (dim_t iwork = start; iwork < end; ++iwork) {
|
f(ithr, nthr, d0, d1, d2, d3, d4, d5);
|
utils::nd_iterator_step(d0, D0, d1, D1, d2, D2, d3, D3, d4, D4, d5, D5);
|
}
|
}
|
/* parallel_nd_ext section */
|
void parallel_nd_ext(int nthr, dim_t D0, const F_1D_thr_t &f) {
|
const dim_t work_amount = D0;
|
nthr = adjust_num_threads(nthr, work_amount);
|
if (nthr)
|
parallel(nthr,
|
[&](int ithr, int nthr) { for_nd_ext(ithr, nthr, D0, f); });
|
}
|
void parallel_nd_ext(int nthr, dim_t D0, dim_t D1, const F_2D_thr_t &f) {
|
const dim_t work_amount = D0 * D1;
|
nthr = adjust_num_threads(nthr, work_amount);
|
if (nthr)
|
parallel(nthr,
|
[&](int ithr, int nthr) { for_nd_ext(ithr, nthr, D0, D1, f); });
|
}
|
void parallel_nd_ext(
|
int nthr, dim_t D0, dim_t D1, dim_t D2, const F_3D_thr_t &f) {
|
const dim_t work_amount = D0 * D1 * D2;
|
nthr = adjust_num_threads(nthr, work_amount);
|
if (nthr)
|
parallel(nthr, [&](int ithr, int nthr) {
|
for_nd_ext(ithr, nthr, D0, D1, D2, f);
|
});
|
}
|
void parallel_nd_ext(
|
int nthr, dim_t D0, dim_t D1, dim_t D2, dim_t D3, const F_4D_thr_t &f) {
|
const dim_t work_amount = D0 * D1 * D2 * D3;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.