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

daisytuner / docc / 28809522800

06 Jul 2026 05:12PM UTC coverage: 62.882% (-0.08%) from 62.96%
28809522800

Pull #843

github

web-flow
Merge beb5b23d7 into 95ea95f1f
Pull Request #843: adds type_ids for Element classes and a human-readable element_type

413 of 587 new or added lines in 121 files covered. (70.36%)

74 existing lines in 6 files now uncovered.

40564 of 64508 relevant lines covered (62.88%)

961.48 hits per line

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

54.72
/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) {}
6✔
17

18
bool GPUTilingPass::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 tiling targets
26
    std::vector<structured_control_flow::StructuredLoop*> candidates;
6✔
27
    auto& users = analysis_manager.get<analysis::Users>();
6✔
28

29
    // Find targets for normal loop tiling
30
    for (auto* map : maps_) {
16✔
31
        for (auto* descendant : loop_analysis.descendants(map)) {
16✔
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 (auto& use : users_view.reads()) {
10✔
40
                auto element = use->element();
10✔
41
                if (!dynamic_cast<data_flow::AccessNode*>(element)) {
10✔
42
                    continue;
8✔
43
                }
8✔
44
                auto access_node = dynamic_cast<data_flow::AccessNode*>(element);
2✔
45
                if (transformations::KernelLocalStorage::
2✔
46
                        is_candidate(*struc_loop, access_node->data(), builder, analysis_manager)) {
2✔
47
                    has_kls_candidate = true;
×
48
                    break;
×
49
                }
×
50
            }
2✔
51
            if (!has_kls_candidate) continue;
2✔
52

53
            transformations::LoopTiling tiling(*struc_loop, tile_size_);
×
54
            if (tiling.can_be_applied(builder, analysis_manager)) {
×
55
                candidates.push_back(struc_loop);
×
56
            }
×
57
        }
×
58
    }
16✔
59

60
    std::vector<structured_control_flow::StructuredLoop*> tilable_loops;
6✔
61

62
    for (auto* map : candidates) {
6✔
63
        for (auto* descendant : loop_analysis.descendants(map)) {
×
NEW
64
            if (auto* target_loop = dynamic_cast<structured_control_flow::StructuredLoop*>(descendant)) {
×
65
                transformations::GPUTiling tiling(*target_loop, tile_size_);
×
66
                if (tiling.can_be_applied(builder, analysis_manager)) {
×
67
                    tilable_loops.push_back(target_loop);
×
68
                }
×
69
            }
×
70
        }
×
71
    }
×
72

73
    if (tilable_loops.empty()) {
6✔
74
        return false;
6✔
75
    }
6✔
76

77
    // Phase 2: Apply all tilings
78
    for (auto* target_loop : tilable_loops) {
×
79
        transformations::GPUTiling tiling(*target_loop, tile_size_);
×
80
        tiling.apply(builder, analysis_manager);
×
81
    }
×
82

83
    return true;
×
84
}
6✔
85

86
} // namespace passes
87
} // 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