| 26 | |
| 27 | template<typename T> |
| 28 | Array<T> exampleFunction(const Array<T> &a, const Array<T> &b, |
| 29 | const af_someenum_t method) { |
| 30 | dim4 outputDims; // this should be '= in.dims();' in most cases |
| 31 | // but would definitely depend on the type of |
| 32 | // algorithm you are implementing. |
| 33 | |
| 34 | Array<T> out = createEmptyArray<T>(outputDims); |
| 35 | // Please use the create***Array<T> helper |
| 36 | // functions defined in Array.hpp to create |
| 37 | // different types of Arrays. Please check the |
| 38 | // file to know what are the different types you |
| 39 | // can create. |
| 40 | |
| 41 | // Enqueue the function call on the worker thread |
| 42 | // This code will be present in src/backend/cpu/kernel/exampleFunction.hpp |
| 43 | getQueue().enqueue(kernel::exampleFunction<T>, out, a, b, method); |
| 44 | |
| 45 | return out; // return the result |
| 46 | } |
| 47 | |
| 48 | #define INSTANTIATE(T) \ |
| 49 | template Array<T> exampleFunction<T>(const Array<T> &a, const Array<T> &b, \ |