MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / scan_first_launcher

Function scan_first_launcher

src/backend/cuda/kernel/scan_first.hpp:25–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24template<typename Ti, typename To, af_op_t op>
25static void scan_first_launcher(Param<To> out, Param<To> tmp, CParam<Ti> in,
26 const uint blocks_x, const uint blocks_y,
27 const uint threads_x, bool isFinalPass,
28 bool inclusive_scan) {
29 auto scan_first = common::getKernel(
30 "arrayfire::cuda::scan_first", {{scan_first_cuh_src}},
31 TemplateArgs(TemplateTypename<Ti>(), TemplateTypename<To>(),
32 TemplateArg(op), TemplateArg(isFinalPass),
33 TemplateArg(threads_x), TemplateArg(inclusive_scan)),
34 {{DefineValue(THREADS_PER_BLOCK)}});
35
36 dim3 threads(threads_x, THREADS_PER_BLOCK / threads_x);
37 dim3 blocks(blocks_x * out.dims[2], blocks_y * out.dims[3]);
38
39 const int maxBlocksY = getDeviceProp(getActiveDeviceId()).maxGridSize[1];
40 blocks.z = divup(blocks.y, maxBlocksY);
41 blocks.y = divup(blocks.y, blocks.z);
42
43 uint lim = divup(out.dims[0], (threads_x * blocks_x));
44
45 EnqueueArgs qArgs(blocks, threads, getActiveStream());
46 scan_first(qArgs, out, tmp, in, blocks_x, blocks_y, lim);
47 POST_LAUNCH_CHECK();
48}
49
50template<typename To, af_op_t op>
51static void bcast_first_launcher(Param<To> out, CParam<To> tmp,

Callers

nothing calls this directly

Calls 6

TemplateArgsFunction · 0.85
TemplateArgClass · 0.85
getActiveStreamFunction · 0.85
scan_firstFunction · 0.70
getKernelFunction · 0.50
getActiveDeviceIdFunction · 0.50

Tested by

no test coverage detected