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

daisytuner / docc / 23906044628

02 Apr 2026 02:40PM UTC coverage: 64.553% (+0.08%) from 64.474%
23906044628

Pull #632

github

web-flow
Merge b2698daab into 3125b927b
Pull Request #632: Separate can_be_applied and apply for GPUTilling during Loop Scheduling

282 of 348 new or added lines in 16 files covered. (81.03%)

29 existing lines in 10 files now uncovered.

28998 of 44921 relevant lines covered (64.55%)

453.01 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/transformations/offloading/cuda_parallelize_nested_map.h"
5
#include "sdfg/transformations/offloading/rocm_parallelize_nested_map.h"
6

7
namespace sdfg {
8
namespace passes {
9

10
GPUNestedParallelizationPass::GPUNestedParallelizationPass(
11
    const std::vector<structured_control_flow::Map*>& maps, GPUTarget target, size_t block_size
12
)
13
    : maps_(maps), target_(target), block_size_(block_size) {}
3✔
14

15
bool GPUNestedParallelizationPass::
16
    run_pass(builder::StructuredSDFGBuilder& builder, analysis::AnalysisManager& analysis_manager) {
3✔
17
    if (maps_.empty()) {
3✔
NEW
18
        return false;
×
NEW
19
    }
×
20

21
    auto& loop_analysis = analysis_manager.get<analysis::LoopAnalysis>();
3✔
22

23
    // Phase 1: Collect all applicable nested maps
24
    std::vector<structured_control_flow::Map*> candidates;
3✔
25

26
    for (auto* map : maps_) {
4✔
27
        auto descendants = loop_analysis.descendants(map);
4✔
28
        for (auto* descendant : descendants) {
4✔
29
            if (auto* nested_map = dynamic_cast<structured_control_flow::Map*>(descendant)) {
2✔
30
                bool applicable = false;
2✔
31
                if (target_ == GPUTarget::CUDA) {
2✔
32
                    transformations::CUDAParallelizeNestedMap transform(*nested_map, block_size_);
2✔
33
                    applicable = transform.can_be_applied(builder, analysis_manager);
2✔
34
                } else {
2✔
NEW
35
                    transformations::ROCMParallelizeNestedMap transform(*nested_map, block_size_);
×
NEW
36
                    applicable = transform.can_be_applied(builder, analysis_manager);
×
NEW
37
                }
×
38
                if (applicable) {
2✔
39
                    candidates.push_back(nested_map);
2✔
40
                }
2✔
41
            }
2✔
42
        }
2✔
43
    }
4✔
44

45
    if (candidates.empty()) {
3✔
46
        return false;
1✔
47
    }
1✔
48

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

60
    return true;
2✔
61
}
3✔
62

63
} // namespace passes
64
} // 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