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

Function reorder

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

Source from the content-addressed store, hash-verified

21
22template<typename T>
23void reorder(Param<T> out, CParam<T> in, const dim_t *rdims) {
24 constexpr unsigned TX = 32;
25 constexpr unsigned TY = 8;
26 constexpr unsigned TILEX = 512;
27 constexpr unsigned TILEY = 32;
28
29 auto reorder =
30 common::getKernel("arrayfire::cuda::reorder", {{reorder_cuh_src}},
31 TemplateArgs(TemplateTypename<T>()));
32
33 dim3 threads(TX, TY, 1);
34
35 int blocksPerMatX = divup(out.dims[0], TILEX);
36 int blocksPerMatY = divup(out.dims[1], TILEY);
37 dim3 blocks(blocksPerMatX * out.dims[2], blocksPerMatY * out.dims[3], 1);
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 EnqueueArgs qArgs(blocks, threads, getActiveStream());
44
45 reorder(qArgs, out, in, rdims[0], rdims[1], rdims[2], rdims[3],
46 blocksPerMatX, blocksPerMatY);
47 POST_LAUNCH_CHECK();
48}
49
50} // namespace kernel
51} // namespace cuda

Callers

nothing calls this directly

Calls 4

TemplateArgsFunction · 0.85
getActiveStreamFunction · 0.85
getKernelFunction · 0.50
getActiveDeviceIdFunction · 0.50

Tested by

no test coverage detected