MCPcopy Create free account
hub / github.com/apache/arrow / garrow_cuda_buffer_new

Function garrow_cuda_buffer_new

c_glib/arrow-cuda-glib/cuda.cpp:273–285  ·  view source on GitHub ↗

* garrow_cuda_buffer_new: * @context: A #GArrowCUDAContext. * @size: The number of bytes to be allocated on GPU device for this context. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (transfer full): A newly created #GArrowCUDABuffer on * success, %NULL on error. * * Since: 0.8.0 */

Source from the content-addressed store, hash-verified

271 * Since: 0.8.0
272 */
273GArrowCUDABuffer *
274garrow_cuda_buffer_new(GArrowCUDAContext *context, gint64 size, GError **error)
275{
276 auto arrow_context = garrow_cuda_context_get_raw(context);
277 auto arrow_buffer_result = arrow_context->Allocate(size);
278 if (garrow::check(error, arrow_buffer_result, "[cuda][buffer][new]")) {
279 std::shared_ptr<arrow::cuda::CudaBuffer> arrow_buffer =
280 std::move(*arrow_buffer_result);
281 return garrow_cuda_buffer_new_raw(&arrow_buffer);
282 } else {
283 return NULL;
284 }
285}
286
287/**
288 * garrow_cuda_buffer_new_ipc:

Callers

nothing calls this directly

Calls 4

checkFunction · 0.50
AllocateMethod · 0.45

Tested by

no test coverage detected