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

daisytuner / docc / 27325952678

10 Jun 2026 03:49PM UTC coverage: 61.108% (-0.08%) from 61.191%
27325952678

push

github

web-flow
Merge pull request #747 from daisytuner/memcpyOnDevice

Translate CPU memcpy to GPU memcpy

41 of 149 new or added lines in 6 files covered. (27.52%)

2 existing lines in 2 files now uncovered.

36048 of 58991 relevant lines covered (61.11%)

747.87 hits per line

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

72.03
/opt/src/targets/cuda/plugin.cpp
1
#include "sdfg/targets/cuda/plugin.h"
2

3

4
namespace sdfg::cuda {
5

6
void register_cuda_plugin(plugins::Context& context) {
1✔
7
    auto& libNodeDispatcherRegistry = context.library_node_dispatcher_registry;
1✔
8
    auto& mapDispatcherRegistry = context.map_dispatcher_registry;
1✔
9
    auto& libNodeSerRegistry = context.library_node_serializer_registry;
1✔
10

11
    mapDispatcherRegistry.register_map_dispatcher(
1✔
12
        ScheduleType_CUDA::value(),
1✔
13
        [](codegen::LanguageExtension& language_extension,
1✔
14
           StructuredSDFG& sdfg,
1✔
15
           analysis::AnalysisManager& analysis_manager,
1✔
16
           structured_control_flow::Map& node,
1✔
17
           codegen::InstrumentationPlan& instrumentation_plan,
1✔
18
           codegen::ArgCapturePlan& arg_capture_plan) {
4✔
19
            return std::make_unique<CUDAMapDispatcher>(
4✔
20
                language_extension, sdfg, analysis_manager, node, instrumentation_plan, arg_capture_plan
4✔
21
            );
4✔
22
        }
4✔
23
    );
1✔
24

25
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
26
        cuda::LibraryNodeType_CUDA_Offloading.value() + "::" + data_flow::ImplementationType_NONE.value(),
1✔
27
        [](codegen::LanguageExtension& language_extension,
1✔
28
           const Function& function,
1✔
29
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
30
           const data_flow::LibraryNode& node) {
2✔
31
            return std::make_unique<
2✔
32
                cuda::CUDADataOffloadingNodeDispatcher>(language_extension, function, data_flow_graph, node);
2✔
33
        }
2✔
34
    );
1✔
35

36
    libNodeSerRegistry.register_library_node_serializer(cuda::LibraryNodeType_CUDA_Offloading.value(), []() {
8✔
37
        return std::make_unique<cuda::CUDADataOffloadingNodeSerializer>();
8✔
38
    });
8✔
39

40

41
    // Dot - CUBLAS with data transfers
42
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
43
        math::blas::LibraryNodeType_DOT.value() + "::" + cuda::ImplementationType_CUDAWithTransfers.value(),
1✔
44
        [](codegen::LanguageExtension& language_extension,
1✔
45
           const Function& function,
1✔
46
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
47
           const data_flow::LibraryNode& node) {
1✔
48
            return std::make_unique<blas::DotNodeDispatcher_CUBLASWithTransfers>(
×
49
                language_extension, function, data_flow_graph, dynamic_cast<const math::blas::DotNode&>(node)
×
50
            );
×
51
        }
×
52
    );
1✔
53
    // Dot - CUBLAS without data transfers
54
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
55
        math::blas::LibraryNodeType_DOT.value() + "::" + cuda::ImplementationType_CUDAWithoutTransfers.value(),
1✔
56
        [](codegen::LanguageExtension& language_extension,
1✔
57
           const Function& function,
1✔
58
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
59
           const data_flow::LibraryNode& node) {
1✔
60
            return std::make_unique<blas::DotNodeDispatcher_CUBLASWithoutTransfers>(
×
61
                language_extension, function, data_flow_graph, dynamic_cast<const math::blas::DotNode&>(node)
×
62
            );
×
63
        }
×
64
    );
1✔
65

66
    // GEMM - CUBLAS with data transfers
67
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
68
        math::blas::LibraryNodeType_GEMM.value() + "::" + cuda::ImplementationType_CUDAWithTransfers.value(),
1✔
69
        [](codegen::LanguageExtension& language_extension,
1✔
70
           const Function& function,
1✔
71
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
72
           const data_flow::LibraryNode& node) {
1✔
73
            return std::make_unique<blas::GEMMNodeDispatcher_CUBLASWithTransfers>(
×
74
                language_extension, function, data_flow_graph, dynamic_cast<const math::blas::GEMMNode&>(node)
×
75
            );
×
76
        }
×
77
    );
1✔
78
    // GEMM - CUBLAS without data transfers
79
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
80
        math::blas::LibraryNodeType_GEMM.value() + "::" + cuda::ImplementationType_CUDAWithoutTransfers.value(),
