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

Function toGPU

gpu.hpp:1096–1099  ·  view source on GitHub ↗

* @brief Copies data from CPU memory to a GPU buffer. The toGPU overloads are * effectively a convenience wrapper around the WebGPU API call * wgpuQueueWriteBuffer. * * @param[in] ctx Context instance to manage the operation * @param[in] data Pointer to the CPU memory to copy from * @param[in] buffer WGPUBuffer instance representing the GPU buffer to copy * to * @param[in] size Size of the

Source from the content-addressed store, hash-verified

1094 * @endcode
1095 */
1096inline void toGPU(Context &ctx, const void *data, WGPUBuffer buffer,
1097 size_t size) {
1098 wgpuQueueWriteBuffer(ctx.queue, buffer, 0, data, size);
1099}
1100
1101/**
1102 * @brief Overload of the toGPU function to copy data from CPU memory to a GPU

Callers 3

mainFunction · 0.85
mainFunction · 0.85
createTransformerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected