| 28 | namespace kernel { |
| 29 | template<typename T> |
| 30 | static void get_out_idx(cl::Buffer *out_data, Param &otmp, Param &rtmp, |
| 31 | Param &in, uint threads_x, uint groups_x, |
| 32 | uint groups_y) { |
| 33 | using cl::EnqueueArgs; |
| 34 | using cl::NDRange; |
| 35 | using std::string; |
| 36 | using std::vector; |
| 37 | |
| 38 | ToNumStr<T> toNumStr; |
| 39 | vector<TemplateArg> tmpltArgs = { |
| 40 | TemplateTypename<T>(), |
| 41 | }; |
| 42 | vector<string> compileOpts = { |
| 43 | DefineKeyValue(T, dtype_traits<T>::getName()), |
| 44 | DefineKeyValue(ZERO, toNumStr(scalar<T>(0))), |
| 45 | DefineKeyValue(CPLX, iscplx<T>()), |
| 46 | }; |
| 47 | compileOpts.emplace_back(getTypeBuildDefinition<T>()); |
| 48 | |
| 49 | auto getIdx = common::getKernel("get_out_idx", {{where_cl_src}}, tmpltArgs, |
| 50 | compileOpts); |
| 51 | |
| 52 | NDRange local(threads_x, THREADS_PER_GROUP / threads_x); |
| 53 | NDRange global(local[0] * groups_x * in.info.dims[2], |
| 54 | local[1] * groups_y * in.info.dims[3]); |
| 55 | |
| 56 | uint lim = divup(otmp.info.dims[0], (threads_x * groups_x)); |
| 57 | |
| 58 | getIdx(EnqueueArgs(getQueue(), global, local), *out_data, *otmp.data, |
| 59 | otmp.info, *rtmp.data, rtmp.info, *in.data, in.info, groups_x, |
| 60 | groups_y, lim); |
| 61 | CL_DEBUG_FINISH(getQueue()); |
| 62 | } |
| 63 | |
| 64 | template<typename T> |
| 65 | static void where(Param &out, Param &in) { |
nothing calls this directly
no test coverage detected