• 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

48.94
/opt/src/passes/offloading/gpu_tiling_pass.cpp
1
#include "sdfg/passes/offloading/gpu_tiling_pass.h"
2

3
#include "sdfg/analysis/loop_analysis.h"
4
#include "sdfg/analysis/users.h"
5
#include "sdfg/structured_control_flow/structured_loop.h"
6
#include "sdfg/targets/cuda/cuda.h"
7
#include "sdfg/targets/rocm/rocm.h"
8
#include "sdfg/transformations/loop_tiling.h"
9
#include "sdfg/transformations/offloading/gpu_tiling.h"
10
#include "sdfg/transformations/offloading/kernel_local_storage.h"
11

12
namespace sdfg {
13
namespace passes {
14

15
GPUTilingPass::GPUTilingPass(const std::vector<structured_control_flow::Map*>& maps, size_t tile_size)
16
    : maps_(maps), tile_size_(tile_size) {}
3✔
17

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

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

25
    // Phase 1: Collect all applicable tiling targets
26
    std::vector<structured_control_flow::StructuredLoop*> candidates;
3✔
27
    auto& users = analysis_manager.get<analysis::Users>();
3✔
28

29
    // Find targets for normal loop tiling
30
    for (auto* map : maps_) {
4✔
31
        for (auto* descendant : loop_analysis.descendants(map)) {
4✔
32
            auto* struc_loop = dynamic_cast<structured_control_flow::StructuredLoop*>(descendant);
2✔
33
            if (!struc_loop) continue;
2✔
34

35

36
            // Pre-filter: check if any container used in the loop is a KLS candidate
37
            analysis::UsersView users_view(users, struc_loop->root());
2✔
38
            bool has_kls_candidate = false;
2✔
39
            for (const auto& container : users_view.all_containers_in_order()) {
6✔
40
                if (transformations::KernelLocalStorage::is_candidate(*struc_loop, container, builder, analysis_manager)) {
6✔
NEW
41
                    has_kls_candidate = true;
×
NEW
42
                    break;
×
NEW
43
                }
×
44
            }
6✔
45
            if (!has_kls_candidate) continue;
2✔
46

NEW
47
            transformations::LoopTiling tiling(*struc_loop, tile_size_);
×
NEW
48
            if (tiling.can_be_applied(builder, analysis_manager)) {
×
NEW
49
                candidates.push_back(struc_loop);
×
NEW
50
            }
×
NEW
51
        }
×
52
    }
4✔
53

54
    std::vector<structured_control_flow::StructuredLoop*> tilable_loops;
3✔
55

56
    for (auto* map : candidates) {
3✔
NEW
57
        for (auto* descendant : loop_analysis.descendants(map)) {
×
NEW
58
            if (auto* target_loop = dynamic_cast<structured_control_flow::StructuredLoop*>(descendant)) {
×
NEW
59
                transformations::GPUTiling tiling(*target_loop, tile_size_);
×
NEW
60
                if (tiling.can_be_applied(builder, analysis_manager)) {
×
NEW
61
                    tilable_loops.push_back(target_loop);
×
NEW
62
                }
×
NEW
63
            }
×
NEW
64
        }
×
NEW
65
    }
×
66

67
    if (tilable_loops.empty()) {
3✔
68
        return false;
3✔
69
    }
3✔
70

71
    // Phase 2: Apply all tilings
NEW
72
    for (auto* target_loop : tilable_loops) {
×
NEW
73
        transformations::GPUTiling tiling(*target_loop, tile_size_);
×
NEW
74
        tiling.apply(builder, analysis_manager);
×
NEW
75
    }
×
76

NEW
77
    return true;
×
78
}
3✔
79

80
} // namespace passes
81
} // 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