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

daisytuner / docc / 28302975093

27 Jun 2026 09:55PM UTC coverage: 61.929% (+0.2%) from 61.754%
28302975093

Pull #814

github

web-flow
Merge d9618e50c into 8322f5994
Pull Request #814: Adds GPU reduce dispatchers

567 of 854 new or added lines in 16 files covered. (66.39%)

17 existing lines in 1 file now uncovered.

39450 of 63702 relevant lines covered (61.93%)

968.19 hits per line

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

75.61
/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::Map*>& maps, GPUTarget target, size_t block_size
14
)
15
    : maps_(maps), target_(target), block_size_(block_size) {}
6✔
16

17
bool GPUNestedParallelizationPass::
18
    run_pass(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
6✔
19
    if (maps_.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 (maps or reduces)
26
    std::vector<structured_control_flow::StructuredLoop*> candidates;
6✔
27

28
    for (auto* map : maps_) {
16✔
29
        auto descendants = loop_analysis.descendants(map);
16✔
30
        for (auto* descendant : descendants) {
16✔
31
            auto* nested_loop = dynamic_cast<structured_control_flow::Map*>(descendant);
2✔
32
            if (nested_loop == nullptr) {
2✔
NEW
33
                continue;
×
NEW
34
            }
×
35

36
            bool applicable = false;
2✔
37
            if (target_ == GPUTarget::CUDA) {
2✔
38
                transformations::CUDAParallelizeNestedMap transform(*nested_loop, block_size_);
2✔
39
                applicable = transform.can_be_applied(builder, analysis_manager);
2✔
40
            } else {
2✔
NEW
41
                transformations::ROCMParallelizeNestedMap transform(*nested_loop, block_size_);
×
NEW
42
                applicable = transform.can_be_applied(builder, analysis_manager);
×
NEW
43
            }
×
44
            if (applicable) {
2✔
45
                candidates.push_back(nested_loop);
2✔
46
            }
2✔
47
        }
2✔
48
    }
16✔
49

50
    if (candidates.empty()) {
6✔
51
        return false;
4✔
52
    }
4✔
53

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

65
    return true;
2✔
66
}
6✔
67

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

© 2026 Coveralls, Inc