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

Function puzzle2

examples/gpu_puzzles/key.cpp:78–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76)";
77
78void puzzle2(Context &ctx) {
79 printf("\n\nPuzzle 2\n\n");
80 static constexpr size_t N = 4;
81 Tensor a = createTensor(ctx, {N}, kf32, makeData<N>().data());
82 Tensor b = createTensor(ctx, {N}, kf32, makeData<N>().data());
83 Tensor output = createTensor(ctx, {N}, kf32);
84 Kernel op = createKernel(ctx, {kPuzzle2, N}, Bindings{a, b, output},
85 {1, 1, 1});
86 showResult<N>(ctx, op, output);
87}
88
89// Puzzle 3 : Guards
90// Implement a kernel that adds 10 to each position of a and stores it in out.

Callers 1

mainFunction · 0.70

Calls 2

createTensorFunction · 0.85
createKernelFunction · 0.85

Tested by

no test coverage detected