Top |
gpointer | context | Write / Construct Only |
gpointer | ipc-memory-handle | Write / Construct Only |
GObject ├── GArrowBuffer │ ├── GArrowMutableBuffer │ │ ╰── GArrowCUDAHostBuffer │ ╰── GArrowCUDABuffer ├── GArrowCUDAContext ├── GArrowCUDADeviceManager ├── GArrowCUDAIPCMemoryHandle ├── GArrowOutputStream │ ╰── GArrowCUDABufferOutputStream ╰── GInputStream ╰── GArrowInputStream ╰── GArrowSeekableInputStream ╰── GArrowBufferInputStream ╰── GArrowCUDABufferInputStream
GArrowCUDABufferInputStream implements GArrowFile and GArrowReadable.
GArrowCUDABufferOutputStream implements GArrowFile and GArrowWritable.
The following classes provide CUDA support for Apache Arrow data.
GArrowCUDADeviceManager is the starting point. You need at least one GArrowCUDAContext to process Apache Arrow data on NVIDIA GPU.
GArrowCUDAContext is a class to keep context for one GPU. You
need to create GArrowCUDAContext for each GPU that you want to
use. You can create GArrowCUDAContext by
garrow_cuda_device_manager_get_context()
.
GArrowCUDABuffer is a class for data on GPU. You can copy data
on GPU to/from CPU by garrow_cuda_buffer_copy_to_host()
and
garrow_cuda_buffer_copy_from_host()
. You can share data on GPU
with other processes by garrow_cuda_buffer_export()
and
garrow_cuda_buffer_new_ipc()
.
GArrowCUDAHostBuffer is a class for data on CPU that is directly accessible from GPU.
GArrowCUDAIPCMemoryHandle is a class to share data on GPU with
other processes. You can export your data on GPU to other processes
by garrow_cuda_buffer_export()
and
garrow_cuda_ipc_memory_handle_new()
. You can import other
process data on GPU by garrow_cuda_ipc_memory_handle_new()
and
garrow_cuda_buffer_new_ipc()
.
GArrowCUDABufferInputStream is a class to read data in GArrowCUDABuffer.
GArrowCUDABufferOutputStream is a class to write data into GArrowCUDABuffer.
GArrowCUDADeviceManager *
garrow_cuda_device_manager_new (GError **error
);
Since: 0.8.0
GArrowCUDAContext * garrow_cuda_device_manager_get_context (GArrowCUDADeviceManager *manager
,gint gpu_number
,GError **error
);
A newly created GArrowCUDAContext on
success, NULL
on error. Contexts for the same GPU device number
share the same data internally.
[transfer full]
Since: 0.8.0
gsize
garrow_cuda_device_manager_get_n_devices
(GArrowCUDADeviceManager *manager
);
Since: 0.8.0
gint64
garrow_cuda_context_get_allocated_size
(GArrowCUDAContext *context
);
Since: 0.8.0
GArrowCUDABuffer * garrow_cuda_buffer_new (GArrowCUDAContext *context
,gint64 size
,GError **error
);
context |
||
size |
The number of bytes to be allocated on GPU device for this context. |
|
error |
[nullable] |
Since: 0.8.0
GArrowCUDABuffer * garrow_cuda_buffer_new_ipc (GArrowCUDAContext *context
,GArrowCUDAIPCMemoryHandle *handle
,GError **error
);
A newly created GArrowCUDABuffer on
success, NULL
on error. The buffer has data from the IPC target.
[transfer full]
Since: 0.8.0
GArrowCUDABuffer * garrow_cuda_buffer_new_record_batch (GArrowCUDAContext *context
,GArrowRecordBatch *record_batch
,GError **error
);
A newly created GArrowCUDABuffer on
success, NULL
on error. The buffer has serialized record batch
data.
[transfer full]
Since: 0.8.0
GBytes * garrow_cuda_buffer_copy_to_host (GArrowCUDABuffer *buffer
,gint64 position
,gint64 size
,GError **error
);
buffer |
||
position |
The offset of memory on GPU device to be copied. |
|
size |
The size of memory on GPU device to be copied in bytes. |
|
error |
[nullable] |
Since: 0.8.0
gboolean garrow_cuda_buffer_copy_from_host (GArrowCUDABuffer *buffer
,const guint8 *data
,gint64 size
,GError **error
);
buffer |
||
data |
Data on CPU host to be copied. |
[array length=size] |
size |
The size of data on CPU host to be copied in bytes. |
|
error |
[nullable] |
Since: 0.8.0
GArrowCUDAIPCMemoryHandle * garrow_cuda_buffer_export (GArrowCUDABuffer *buffer
,GError **error
);
A newly created
GArrowCUDAIPCMemoryHandle to handle the exported buffer on
success, NULL
on error.
[transfer full]
Since: 0.8.0
GArrowCUDAContext *
garrow_cuda_buffer_get_context (GArrowCUDABuffer *buffer
);
A newly created GArrowCUDAContext for the buffer. Contexts for the same buffer share the same data internally.
[transfer full]
Since: 0.8.0
GArrowRecordBatch * garrow_cuda_buffer_read_record_batch (GArrowCUDABuffer *buffer
,GArrowSchema *schema
,GArrowReadOptions *options
,GError **error
);
A newly created GArrowRecordBatch on
success, NULL
on error. The record batch data is located on GPU.
[transfer full]
Since: 0.8.0
GArrowCUDAHostBuffer * garrow_cuda_host_buffer_new (gint gpu_number
,gint64 size
,GError **error
);
A newly created GArrowCUDAHostBuffer on success,
NULL
on error. The allocated memory is accessible from GPU
device for the context
.
Since: 0.8.0
GArrowCUDAIPCMemoryHandle * garrow_cuda_ipc_memory_handle_new (const guint8 *data
,gsize size
,GError **error
);
data |
A serialized GArrowCUDAIPCMemoryHandle. |
[array length=size] |
size |
The size of data. |
|
error |
[nullable] |
Since: 0.8.0
GArrowBuffer * garrow_cuda_ipc_memory_handle_serialize (GArrowCUDAIPCMemoryHandle *handle
,GError **error
);
A newly created GArrowBuffer on success,
NULL
on error. The buffer has serialized handle
. The serialized
handle
can be deserialized by garrow_cuda_ipc_memory_handle_new()
in other process.
[transfer full]
Since: 0.8.0
GArrowCUDABufferInputStream *
garrow_cuda_buffer_input_stream_new (GArrowCUDABuffer *buffer
);
Since: 0.8.0
GArrowCUDABufferOutputStream *
garrow_cuda_buffer_output_stream_new (GArrowCUDABuffer *buffer
);
Since: 0.8.0
gboolean garrow_cuda_buffer_output_stream_set_buffer_size (GArrowCUDABufferOutputStream *stream
,gint64 size
,GError **error
);
TRUE
on success, FALSE
if there was an error.
Sets CPU buffer size. to limit
calls. If CPU buffer
size is cudaMemcpy()
0
, buffering is disabled.
The default is 0
.
Since: 0.8.0
gint64
garrow_cuda_buffer_output_stream_get_buffer_size
(GArrowCUDABufferOutputStream *stream
);
The CPU buffer size in bytes.
See garrow_cuda_buffer_output_stream_set_buffer_size()
for CPU
buffer size details.
Since: 0.8.0
gint64
garrow_cuda_buffer_output_stream_get_buffered_size
(GArrowCUDABufferOutputStream *stream
);
Since: 0.8.0
#define GARROW_CUDA_TYPE_DEVICE_MANAGER (garrow_cuda_device_manager_get_type())
struct GArrowCUDADeviceManagerClass { GObjectClass parent_class; };
#define GARROW_CUDA_TYPE_HOST_BUFFER (garrow_cuda_host_buffer_get_type())
struct GArrowCUDAHostBufferClass { GArrowMutableBufferClass parent_class; };
struct GArrowCUDAIPCMemoryHandleClass { GObjectClass parent_class; };
struct GArrowCUDABufferInputStreamClass { GArrowBufferInputStreamClass parent_class; };
struct GArrowCUDABufferOutputStreamClass { GArrowOutputStreamClass parent_class; };
typedef struct _GArrowCUDABufferInputStream GArrowCUDABufferInputStream;
typedef struct _GArrowCUDABufferOutputStream GArrowCUDABufferOutputStream;