Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayFire bindings for Linear Algebra #3

Merged
merged 125 commits into from
Sep 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
f64db84
added initialization tests
prasunanand May 31, 2017
c30155a
blas spec
prasunanand May 31, 2017
110e3e1
add BLAS and LAPACK routines
prasunanand May 31, 2017
1344b33
README
prasunanand May 31, 2017
daa476a
LICENSE
prasunanand May 31, 2017
0666396
install instructions
prasunanand May 31, 2017
8128615
blas test modified
prasunanand Jun 1, 2017
58e0dc8
move blas routines to blas.cpp
prasunanand Jun 1, 2017
32bbd43
move lapack routines to lapack.cpp
prasunanand Jun 1, 2017
46e017c
move arith routines to arith.cpp
prasunanand Jun 1, 2017
a36d638
init routines for CUDA and OpenCL
prasunanand Jun 1, 2017
0e7db4e
init methods for Data
prasunanand Jun 1, 2017
9bd6a6c
init methods for Lapack
prasunanand Jun 1, 2017
0b1a6d1
init methods for Blas
prasunanand Jun 1, 2017
b9c7e56
init methods for Backend
prasunanand Jun 1, 2017
66173b1
init Device functions
prasunanand Jun 1, 2017
026966f
init Algorithm functions
prasunanand Jun 1, 2017
c59de6a
init Random functions
prasunanand Jun 1, 2017
73cc062
add paths to gemspec and modify gem name
prasunanand Jun 22, 2017
9edf6b9
convert info method to singleton method
prasunanand Jun 22, 2017
d6c54cc
concentrating on opencl
prasunanand Jun 22, 2017
fb29b2a
cleanup: remove ndims, array, array2, dimension
prasunanand Jun 28, 2017
359472d
use af_array to store array pointer
prasunanand Jun 28, 2017
aed9306
modify initializer function to store af_array pointer
prasunanand Jun 28, 2017
084fbb7
move around files
prasunanand Jun 28, 2017
babc63c
arith: add elementwise operator declarations
prasunanand Jun 28, 2017
388f662
arith: add elementwise operator definitions
prasunanand Jun 28, 2017
173ccc3
arith: add unary operator declarations
prasunanand Jun 28, 2017
0e28e9e
arith: add unary operator definitions
prasunanand Jun 28, 2017
5177d90
arith: define arith methods for array class
prasunanand Jun 28, 2017
de148e1
blas: implement blas routines
prasunanand Jun 28, 2017
c006d86
cleanup
prasunanand Jun 28, 2017
16fd9d0
more cleanup
prasunanand Jun 28, 2017
8ac0ce7
modify lapack declarations
prasunanand Jun 28, 2017
23593d3
add and load lapack functions
prasunanand Jun 28, 2017
ab2be5f
convert Algorithm methods to class methods
prasunanand Jun 28, 2017
6c7696e
modify declarations for Algorithm methods
prasunanand Jun 28, 2017
a684fae
add and load lapack functions
prasunanand Jun 28, 2017
69dc115
move data functions to data.c
prasunanand Jun 29, 2017
a35f2f4
move random functions to random.c
prasunanand Jun 29, 2017
1b49497
move opencl functions to opencl.c
prasunanand Jun 29, 2017
711f46c
move device functions to device.c
prasunanand Jun 29, 2017
6950524
move cuda functions to cuda.c
prasunanand Jun 29, 2017
d941e7d
move backend functions to backend.c
prasunanand Jun 29, 2017
7de7492
constant: implement Data#constant method
prasunanand Jun 29, 2017
c940258
constant: implement Data#constant_long and Data#constant_ulong method
prasunanand Jun 29, 2017
7161297
constant: implement Data#range and Data#identity method
prasunanand Jun 29, 2017
afd245d
constant: implement Data#diag_create and Data#diag_extract
prasunanand Jun 29, 2017
b3a478f
constant: implement Data methods join, tile, reorder, shift
prasunanand Jun 29, 2017
a2cd98c
constant: implement Data methods flat and flip
prasunanand Jun 29, 2017
31670da
constant: implement Data select methods
prasunanand Jun 29, 2017
e2faf88
constant: implement Data replace methods
prasunanand Jun 29, 2017
9392985
constant: implement Data#lower Data#upper methods
prasunanand Jun 29, 2017
5949de1
adding methods to Af_Array class: initialization
prasunanand Jun 30, 2017
b8bd136
modify names of Af_Array methods
prasunanand Jun 30, 2017
8dbda74
Impement af_array bindings
prasunanand Jun 30, 2017
b643439
add bindings for Index module
prasunanand Jun 30, 2017
8441733
implement to_cpu and ndims method to Af_Array
prasunanand Jun 30, 2017
d158eab
add retain and get_reference bindings
prasunanand Jun 30, 2017
b79ba12
generalize Af_Array#new to accept ndims upto 4
prasunanand Jun 30, 2017
c1fe2db
implement Af_Array singleton methods to crate_array and create_handle
prasunanand Jun 30, 2017
98b8f8a
implemented deep array coppying
prasunanand Jun 30, 2017
f4bf35e
add elementwise comparision operators
prasunanand Jul 7, 2017
a23cd42
added equality operator
prasunanand Jul 7, 2017
4be52d6
use bool array to store result in eqeq
prasunanand Jul 7, 2017
73a8787
modify blas spec
prasunanand Jul 7, 2017
db68dc2
added rspec-its as a dependency
prasunanand Jul 7, 2017
3a0bb7b
modify tests in creation_spec and reauire rspec-its
prasunanand Jul 7, 2017
12ea9bc
dims and elements attributes
prasunanand Jul 7, 2017
e8606c9
added contributing guideline
prasunanand Jul 12, 2017
5efc291
added rdoc task
prasunanand Jul 12, 2017
9e56cb5
switch to minitest
prasunanand Jul 21, 2017
2f30174
modify tests according to minitest
prasunanand Jul 21, 2017
d08b71d
run test after compile
prasunanand Jul 21, 2017
170101d
added arith test
prasunanand Jul 21, 2017
dcf1c54
added algorithm tests
prasunanand Jul 23, 2017
a4b22e4
added more tests
prasunanand Jul 23, 2017
abba793
modify test parameters and add more tests
prasunanand Jul 23, 2017
397f40d
remove unused declarations
prasunanand Jul 23, 2017
a246364
get rid of warnings
prasunanand Jul 23, 2017
8e8ee70
minor modifications
prasunanand Jul 23, 2017
e9576cb
added unary method tests
prasunanand Jul 23, 2017
7d0e5b3
added blas tests
prasunanand Jul 23, 2017
c76214a
added lapack tests
prasunanand Jul 23, 2017
ef6a83f
implemented lapack factorization methods
prasunanand Jul 24, 2017
062b5ac
bind ArrayFire::Backend apis
prasunanand Aug 1, 2017
c368e68
added tests for ArrayFire::Data
prasunanand Aug 1, 2017
b33bf94
init ArrayFire::Statistics class
prasunanand Aug 2, 2017
261bfc4
add statistics methods
prasunanand Aug 2, 2017
66ec7d5
init ArrayFire::Util class
prasunanand Aug 2, 2017
a6d4b0b
Added tests for ArrayFire::Statistics#methods
prasunanand Aug 2, 2017
fe49c82
Implement Random Engine
prasunanand Aug 3, 2017
eb2bcd9
init multiple dtypes
prasunanand Aug 5, 2017
4fc9e5a
pass matrix property as an argument to #matmul
prasunanand Aug 5, 2017
266c154
add more definitions
prasunanand Aug 5, 2017
5dcddf7
pass mat_properties to #matmul and #dot
prasunanand Aug 5, 2017
8514495
arrays and lists for passing symbols
prasunanand Aug 7, 2017
f0a4d3d
add bindings for device module
prasunanand Aug 7, 2017
00f68e5
ArrayFire::Backend bindings
prasunanand Aug 8, 2017
db253e9
added CUDA specific bindings to handle CUDA code
prasunanand Aug 8, 2017
296e61e
added opencl bindings
prasunanand Aug 8, 2017
7e2297e
add comments and headers for Sparse
prasunanand Aug 8, 2017
e080fdd
ArrayFire::Sparse class init
prasunanand Aug 8, 2017
f52d753
move arith functions to arith.c
prasunanand Aug 8, 2017
0a42d5f
sparse array bindings
prasunanand Aug 8, 2017
8a0bc75
init examples
prasunanand Aug 9, 2017
f9e1c6d
added factorization tests for lapack
prasunanand Aug 14, 2017
0a352ec
add solve test
prasunanand Aug 14, 2017
7201e8f
add Util.print_array
prasunanand Aug 16, 2017
2f8d12f
added sync method
prasunanand Aug 16, 2017
3db8864
use doubles as default
prasunanand Aug 16, 2017
fa5c7f1
added eval bindings
prasunanand Aug 16, 2017
d311d00
Random#methods added
prasunanand Aug 17, 2017
b904f0b
added util methods
prasunanand Aug 17, 2017
e415637
complete Sparse bindings
prasunanand Aug 18, 2017
1a370f5
specify type for random engine
prasunanand Aug 18, 2017
e250a84
added NMatrix - ArrayFire interface
prasunanand Aug 21, 2017
faae5dc
device_info
prasunanand Aug 23, 2017
c3b143e
Util.get_version
prasunanand Aug 23, 2017
ae121f5
added Af_Array#to_s method
prasunanand Aug 23, 2017
4bafb2d
gem version and unified backend
prasunanand Aug 26, 2017
9f1f2aa
device multiple returns
prasunanand Aug 26, 2017
70fd885
replace malloc and free with Ruby GC aware mallocs and xfree respecti…
prasunanand Aug 31, 2017
edec567
added exception handling
prasunanand Aug 31, 2017
18fcd08
correct test for sinh
prasunanand Sep 4, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing to ArrayFire

