| 16 | namespace opencl { |
| 17 | template<af_op_t op, typename Ti, typename To> |
| 18 | Array<To> scan(const Array<Ti>& in, const int dim, bool inclusiveScan) { |
| 19 | Array<To> out = createEmptyArray<To>(in.dims()); |
| 20 | |
| 21 | Param Out = out; |
| 22 | Param In = in; |
| 23 | |
| 24 | if (dim == 0) { |
| 25 | kernel::scanFirst<Ti, To, op>(Out, In, inclusiveScan); |
| 26 | } else { |
| 27 | kernel::scanDim<Ti, To, op>(Out, In, dim, inclusiveScan); |
| 28 | } |
| 29 | |
| 30 | return out; |
| 31 | } |
| 32 | |
| 33 | #define INSTANTIATE_SCAN(ROp, Ti, To) \ |
| 34 | template Array<To> scan<ROp, Ti, To>(const Array<Ti>&, const int, bool); |
no test coverage detected