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

Function getScanDimKernel

src/backend/opencl/kernel/scan_dim.hpp:30–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace kernel {
29template<typename Ti, typename To, af_op_t op>
30static opencl::Kernel getScanDimKernel(const std::string key, int dim,
31 bool isFinalPass, uint threads_y,
32 bool inclusiveScan) {
33 using std::string;
34 using std::vector;
35
36 ToNumStr<To> toNumStr;
37 vector<TemplateArg> tmpltArgs = {
38 TemplateTypename<Ti>(),
39 TemplateTypename<To>(),
40 TemplateArg(dim),
41 TemplateArg(isFinalPass),
42 TemplateArg(op),
43 TemplateArg(threads_y),
44 TemplateArg(inclusiveScan),
45 };
46 vector<string> compileOpts = {
47 DefineKeyValue(Ti, dtype_traits<Ti>::getName()),
48 DefineKeyValue(To, dtype_traits<To>::getName()),
49 DefineKeyValue(T, "To"),
50 DefineKeyValue(kDim, dim),
51 DefineKeyValue(DIMY, threads_y),
52 DefineValue(THREADS_X),
53 DefineKeyValue(init, toNumStr(common::Binary<To, op>::init())),
54 DefineKeyFromStr(binOpName<op>()),
55 DefineKeyValue(CPLX, iscplx<Ti>()),
56 DefineKeyValue(IS_FINAL_PASS, (isFinalPass ? 1 : 0)),
57 DefineKeyValue(INCLUSIVE_SCAN, inclusiveScan),
58 };
59 compileOpts.emplace_back(getTypeBuildDefinition<Ti>());
60
61 return common::getKernel(key, {{ops_cl_src, scan_dim_cl_src}}, tmpltArgs,
62 compileOpts);
63}
64
65template<typename Ti, typename To, af_op_t op>
66static void scanDimLauncher(Param out, Param tmp, const Param in, int dim,

Callers

nothing calls this directly

Calls 4

TemplateArgClass · 0.85
getNameFunction · 0.85
initFunction · 0.50
getKernelFunction · 0.50

Tested by

no test coverage detected