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

Function puzzle1

examples/gpu_puzzles/run.cpp:48–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46)";
47
48void puzzle1(Context &ctx) {
49 printf("\n\nPuzzle 1\n\n");
50 static constexpr size_t N = 4;
51 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
52 Tensor output = createTensor(ctx, {N}, kf32);
53 Kernel op = createKernel(ctx, {kPuzzle1, N}, Bindings{a, output},
54 /*nWorkgroups */ {1, 1, 1});
55 showResult<N>(ctx, op, output);
56}
57
58// Puzzle 2 : Zip
59// Implement a kernel that adds together each position of a and b and stores it

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected