* 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 */
| 271 | * Since: 0.8.0 |
| 272 | */ |
| 273 | GArrowCUDABuffer * |
| 274 | garrow_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: |
nothing calls this directly
no test coverage detected