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

Function garrow_cuda_host_buffer_new

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

* garrow_cuda_host_buffer_new: * @gpu_number: A GPU device number for the target context. * @size: The number of bytes to be allocated on CPU host. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: A newly created #GArrowCUDAHostBuffer on success, * %NULL on error. The allocated memory is accessible from GPU * device for the @context. * * Since: 0.8.0 */

Source from the content-addressed store, hash-verified

499 * Since: 0.8.0
500 */
501GArrowCUDAHostBuffer *
502garrow_cuda_host_buffer_new(gint gpu_number, gint64 size, GError **error)
503{
504 auto arrow_manager = arrow::cuda::CudaDeviceManager::Instance();
505 auto arrow_buffer = (*arrow_manager)->AllocateHost(gpu_number, size);
506 if (garrow::check(error, arrow_buffer, "[cuda][host-buffer][new]")) {
507 return garrow_cuda_host_buffer_new_raw(&(*arrow_buffer));
508 } else {
509 return NULL;
510 }
511}
512
513typedef struct GArrowCUDAIPCMemoryHandlePrivate_
514{

Callers

nothing calls this directly

Calls 3

checkFunction · 0.50
AllocateHostMethod · 0.45

Tested by

no test coverage detected