1✔
81
        [](codegen::LanguageExtension& language_extension,
1✔
82
           const Function& function,
1✔
83
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
84
           const data_flow::LibraryNode& node) {
1✔
85
            return std::make_unique<blas::GEMMNodeDispatcher_CUBLASWithoutTransfers>(
×
86
                language_extension, function, data_flow_graph, dynamic_cast<const math::blas::GEMMNode&>(node)
×
87
            );
×
88
        }
×
89
    );
1✔
90

91
    // BatchedGEMM - CUBLAS with data transfers
92
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
93
        math::blas::LibraryNodeType_BatchedGEMM.value() + "::" + cuda::ImplementationType_CUDAWithTransfers.value(),
1✔
94
        [](codegen::LanguageExtension& language_extension,
1✔
95
           const Function& function,
1✔
96
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
97
           const data_flow::LibraryNode& node) {
1✔
98
            return std::make_unique<blas::BatchedGEMMNodeDispatcher_CUBLASWithTransfers>(
×
99
                language_extension, function, data_flow_graph, dynamic_cast<const math::blas::BatchedGEMMNode&>(node)
×
100
            );
×
101
        }
×
102
    );
1✔
103
    // BatchedGEMM - CUBLAS without data transfers
104
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
105
        math::blas::LibraryNodeType_BatchedGEMM.value() + "::" + cuda::ImplementationType_CUDAWithoutTransfers.value(),
1✔
106
        [](codegen::LanguageExtension& language_extension,
1✔
107
           const Function& function,
1✔
108
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
109
           const data_flow::LibraryNode& node) {
1✔
110
            return std::make_unique<blas::BatchedGEMMNodeDispatcher_CUBLASWithoutTransfers>(
×
111
                language_extension, function, data_flow_graph, dynamic_cast<const math::blas::BatchedGEMMNode&>(node)
×
112
            );
×
113
        }
×
114
    );
1✔
115

116

117
    // Memset - CUDA with data transfers
118
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
119
        sdfg::stdlib::LibraryNodeType_Memset.value() + "::" + cuda::ImplementationType_CUDAWithTransfers.value(),
1✔
120
        [](codegen::LanguageExtension& language_extension,
1✔
121
           const Function& function,
1✔
122
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
123
           const data_flow::LibraryNode& node) {
1✔
124
            return std::make_unique<cuda::stdlib::MemsetNodeDispatcher_CUDAWithTransfers>(
×
125
                language_extension, function, data_flow_graph, dynamic_cast<const sdfg::stdlib::MemsetNode&>(node)
×
126
            );
×
127
        }
×
128
    );
1✔
129
    // Memset - CUDA without data transfers
130
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
131
        sdfg::stdlib::LibraryNodeType_Memset.value() + "::" + cuda::ImplementationType_CUDAWithoutTransfers.value(),
1✔
132
        [](codegen::LanguageExtension& language_extension,
1✔
133
           const Function& function,
1✔
134
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
135
           const data_flow::LibraryNode& node) {
1✔
136
            return std::make_unique<cuda::stdlib::MemsetNodeDispatcher_CUDAWithoutTransfers>(
×
137
                language_extension, function, data_flow_graph, dynamic_cast<const sdfg::stdlib::MemsetNode&>(node)
×
138
            );
×
139
        }
×
140
    );
1✔
141

142

143
    // Memcpy - CUDA with data transfers
144
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
145
        sdfg::stdlib::LibraryNodeType_Memcpy.value() + "::" + cuda::ImplementationType_CUDAWithTransfers.value(),
1✔
146
        [](codegen::LanguageExtension& language_extension,
1✔
147
           const Function& function,
1✔
148
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
149
           const data_flow::LibraryNode& node) {
1✔
NEW
150
            return std::make_unique<cuda::stdlib::MemcpyNodeDispatcher_CUDAWithTransfers>(
×
NEW
151
                language_extension, function, data_flow_graph, dynamic_cast<const sdfg::stdlib::MemcpyNode&>(node)
×
NEW
152
            );
×
NEW
153
        }
×
154
    );
1✔
155
    // Memcpy - CUDA without data transfers
156
    libNodeDispatcherRegistry.register_library_node_dispatcher(
1✔
157
        sdfg::stdlib::LibraryNodeType_Memcpy.value() + "::" + cuda::ImplementationType_CUDAWithoutTransfers.value(),
1✔
158
        [](codegen::LanguageExtension& language_extension,
1✔
159
           const Function& function,
1✔
160
           const data_flow::DataFlowGraph& data_flow_graph,
1✔
161
           const data_flow::LibraryNode& node) {
1✔
NEW
162
            return std::make_unique<cuda::stdlib::MemcpyNodeDispatcher_CUDAWithoutTransfers>(
×
NEW
163
                language_extension, function, data_flow_graph, dynamic_cast<const sdfg::stdlib::MemcpyNode&>(node)
×
NEW
164
            );
×
NEW
165
        }
×
166
    );
1✔
167

168

169
    context.scheduler_registry
1✔
170
        .register_loop_scheduler<passes::scheduler::CUDAScheduler>(passes::scheduler::CUDAScheduler::target());
1✔
171
}
1✔
172

173
} // namespace sdfg::cuda
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