| 22 | } |
| 23 | |
| 24 | template <size_t N, size_t R = N, size_t C = 1> void showResult(Context &ctx, Kernel &op, Tensor &output) { |
| 25 | |
| 26 | std::promise<void> promise; |
| 27 | std::future<void> future = promise.get_future(); |
| 28 | dispatchKernel(ctx, op, promise); |
| 29 | std::array<float, R * C> outputArr; |
| 30 | wait(ctx, future); |
| 31 | toCPU(ctx, output, outputArr.data(), sizeof(outputArr)); |
| 32 | printf("%s", show<float, R, C>(outputArr, "output").c_str()); |
| 33 | } |
| 34 | |
| 35 | // Puzzle 1 : Map |
| 36 | // Implement a "kernel" (GPU function) that adds 10 to each position of vector |
nothing calls this directly
no test coverage detected