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

Function ireduceDimLauncher

src/backend/opencl/kernel/ireduce.hpp:33–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template<typename T, af_op_t op>
33void ireduceDimLauncher(Param out, cl::Buffer *oidx, Param in, cl::Buffer *iidx,
34 const int dim, const int threads_y, const bool is_first,
35 const uint groups_all[4], Param rlen) {
36 ToNumStr<T> toNumStr;
37 std::array<TemplateArg, 5> targs = {
38 TemplateTypename<T>(), TemplateArg(dim), TemplateArg(op),
39 TemplateArg(is_first), TemplateArg(threads_y),
40 };
41 std::array<std::string, 9> options = {
42 DefineKeyValue(T, dtype_traits<T>::getName()),
43 DefineKeyValue(kDim, dim),
44 DefineKeyValue(DIMY, threads_y),
45 DefineValue(THREADS_X),
46 DefineKeyValue(init, toNumStr(common::Binary<T, op>::init())),
47 DefineKeyFromStr(binOpName<op>()),
48 DefineKeyValue(CPLX, iscplx<T>()),
49 DefineKeyValue(IS_FIRST, is_first),
50 getTypeBuildDefinition<T>()};
51
52 auto ireduceDim =
53 common::getKernel("ireduce_dim_kernel",
54 {{iops_cl_src, ireduce_dim_cl_src}}, targs, options);
55
56 cl::NDRange local(THREADS_X, threads_y);
57 cl::NDRange global(groups_all[0] * groups_all[2] * local[0],
58 groups_all[1] * groups_all[3] * local[1]);
59
60 ireduceDim(cl::EnqueueArgs(getQueue(), global, local), *out.data, out.info,
61 *oidx, *in.data, in.info, *iidx, groups_all[0], groups_all[1],
62 groups_all[dim], *rlen.data, rlen.info);
63 CL_DEBUG_FINISH(getQueue());
64}
65
66template<typename T, af_op_t op>
67void ireduceDim(Param out, cl::Buffer *oidx, Param in, int dim, Param rlen) {

Callers

nothing calls this directly

Calls 7

TemplateArgClass · 0.85
getNameFunction · 0.85
ireduceDimFunction · 0.85
EnqueueArgsClass · 0.85
initFunction · 0.50
getKernelFunction · 0.50
getQueueFunction · 0.50

Tested by

no test coverage detected