• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

daisytuner / docc / 31009380971

05 Aug 2026 01:15PM UTC coverage: 65.103% (+0.1%) from 65.005%
31009380971

Pull #814

github

web-flow
Merge 268a080ae into 7d5b198bd
Pull Request #814: Adds GPU reduce dispatchers

409 of 663 new or added lines in 18 files covered. (61.69%)

145 existing lines in 6 files now uncovered.

46693 of 71722 relevant lines covered (65.1%)

713.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.49
/opt/src/passes/offloading/gpu_nested_parallelization_pass.cpp
1
#include "sdfg/passes/offloading/gpu_nested_parallelization_pass.h"
2

3
#include "sdfg/analysis/loop_analysis.h"
4
#include "sdfg/structured_control_flow/reduce.h"
5
#include "sdfg/structured_control_flow/structured_loop.h"
6
#include "sdfg/transformations/offloading/cuda_parallelize_nested_map.h"
7
#include "sdfg/transformations/offloading/rocm_parallelize_nested_map.h"
8

9
namespace sdfg {
10
namespace passes {
11

12
GPUNestedParallelizationPass::GPUNestedParallelizationPass(
13
    const std::vector<structured_control_flow::StructuredLoop*>& loops, GPUTarget target, size_t block_size
14
)
15
    : loops_(loops), target_(target), block_size_(block_size) {}
6✔
16

17
bool GPUNestedParallelizationPass::
18
    run_pass(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
6✔
19
    if (loops_.empty()) {
6✔
20
        return false;
×
21
    }
×
22

23
    auto& loop_analysis = analysis_manager.get<analysis::LoopAnalysis>();
6✔
24

25
    // Phase 1: Collect all applicable nested loops (loops or reduces)
26
    std::vector<structured_control_flow::StructuredLoop*> candidates;
6✔
27

28
    for (auto* loop : loops_) {
16✔
29
        auto descendants = loop_analysis.descendants(loop);
16✔
30
        for (auto* descendant : descendants) {
16✔
31
            if (auto* nested_loop = dyn_cast<structured_control_flow::StructuredLoop*>(descendant)) {
2✔
32
                bool applicable = false;
2✔
33
                if (target_ == GPUTarget::CUDA) {
2✔
34
                    transformations::CUDAParallelizeNestedMap transform(*nested_loop, block_size_);
2✔
35
                    applicable = transform.can_be_applied(builder, analysis_manager);
2✔
36
                } else {
2✔
NEW
37
                    transformations::ROCMParallelizeNestedMap transform(*nested_loop, block_size_);
×
38
                    applicable = transform.can_be_applied(builder, analysis_manager);
×
39
                }
×
40
                if (applicable) {
2✔
41
                    candidates.push_back(nested_loop);
2✔
42
                }
2✔
43
            }
2✔
44
        }
2✔
45
    }
16✔
46

47
    if (candidates.empty()) {
6✔
48
        return false;
4✔
49
    }
4✔
50

51
    // Phase 2: Apply all parallelizations
52
    for (auto* nested_loop : candidates) {
2✔
53
        if (target_ == GPUTarget::CUDA) {
2✔
54
            transformations::CUDAParallelizeNestedMap transform(*nested_loop, block_size_);
2✔
55
            transform.apply(builder, analysis_manager);
2✔
56
        } else {
2✔
NEW
57
            transformations::ROCMParallelizeNestedMap transform(*nested_loop, block_size_);
×
58
            transform.apply(builder, analysis_manager);
×
59
        }
×
60
    }
2✔
61

62
    return true;
2✔
63
}
6✔
64

65
} // namespace passes
66
} // namespace sdfg
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc