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

Function select_scalar

src/backend/cuda/kernel/select.hpp:60–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59template<typename T>
60void select_scalar(Param<T> out, CParam<char> cond, CParam<T> a, const T b,
61 int ndims, bool flip) {
62 auto selectScalar = common::getKernel(
63 "arrayfire::cuda::selectScalar", {{select_cuh_src}},
64 TemplateArgs(TemplateTypename<T>(), TemplateArg(flip)));
65
66 dim3 threads(DIMX, DIMY);
67
68 if (ndims == 1) {
69 threads.x *= threads.y;
70 threads.y = 1;
71 }
72
73 int blk_x = divup(out.dims[0], REPEAT * threads.x);
74 int blk_y = divup(out.dims[1], threads.y);
75
76 dim3 blocks(blk_x * out.dims[2], blk_y * out.dims[3]);
77
78 EnqueueArgs qArgs(blocks, threads, getActiveStream());
79
80 selectScalar(qArgs, out, cond, a, b, blk_x, blk_y);
81 POST_LAUNCH_CHECK();
82}
83
84} // namespace kernel
85} // namespace cuda

Callers

nothing calls this directly

Calls 5

TemplateArgsFunction · 0.85
TemplateArgClass · 0.85
getActiveStreamFunction · 0.85
selectScalarFunction · 0.85
getKernelFunction · 0.50

Tested by

no test coverage detected