Red Arrow GPU - Apache Arrow GPU Ruby

Red Arrow GPU is the Ruby bindings of Apache Arrow GPU. Red Arrow GPU is based on GObject Introspection.

Apache Arrow GPU is an in-memory columnar data store on GPU.

GObject Introspection is a middleware for language bindings of C library. GObject Introspection can generate language bindings automatically at runtime.

Red Arrow GPU uses Apache Arrow GPU GLib and gobject-introspection gem to generate Ruby bindings of Apache Arrow GPU.

Apache Arrow GPU GLib is a C wrapper for Apache Arrow GPU C++. GObject Introspection can't use Apache Arrow GPU C++ directly. Apache Arrow GPU GLib is a bridge between Apache Arrow GPU C++ and GObject Introspection.

gobject-introspection gem is a Ruby bindings of GObject Introspection. Red Arrow GPU uses GObject Introspection via gobject-introspection gem.

Install

Install Apache Arrow GPU GLib before install Red Arrow GPU. Use packages.red-data-tools.org for installing Apache Arrow GPU GLib.

Note that the Apache Arrow GPU GLib packages are "unofficial". "Official" packages will be released in the future.

Install Red Arrow GPU after you install Apache Arrow GPU GLib:

% gem install red-arrow-gpu

Usage

require "arrow-gpu"

manager = ArrowGPU::CUDADeviceManager.new
if manager.n_devices.zero?
  raise "No GPU is found"
end

context = manager[0]
buffer = ArrowGPU::CUDABuffer.new(context, 128)
ArrowGPU::CUDABufferOutputStream.open(buffer) do |stream|
  stream.write("Hello World")
end
puts buffer.copy_to_host(0, 11) # => "Hello World"