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

Function getScanFirstKernel

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

Source from the content-addressed store, hash-verified

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

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