| 29 | |
| 30 | template<typename Ti, typename To, af_op_t op> |
| 31 | static 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 | |
| 66 | template<typename Ti, typename To, af_op_t op> |
| 67 | static void scanFirstLauncher(Param &out, Param &tmp, const Param &in, |
nothing calls this directly
no test coverage detected