MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / showResult

Function showResult

examples/gpu_puzzles/key.cpp:24–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24template <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

Callers

nothing calls this directly

Calls 3

dispatchKernelFunction · 0.85
waitFunction · 0.85
toCPUFunction · 0.85

Tested by

no test coverage detected