-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathexec_utils_graph_launch.hpp
More file actions
626 lines (551 loc) · 18 KB
/
exec_utils_graph_launch.hpp
File metadata and controls
626 lines (551 loc) · 18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018-2022, Lawrence Livermore National Security, LLC.
//
// Produced at the Lawrence Livermore National Laboratory
//
// LLNL-CODE-758885
//
// All rights reserved.
//
// This file is part of Comb.
//
// For details, see https://github.com/LLNL/Comb
// Please also see the LICENSE file for MIT license.
//////////////////////////////////////////////////////////////////////////////
#ifndef _GRAPH_LAUNCH_HPP
#define _GRAPH_LAUNCH_HPP
#include "config.hpp"
#ifdef COMB_ENABLE_CUDA_GRAPH
// cuda 10.1 and higher have graph kernel node set params
#if CUDART_VERSION >= 10010
#define COMB_HAVE_CUDA_GRAPH_KERNEL_NODE_SET_PARAMS
#endif
// cuda 10.2 and higher have graph update
#if CUDART_VERSION >= 10020
#define COMB_HAVE_CUDA_GRAPH_UPDATE
#endif
#include "ExecContext.hpp"
#include "exec_utils.hpp"
#include "exec_utils_cuda.hpp"
#include <vector>
#include <assert.h>
// enable empty nodes at the begin and end of each graph instead of allowing disconnected components
// #define COMB_GRAPH_BEGIN_END_NODES
// enable launching kernels immediately instead of creating graphs
// #define COMB_GRAPH_KERNEL_LAUNCH
// enable launching kernels immediately into per component streams
// #define COMB_GRAPH_KERNEL_LAUNCH_COMPONENT_STREAMS
namespace cuda {
namespace graph_launch {
namespace detail {
struct Graph
{
struct Event
{
Graph* graph = nullptr;
};
Graph()
: m_launched(false)
, m_event_recorded(false)
, m_event_created(false)
, m_instantiated_num_nodes(false)
, m_num_nodes(0)
, m_ref(1)
, m_num_events(0)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).Graph\n", this );
createGraph();
}
// no copy construction
Graph(Graph const&) = delete;
Graph(Graph &&) = delete;
// no copy assignment
Graph& operator=(Graph const&) = delete;
Graph& operator=(Graph &&) = delete;
int inc()
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).inc %i\n", this, m_ref+1 );
return ++m_ref;
}
int dec()
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).dec %i\n", this, m_ref );
return --m_ref;
}
void add_event(Event* event, cudaStream_t stream)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).add_event(%p) stream(%p)\n", this, event, (void*)stream );
assert(event != nullptr);
assert(event->graph == this);
inc();
m_num_events++;
assert(m_num_events > 0);
if (m_launched) {
createRecordEvent(stream);
}
}
bool query_event(Event* event)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).query_event(%p)\n", this, event );
assert(event != nullptr);
assert(event->graph == this);
assert(m_num_events > 0);
if (!m_launched) return false;
assert(m_event_recorded);
// LOGPRINTF("cuda::graph_launch::Graph(%p).query_event(%p) cudaEventQuery(%p)\n", this, event, &m_event );
bool done = cudaCheckReady(cudaEventQuery(m_event));
// LOGPRINTF("cuda::graph_launch::Graph(%p).query_event(%p) cudaEventQuery(%p) -> %s\n", this, event, &m_event, (done ? "true" : "false"));
return done;
}
void wait_event(Event* event)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).wait_event(%p) %p\n", this, event );
assert(event != nullptr);
assert(event->graph == this);
assert(m_num_events > 0);
assert(m_launched);
assert(m_event_recorded);
// LOGPRINTF("cuda::graph_launch::Graph(%p).wait_event(%p) cudaEventSynchronize(%p)\n", this, event, &m_event );
cudaCheck(cudaEventSynchronize(m_event));
// LOGPRINTF("cuda::graph_launch::Graph(%p).wait_event(%p) cudaEventSynchronize(%p) -> done\n", this, event, &m_event );
}
int remove_event(Event* event)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).remove_event(%p)\n", this, event );
assert(event != nullptr);
assert(event->graph == this);
assert(m_num_events > 0);
m_num_events--;
return dec();
}
void enqueue(cudaKernelNodeParams& params)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).enqueue %p grid(%i,%i,%i) block(%i,%i,%i) shmem(%zu) params(%p) extra(%p)\n", this, params.func, (int)params.gridDim.x, (int)params.gridDim.y, (int)params.gridDim.z, (int)params.blockDim.x, (int)params.blockDim.y, (int)params.blockDim.z, (size_t)params.sharedMemBytes, params.kernelParams, params.extra );
#ifndef COMB_GRAPH_KERNEL_LAUNCH
assert(!m_launched);
if (m_num_nodes < m_nodes.size()) {
if (m_num_nodes < m_instantiated_num_nodes) {
#if defined(COMB_HAVE_CUDA_GRAPH_KERNEL_NODE_SET_PARAMS) && !defined(COMB_HAVE_CUDA_GRAPH_UPDATE)
// LOGPRINTF("cuda::graph_launch::Graph(%p).enqueue cudaGraphExecKernelNodeSetParams(%p, %p)\n", this, &m_graphExec, &m_nodes[m_num_nodes] );
cudaCheck(cudaGraphExecKernelNodeSetParams(m_graphExec, m_nodes[m_num_nodes], ¶ms));
#endif
} else {
assert(0 && (m_num_nodes < m_instantiated_num_nodes));
}
#ifdef COMB_HAVE_CUDA_GRAPH_UPDATE
// LOGPRINTF("cuda::graph_launch::Graph(%p).enqueue cudaGraphKernelNodeSetParams(%p, %p)\n", this, &m_graph, &m_nodes[m_num_nodes] );
cudaCheck(cudaGraphKernelNodeSetParams(m_nodes[m_num_nodes], ¶ms));
#endif
} else {
assert(m_num_nodes == m_nodes.size());
m_nodes.emplace_back();
#ifdef COMB_GRAPH_BEGIN_END_NODES
const cudaGraphNode_t* dependencies = &m_node_begin;
int num_dependencies = 1;
#else
const cudaGraphNode_t* dependencies = nullptr;
int num_dependencies = 0;
#endif
// LOGPRINTF("cuda::graph_launch::Graph(%p).enqueue cudaGraphAddKernelNode(%p)\n", this, &m_graph );
cudaCheck(cudaGraphAddKernelNode(&m_nodes[m_num_nodes], m_graph, dependencies, num_dependencies, ¶ms));
// LOGPRINTF("cuda::graph_launch::Graph(%p).enqueue cudaGraphAddKernelNode(%p) -> %p\n", this, &m_graph, &m_nodes[m_num_nodes] );
}
#endif
m_num_nodes++;
}
void update(cudaStream_t stream)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).update\n", this );
// NVTX_RANGE_COLOR(NVTX_CYAN)
if (!m_launched) {
if (m_instantiated_num_nodes != m_num_nodes) {
if (m_instantiated_num_nodes > 0) {
#ifndef COMB_GRAPH_KERNEL_LAUNCH
// LOGPRINTF("cuda::graph_launch::Graph(%p).update cudaGraphExecDestroy(%p)\n", this, &m_graphExec );
cudaCheck(cudaGraphExecDestroy(m_graphExec));
#ifdef COMB_GRAPH_BEGIN_END_NODES
cudaCheck(cudaGraphDestroyNode(m_node_end));
#endif
for (int i = m_num_nodes; i < m_nodes.size(); ++i) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).update cudaGraphDestroyNode(%p)\n", this, &m_nodes[i] );
cudaCheck(cudaGraphDestroyNode(m_nodes[i]));
}
m_nodes.resize(m_num_nodes);
#endif
m_instantiated_num_nodes = 0;
}
#ifndef COMB_GRAPH_KERNEL_LAUNCH
#ifdef COMB_GRAPH_BEGIN_END_NODES
// add end node depending on all kernel nodes
cudaCheck(cudaGraphAddEmptyNode(&m_node_end, m_graph, &m_nodes[0], m_num_nodes));
#endif
// LOGPRINTF("cuda::graph_launch::Graph(%p).update cudaGraphInstantiate(%p)\n", this, &m_graph );
cudaGraphNode_t errorNode;
constexpr size_t bufferSize = 1024;
char logBuffer[bufferSize] = "";
cudaCheck(cudaGraphInstantiate(&m_graphExec, m_graph, &errorNode, logBuffer, bufferSize));
#endif
m_instantiated_num_nodes = m_num_nodes;
// LOGPRINTF("cuda::graph_launch::Graph(%p).update cudaGraphInstantiate(%p) -> %p\n", this, &m_graph, &m_graphExec );
}
#ifndef COMB_GRAPH_KERNEL_LAUNCH
#ifdef COMB_HAVE_CUDA_GRAPH_UPDATE
else if (m_instantiated_num_nodes > 0) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).update cudaGraphExecUpdate(%p, %p)\n", this, &m_graph, &m_graphExec );
cudaGraphNode_t errorNode;
cudaGraphExecUpdateResult result;
cudaCheck(cudaGraphExecUpdate(m_graphExec, m_graph, &errorNode, &result));
}
#endif
#endif
}
}
void launch(cudaStream_t stream)
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).launch\n", this );
// NVTX_RANGE_COLOR(NVTX_CYAN)
if (!m_launched) {
#ifndef COMB_GRAPH_KERNEL_LAUNCH
// LOGPRINTF("cuda::graph_launch::Graph(%p).launch cudaGraphLaunch(%p) stream(%p)\n", this, &m_graphExec, (void*)stream );
cudaCheck(cudaGraphLaunch(m_graphExec, stream));
#endif
if (m_num_events > 0) {
createRecordEvent(stream);
}
m_launched = true;
}
}
void reuse()
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).reuse\n", this );
assert(m_num_events == 0);
m_event_recorded = false;
m_launched = false;
m_num_nodes = 0;
#if !(defined(COMB_HAVE_CUDA_GRAPH_KERNEL_NODE_SET_PARAMS) || defined(COMB_HAVE_CUDA_GRAPH_UPDATE))
destroyGraph();
createGraph();
#endif
}
bool launchable() const
{
return !m_launched && m_num_nodes > 0;
}
~Graph()
{
// LOGPRINTF("cuda::graph_launch::Graph(%p).~Graph\n", this );
assert(m_ref == 0);
assert(m_num_events == 0);
if (m_event_created) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).~Graph cudaEventDestroy(%p)\n", this, &m_event );
cudaCheck(cudaEventDestroy(m_event));
}
destroyGraph();
}
private:
#ifndef COMB_GRAPH_KERNEL_LAUNCH
std::vector<cudaGraphNode_t> m_nodes;
#ifdef COMB_GRAPH_BEGIN_END_NODES
cudaGraphNode_t m_node_begin;
cudaGraphNode_t m_node_end;
#endif
cudaGraph_t m_graph;
cudaGraphExec_t m_graphExec;
#endif
cudaEvent_t m_event;
bool m_launched;
bool m_event_recorded;
bool m_event_created;
int m_instantiated_num_nodes;
int m_num_nodes;
int m_ref;
int m_num_events;
void createRecordEvent(cudaStream_t stream)
{
if (!m_event_created) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).createRecordEvent cudaEventCreateWithFlags()\n", this );
cudaCheck(cudaEventCreateWithFlags(&m_event, cudaEventDisableTiming));
// LOGPRINTF("cuda::graph_launch::Graph(%p).createRecordEvent cudaEventCreateWithFlags() -> %p\n", this, &m_event );
m_event_created = true;
}
if (!m_event_recorded) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).createRecordEvent cudaEventRecord(%p) stream(%p)\n", this, &m_event, (void*)stream );
cudaCheck(cudaEventRecord(m_event, stream));
m_event_recorded = true;
}
}
void createGraph()
{
#ifndef COMB_GRAPH_KERNEL_LAUNCH
// LOGPRINTF("cuda::graph_launch::Graph(%p).createGraph cudaGraphCreate()\n", this );
cudaCheck(cudaGraphCreate(&m_graph, 0));
// LOGPRINTF("cuda::graph_launch::Graph(%p).createGraph cudaGraphCreate() -> %p\n", this, &m_graph );
#ifdef COMB_GRAPH_BEGIN_END_NODES
// insert begin node
cudaCheck(cudaGraphAddEmptyNode(&m_node_begin, m_graph, nullptr, 0));
#endif
#endif
}
void destroyGraph()
{
#ifndef COMB_GRAPH_KERNEL_LAUNCH
if (m_instantiated_num_nodes > 0) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).destroyGraph cudaGraphExecDestroy(%p)\n", this, &m_graphExec );
cudaCheck(cudaGraphExecDestroy(m_graphExec));
}
#ifdef COMB_GRAPH_BEGIN_END_NODES
if (m_nodes.size() > 0) {
cudaCheck(cudaGraphDestroyNode(m_node_begin));
}
if (m_instantiated_num_nodes > 0) {
cudaCheck(cudaGraphDestroyNode(m_node_end));
}
#endif
for (int i = 0; i < m_nodes.size(); ++i) {
// LOGPRINTF("cuda::graph_launch::Graph(%p).destroyGraph cudaGraphDestroyNode(%p)\n", this, &m_nodes[i] );
cudaCheck(cudaGraphDestroyNode(m_nodes[i]));
}
m_nodes.clear();
m_num_nodes = 0;
m_instantiated_num_nodes = 0;
m_launched = false;
// LOGPRINTF("cuda::graph_launch::Graph(%p).destroyGraph cudaGraphDestroy(%p)\n", this, &m_graph );
cudaCheck(cudaGraphDestroy(m_graph));
#endif
}
};
} // namespace detail
struct component
{
#ifdef COMB_GRAPH_KERNEL_LAUNCH_COMPONENT_STREAMS
::CudaContext m_con;
#else
void* data = nullptr;
#endif
};
struct group
{
detail::Graph* graph = nullptr;
};
inline group create_group()
{
// graph starts at ref count 1
group g{};
g.graph = new detail::Graph{};
return g;
}
inline void destroy_group(group g)
{
if (g.graph && g.graph->dec() <= 0) {
delete g.graph;
}
}
inline group& get_group()
{
static group g{};
return g;
}
inline group& get_active_group()
{
group& g = get_group();
if (g.graph == nullptr) {
g = create_group();
}
return g;
}
inline void new_active_group()
{
destroy_group(get_group());
get_group().graph = nullptr;
}
inline void set_active_group(group g)
{
if (g.graph != get_group().graph) {
destroy_group(get_group());
get_group() = g;
if (get_group().graph != nullptr) {
get_group().graph->inc();
}
}
if (get_group().graph != nullptr) {
get_group().graph->reuse();
}
}
using event_type = detail::Graph::Event*;
inline event_type createEvent()
{
// create event pointing to invalid graph iterator
return new detail::Graph::Event();
}
inline void recordEvent(event_type& event, cudaStream_t stream = 0)
{
assert(get_group().graph != nullptr);
assert(event->graph == nullptr || event->graph == get_group().graph);
event->graph = get_group().graph;
if (event->graph) {
event->graph->add_event(event, stream);
}
}
inline bool queryEvent(event_type& event)
{
if (event->graph == nullptr) return true;
bool done = event->graph->query_event(event);
if (done) {
if (event->graph->remove_event(event) <= 0) {
delete event->graph;
}
event->graph = nullptr;
}
return done;
}
inline void waitEvent(event_type& event)
{
if (event->graph == nullptr) return;
event->graph->wait_event(event);
if (event->graph->remove_event(event) <= 0) {
delete event->graph;
}
event->graph = nullptr;
}
inline void destroyEvent(event_type& event)
{
if (event->graph == nullptr) return;
if (event->graph->remove_event(event) <= 0) {
delete event->graph;
}
event->graph = nullptr;
delete event;
}
// Ensure the current graph launched (actually launches graph)
inline void force_launch(cudaStream_t stream = 0)
{
// NVTX_RANGE_COLOR(NVTX_CYAN)
if (get_group().graph != nullptr && get_group().graph->launchable()) {
get_group().graph->update(stream);
get_group().graph->launch(stream);
new_active_group();
}
}
// Wait for graph to finish running
inline void synchronize(cudaStream_t stream = 0)
{
// NVTX_RANGE_COLOR(NVTX_CYAN)
force_launch(stream);
// perform synchronization
cudaCheck(cudaStreamSynchronize(stream));
}
template < typename body_type >
__global__
void graph_for_all(IdxT len, body_type body)
{
const IdxT i = threadIdx.x + blockIdx.x * blockDim.x;
if (i < len) {
body(i);
}
}
template <typename body_type>
inline void for_all(int len, body_type&& body
#ifdef COMB_GRAPH_KERNEL_LAUNCH
, cudaStream_t stream
#endif
)
{
using decayed_body_type = typename std::decay<body_type>::type;
const IdxT threads = 256;
const IdxT blocks = (len + threads - 1) / threads;
cudaKernelNodeParams params;
params.func = (void*)&graph_for_all<decayed_body_type>;
params.gridDim = dim3{(unsigned int)blocks};
params.blockDim = dim3{(unsigned int)threads};
params.sharedMemBytes = 0;
void* args[]{&len, &body};
params.kernelParams = args;
params.extra = nullptr;
get_active_group().graph->enqueue(params);
#ifdef COMB_GRAPH_KERNEL_LAUNCH
cudaCheck(cudaLaunchKernel(params.func, params.gridDim, params.blockDim, params.kernelParams, params.sharedMemBytes, stream));
#endif
}
template < typename body_type >
__global__
void graph_for_all_2d(IdxT len0, IdxT len1, body_type body)
{
const IdxT i0 = threadIdx.y + blockIdx.y * blockDim.y;
const IdxT i1 = threadIdx.x + blockIdx.x * blockDim.x;
if (i0 < len0) {
if (i1 < len1) {
body(i0, i1);
}
}
}
template < typename body_type >
inline void for_all_2d(IdxT len0, IdxT len1, body_type&& body
#ifdef COMB_GRAPH_KERNEL_LAUNCH
, cudaStream_t stream
#endif
)
{
using decayed_body_type = typename std::decay<body_type>::type;
const IdxT threads0 = 8;
const IdxT threads1 = 32;
const IdxT blocks0 = (len0 + threads0 - 1) / threads0;
const IdxT blocks1 = (len1 + threads1 - 1) / threads1;
cudaKernelNodeParams params;
params.func = (void*)&graph_for_all_2d<decayed_body_type>;
params.gridDim = dim3{(unsigned int)blocks1, (unsigned int)blocks0, (unsigned int)1};
params.blockDim = dim3{(unsigned int)threads1, (unsigned int)threads0, (unsigned int)1};
params.sharedMemBytes = 0;
void* args[]{&len0, &len1, &body};
params.kernelParams = args;
params.extra = nullptr;
get_active_group().graph->enqueue(params);
#ifdef COMB_GRAPH_KERNEL_LAUNCH
cudaCheck(cudaLaunchKernel(params.func, params.gridDim, params.blockDim, params.kernelParams, params.sharedMemBytes, stream));
#endif
}
template < typename body_type >
__global__
void graph_for_all_3d(IdxT len0, IdxT len1, IdxT len2, body_type body)
{
const IdxT i0 = blockIdx.z;
const IdxT i1 = threadIdx.y + blockIdx.y * blockDim.y;
const IdxT i2 = threadIdx.x + blockIdx.x * blockDim.x;
if (i0 < len0) {
if (i1 < len1) {
if (i2 < len2) {
body(i0, i1, i2);
}
}
}
}
template < typename body_type >
inline void for_all_3d(IdxT len0, IdxT len1, IdxT len2, body_type&& body
#ifdef COMB_GRAPH_KERNEL_LAUNCH
, cudaStream_t stream
#endif
)
{
using decayed_body_type = typename std::decay<body_type>::type;
const IdxT threads0 = 1;
const IdxT threads1 = 8;
const IdxT threads2 = 32;
const IdxT blocks0 = (len0 + threads0 - 1) / threads0;
const IdxT blocks1 = (len1 + threads1 - 1) / threads1;
const IdxT blocks2 = (len2 + threads2 - 1) / threads2;
cudaKernelNodeParams params;
params.func =(void*)&graph_for_all_3d<decayed_body_type>;
params.gridDim = dim3{(unsigned int)blocks2, (unsigned int)blocks1, (unsigned int)blocks0};
params.blockDim = dim3{(unsigned int)threads2, (unsigned int)threads1, (unsigned int)threads0};
params.sharedMemBytes = 0;
void* args[]{&len0, &len1, &len2, &body};
params.kernelParams = args;
params.extra = nullptr;
get_active_group().graph->enqueue(params);
#ifdef COMB_GRAPH_KERNEL_LAUNCH
cudaCheck(cudaLaunchKernel(params.func, params.gridDim, params.blockDim, params.kernelParams, params.sharedMemBytes, stream));
#endif
}
} // namespace graph_launch
} // namespace cuda
#endif
#endif // _GRAPH_LAUNCH_HPP