## Reporting Issues

We both value and encourage the community to provide feedback about using ArrayFire and the issues they are facing.
The more detailed the information, the easier it is for the developers to resolve the issue.

Issues can span a variety of topics including:
- Feature requests
- Bug reports
- Build Issues
- Performance improvements
- New hardware / backend support

We use the github [issue tracker](https://github.com/arrayfire/arrayfire-rb/issues?state=open) to track our issues. Technical issues can also be discussed on our [user forum](https://groups.google.com/forum/#!forum/arrayfire-users).

## Contributing Code

If you want to contribute code, we suggest you use the one of the following methods.

- [Using Github](https://github.com/arrayfire/arrayfire-rb/wiki/Contribute-code-using-github)
- [Using Email](https://github.com/arrayfire/arrayfire-rb/wiki/Contribute-code-using-email)

Key areas of code contributions include:
- [New features](https://github.com/arrayfire/arrayfire-rb/issues?q=is%3Aopen+is%3Aissue+label%3Afeature)
- [Bug fixes](https://github.com/arrayfire/arrayfire-rb/labels/bug)
- [Style changes](https://github.com/arrayfire/arrayfire-rb/labels/style)
- [Performance improvements](https://github.com/arrayfire/arrayfire-rb/labels/style)
- [New tests](https://github.com/arrayfire/arrayfire-rb/labels/test)
- New examples!

## ArrayFire Based Projects

You can also contribute to ArrayFire by helping out projects that use ArrayFire! For our part, in addition to the ArrayFire library we are also in the process of adding native bindings for numerous language. We currently support

- [Java](https://github.com/arrayfire/arrayfire_java)
- [R](https://github.com/arrayfire/arrayfire_r)
- [Fortran](https://github.com/arrayfire/arrayfire_fortran)

If you are experienced in any of these languages, you can help us improve these language bindings. If you prefer a different language that is not in the list, dive in and create a new repo!
7 changes: 4 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Copyright (c) 2016, ArrayFire
BSD 3-Clause License

Copyright (c) 2016-2017, Prasun Anand and ArrayFire
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -11,7 +13,7 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of arrayfire-rb nor the names of its
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

Expand All @@ -25,4 +27,3 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
<a href="http://arrayfire.com/"><img src="http://arrayfire.com/logos/arrayfire_logo_whitebkgnd.png" width="300"></a>

ArrayFire is a general-purpose library that simplifies the process of developing
software that targets parallel and massively-parallel architectures including
CPUs, GPUs, and other hardware acceleration devices.

# Ruby wrapper for ArrayFire

[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/arrayfire/arrayfire-ruby)

Ruby bindings are a work in progress and are not production ready yet.

## Build from source
## Installation

```sh
git clone https://github.com/arrayfire/arrayfire-rb
cd arrayfire/
gem install bundler
bundle install
rake compile
```

Run the tests using

```sh
rake test
```

If you want to try out the code without installing:

```sh
rake pry
```

To install:

```sh
rake install
```

# LICENSE

This software is distributed under the [BSD 3-Clause License](LICENSE).

Copyright © 2017, Prasun Anand and ArrayFire
16 changes: 16 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
require "bundler/gem_tasks"
require 'rake'
require 'rake/extensiontask'
require "rake/testtask"
require "rdoc/task"

Rake::ExtensionTask.new do |ext|
ext.name = 'arrayfire'
Expand All @@ -21,3 +24,16 @@ end
def run(*cmd)
sh(cmd.join(' '))
end

RDoc::Task.new do |rdoc|
rdoc.main = "README.md"
rdoc.rdoc_files.include(%w{README.md LICENSE CONTRIBUTING.md lib ext})
end
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this task run if you do a gem build on the gemspec? Is it not possible to add this to the gemspec itself?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v0dro I didn't get the question. Why would we need rdoc to run when using gem build.?

AFAIK, RubyDoc.info automatically generates the docs when I push the gem.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the above rake commands adds rdoc files which are then read by rubygems.org to generate YARD docs. If its not done during gem build and if you forget to run above rake task, the rdoc files will not get added to the gemspec and rubygems wont be able to detect them.

Copy link
Member Author

@prasunanand prasunanand Sep 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v0dro, I will follow Victor's advice about using rubygems-tasks library.


Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList['test/**/*_test.rb']
end

task :default => :test
31 changes: 24 additions & 7 deletions arrayfire.gemspec
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
# coding: utf-8
$:.unshift File.expand_path("../lib", __FILE__)

require 'arrayfire/version.rb'

ArrayFire::DESCRIPTION = <<MSG
ArrayFire is a general-purpose library that simplifies the process of developing
software that targets parallel and massively-parallel architectures including
CPUs, GPUs, and other hardware acceleration devices.
MSG

Gem::Specification.new do |gem|
gem.name = 'ArrayFire'
gem.version = '0.0.0'
gem.name = 'arrayfire'
gem.version = ArrayFire::VERSION
gem.date = '2016-09-29'
gem.summary = 'Ruby wrapper for ArrayFire.'
gem.description = 'Ruby wrapper for ArrayFire.'
gem.description = ArrayFire::DESCRIPTION
gem.authors = ['Prasun Anand']
gem.email = '[email protected]'
gem.files = ['lib/arrayfire.rb']
gem.homepage = 'http://rubygems.org/gems/arrayfire'
gem.license = 'BSD-3-Clause'
gem.add_development_dependency 'rubocop'
gem.extensions = ['ext/mri/extconf.rb']
gem.files = `git ls-files -- ext/mri`.split("\n")
gem.files += `git ls-files -- lib`.split("\n")
gem.require_paths = ["lib"]
gem.add_development_dependency 'rubocop', '~> 0'
gem.add_development_dependency 'bundler', '~>1.6'
gem.add_development_dependency 'json'
gem.add_development_dependency 'json', '~> 0'
gem.add_development_dependency 'pry', '~>0.10'
gem.add_development_dependency 'rake', '~>10.3'
gem.add_development_dependency 'rake-compiler', '~>0.8'
gem.add_development_dependency 'rdoc', '~>4.0', '>=4.0.1'
gem.add_development_dependency 'rspec', '~>2.14'
end
gem.add_development_dependency "minitest", "~> 5.0"

gem.add_development_dependency 'nmatrix', '~> 0.2.1'
end
Empty file added examples/benchmarks/blas.rb
Empty file.
Empty file added examples/benchmarks/cg.rb
Empty file.
Empty file added examples/benchmarks/fft.rb
Empty file.
Empty file added examples/benchmarks/pi.rb
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added examples/lin_algebra/lu.rb
Empty file.
Empty file added examples/lin_algebra/qr.rb
Empty file.
Empty file added examples/lin_algebra/svd.rb
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added examples/pde/swe.rb
Empty file.
Empty file added examples/unified/basic.rb
Empty file.
Loading