mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
[Ruby] Rename red-arrow-gpu to red-arrow-cuda
This commit is contained in:
1 parent
267de1b87c
commit
c4f7f3816f
17 files changed
+96
-88
No files matched your search
+9
-1
@@ -23,4 +23,12 @@ There are the official Ruby bindings for Apache Arrow.
|
||||
|
||||
[Red Arrow](https://github.com/apache/arrow/tree/master/ruby/red-arrow) is the base Apache Arrow bindings.
|
||||
|
||||
[Red Arrow GPU](https://github.com/apache/arrow/tree/master/ruby/red-arrow-gpu) is the Apache Arrow bindings of GPU part.
|
||||
[Red Arrow CUDA](https://github.com/apache/arrow/tree/master/ruby/red-arrow-cuda) is the Apache Arrow bindings of CUDA part.
|
||||
|
||||
[Red Gandiva](https://github.com/apache/arrow/tree/master/ruby/red-gandiva) is the Gandiva bindings.
|
||||
|
||||
[Red Plasma](https://github.com/apache/arrow/tree/master/ruby/red-plasma) is the Plasma bindings.
|
||||
|
||||
[Red Parquet](https://github.com/apache/arrow/tree/master/ruby/red-parquet) is the Parquet bindings.
|
||||
|
||||
|
||||
@@ -15,6 +15,6 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
/lib/arrow-gpu/version.rb
|
||||
/lib/arrow-cuda/version.rb
|
||||
|
||||
/pkg/
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,62 @@
|
||||
<!---
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# Red Arrow CUDA - Apache Arrow CUDA Ruby
|
||||
|
||||
Red Arrow CUDA is the Ruby bindings of Apache Arrow CUDA. Red Arrow CUDA is based on GObject Introspection.
|
||||
|
||||
[Apache Arrow CUDA](https://arrow.apache.org/) is an in-memory columnar data store on GPU.
|
||||
|
||||
[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection) is a middleware for language bindings of C library. GObject Introspection can generate language bindings automatically at runtime.
|
||||
|
||||
Red Arrow CUDA uses [Apache Arrow CUDA GLib](https://github.com/apache/arrow/tree/master/c_glib) and [gobject-introspection gem](https://rubygems.org/gems/gobject-introspection) to generate Ruby bindings of Apache Arrow CUDA.
|
||||
|
||||
Apache Arrow CUDA GLib is a C wrapper for [Apache Arrow CUDA C++](https://github.com/apache/arrow/tree/master/cpp). GObject Introspection can't use Apache Arrow CUDA C++ directly. Apache Arrow CUDA GLib is a bridge between Apache Arrow CUDA C++ and GObject Introspection.
|
||||
|
||||
gobject-introspection gem is a Ruby bindings of GObject Introspection. Red Arrow CUDA uses GObject Introspection via gobject-introspection gem.
|
||||
|
||||
## Install
|
||||
|
||||
Install Apache Arrow CUDA GLib before install Red Arrow CUDA. Use [packages.red-data-tools.org](https://github.com/red-data-tools/packages.red-data-tools.org) for installing Apache Arrow CUDA GLib.
|
||||
|
||||
Note that the Apache Arrow CUDA GLib packages are "unofficial". "Official" packages will be released in the future.
|
||||
|
||||
Install Red Arrow CUDA after you install Apache Arrow CUDA GLib:
|
||||
|
||||
```text
|
||||
% gem install red-arrow-cuda
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ruby
|
||||
require "arrow-cuda"
|
||||
|
||||
manager = ArrowCUDA::DeviceManager.new
|
||||
if manager.n_devices.zero?
|
||||
raise "No GPU is found"
|
||||
end
|
||||
|
||||
context = manager[0]
|
||||
buffer = ArrowCUDA::Buffer.new(context, 128)
|
||||
ArrowCUDA::BufferOutputStream.open(buffer) do |stream|
|
||||
stream.write("Hello World")
|
||||
end
|
||||
puts buffer.copy_to_host(0, 11) # => "Hello World"
|
||||
```
|
||||
File renamed without changes.
+3
-3
@@ -33,9 +33,9 @@ end
|
||||
namespace :dependency do
|
||||
desc "Check dependency"
|
||||
task :check do
|
||||
unless PKGConfig.check_version?("arrow-gpu-glib")
|
||||
unless NativePackageInstaller.install(:debian => "libarrow-gpu-glib-dev",
|
||||
:redhat => "arrow-gpu-glib-devel")
|
||||
unless PKGConfig.check_version?("arrow-cuda-glib")
|
||||
unless NativePackageInstaller.install(:debian => "libarrow-cuda-glib-dev",
|
||||
:redhat => "arrow-cuda-glib-devel")
|
||||
exit(false)
|
||||
end
|
||||
end
|
||||
@@ -17,11 +17,11 @@
|
||||
|
||||
require "arrow"
|
||||
|
||||
require "arrow-gpu/version"
|
||||
require "arrow-cuda/version"
|
||||
|
||||
require "arrow-gpu/loader"
|
||||
require "arrow-cuda/loader"
|
||||
|
||||
module ArrowGPU
|
||||
module ArrowCUDA
|
||||
class Error < StandardError
|
||||
end
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
module ArrowGPU
|
||||
class CUDADeviceManager
|
||||
module ArrowCUDA
|
||||
class DeviceManager
|
||||
# Experimental.
|
||||
#
|
||||
# Can we think device manager is a container of contexts?
|
||||
+3
-3
@@ -15,11 +15,11 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
module ArrowGPU
|
||||
module ArrowCUDA
|
||||
class Loader < GObjectIntrospection::Loader
|
||||
class << self
|
||||
def load
|
||||
super("ArrowGPU", ArrowGPU)
|
||||
super("ArrowCUDA", ArrowCUDA)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -29,7 +29,7 @@ module ArrowGPU
|
||||
end
|
||||
|
||||
def require_libraries
|
||||
require "arrow-gpu/cuda-device-manager"
|
||||
require "arrow-cuda/device-manager"
|
||||
end
|
||||
end
|
||||
end
|
||||
+6
-6
@@ -20,11 +20,11 @@
|
||||
require_relative "version"
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "red-arrow-gpu"
|
||||
spec.name = "red-arrow-cuda"
|
||||
version_components = [
|
||||
ArrowGPU::Version::MAJOR.to_s,
|
||||
ArrowGPU::Version::MINOR.to_s,
|
||||
ArrowGPU::Version::MICRO.to_s,
|
||||
ArrowCUDA::Version::MAJOR.to_s,
|
||||
ArrowCUDA::Version::MINOR.to_s,
|
||||
ArrowCUDA::Version::MICRO.to_s,
|
||||
# "beta1",
|
||||
]
|
||||
spec.version = version_components.join(".")
|
||||
@@ -32,9 +32,9 @@ Gem::Specification.new do |spec|
|
||||
spec.authors = ["Apache Arrow Developers"]
|
||||
spec.email = ["dev@arrow.apache.org"]
|
||||
|
||||
spec.summary = "Red Arrow GPU is the Ruby bindings of Apache Arrow GPU"
|
||||
spec.summary = "Red Arrow CUDA is the Ruby bindings of Apache Arrow CUDA"
|
||||
spec.description =
|
||||
"Apache Arrow GPU is a common in-memory columnar data store on GPU. " +
|
||||
"Apache Arrow CUDA is a common in-memory columnar data store on CUDA. " +
|
||||
"It's useful to share and process large data."
|
||||
spec.license = "Apache-2.0"
|
||||
spec.files = ["README.md", "Rakefile", "Gemfile", "#{spec.name}.gemspec"]
|
||||
@@ -18,6 +18,6 @@
|
||||
require_relative "../../red-arrow/version"
|
||||
require_relative "../version"
|
||||
|
||||
require "arrow-gpu"
|
||||
require "arrow-cuda"
|
||||
|
||||
require "test-unit"
|
||||
File renamed without changes.
@@ -17,7 +17,7 @@
|
||||
|
||||
class TestCUDA < Test::Unit::TestCase
|
||||
def setup
|
||||
@manager = ArrowGPU::CUDADeviceManager.new
|
||||
@manager = ArrowCUDA::DeviceManager.new
|
||||
omit("At least one GPU is required") if @manager.n_devices.zero?
|
||||
@context = @manager[0]
|
||||
end
|
||||
@@ -25,11 +25,11 @@ class TestCUDA < Test::Unit::TestCase
|
||||
sub_test_case("BufferOutputStream") do
|
||||
def setup
|
||||
super
|
||||
@buffer = ArrowGPU::CUDABuffer.new(@context, 128)
|
||||
@buffer = ArrowCUDA::Buffer.new(@context, 128)
|
||||
end
|
||||
|
||||
def test_new
|
||||
ArrowGPU::CUDABufferOutputStream.open(@buffer) do |stream|
|
||||
ArrowCUDA::BufferOutputStream.open(@buffer) do |stream|
|
||||
stream.write("Hello World")
|
||||
end
|
||||
assert_equal("Hello World", @buffer.copy_to_host(0, 11).to_s)
|
||||
@@ -20,7 +20,7 @@ require "pathname"
|
||||
version_rb_path = Pathname.new(__FILE__)
|
||||
base_dir = version_rb_path.dirname
|
||||
pom_xml_path = base_dir.join("..", "..", "java", "pom.xml")
|
||||
lib_version_rb_path = base_dir.join("lib", "arrow-gpu", "version.rb")
|
||||
lib_version_rb_path = base_dir.join("lib", "arrow-cuda", "version.rb")
|
||||
|
||||
need_update = false
|
||||
if not lib_version_rb_path.exist?
|
||||
@@ -53,7 +53,7 @@ if need_update
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
module ArrowGPU
|
||||
module ArrowCUDA
|
||||
module Version
|
||||
MAJOR = #{major}
|
||||
MINOR = #{minor}
|
||||
@@ -68,4 +68,4 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
require_relative "lib/arrow-gpu/version"
|
||||
require_relative "lib/arrow-cuda/version"
|
||||
@@ -1,62 +0,0 @@
|
||||
<!---
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# 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](https://arrow.apache.org/) is an in-memory columnar data store on GPU.
|
||||
|
||||
[GObject Introspection](https://wiki.gnome.org/action/show/Projects/GObjectIntrospection) 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](https://github.com/apache/arrow/tree/master/c_glib) and [gobject-introspection gem](https://rubygems.org/gems/gobject-introspection) to generate Ruby bindings of Apache Arrow GPU.
|
||||
|
||||
Apache Arrow GPU GLib is a C wrapper for [Apache Arrow GPU C++](https://github.com/apache/arrow/tree/master/cpp). 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](https://github.com/red-data-tools/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:
|
||||
|
||||
```text
|
||||
% gem install red-arrow-gpu
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```ruby
|
||||
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"
|
||||
```
|
||||
Reference in new issue
Block a user