This page describes how to install Ikra as well as its basic usage.
Before installing Ikra using one of the following two ways, make sure that the following prerequisites are installed on your system.
rvm install ruby-2.3.0
.Before proceeding with the installation, make sure that you have the nvcc
and the include directories required by Ikra: NVIDIA_CUDA-*.*_Samples/common/inc
and cuda-*.*/extras/CUPTI/include
. Ikra will attempt to figure out the paths automatically, but you can also specify them manually later.
If you are interested in using Ikra, this is the easiest way to install it. Follow these steps.
gem install ikra
irb
.
require "ikra"
test_array = Array.pnew(100) do |i|
i + 1000
end
puts test_array[0]
This guide describes how to install the current Ikra version from GitHub. First, make sure that the prerequisites are installed.
Ikra should also work on Mac and Windows, but some modifications in the source code might be necessary. The generated C++/CUDA source code occasionally uses non-standard statement expressions which are only supported by the GNU C compiler.
Follow the these steps.
git clone https://github.com/prg-titech/ikra-ruby.git
git submodule init
, then git submodule update
gem install bundler
bundle install
rake test
If Ikra's autoconfiguration fails, you can set up the nvcc and include paths manually.
require "ikra"
# Set paths before using Ikra
Ikra::Configuration.auto_config = false
Ikra::Configuration.cuda_manual_nvcc = "/usr/local/cuda-8.0/bin/nvcc"
Ikra::Configuration.cuda_manual_common_include = "/home/matthias/NVIDIA_CUDA-7.5_Samples/common/inc"
Ikra::Configuration.cuda_manual_cupti_include = "/usr/local/cuda-7.5/extras/CUPTI/include"
test_array = Array.pnew(100) do |i|
i + 1000
end
# If you want to change paths later, you have to call `Ikra::Configuration.reinitialize!`
puts test_array[0]