Giter Site home page Giter Site logo

arrayfire-lua's Introduction

Arrayfire Lua Bindings

ArrayFire is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU devices. This project provides Lua bindings for the ArrayFire library.

The wrapper is currently compliant with ArrayFire 3.2 API (and higher). If you find any bugs, please report them here.

Example

local AF = require("arrayfire")

AF.main(function()
      local x = AF.randu(5, "f32")
      AF.print("x", x)
      AF.print("min of x", AF.min(x))
      AF.print("max of x", AF.max(x))
end)
$ lua examples/lua/helloworld/intro.lua
ArrayFire v3.2.1 (CUDA, 64-bit Linux, build f263db0)
Platform: CUDA Toolkit 7.5, Driver: 358.16
[0] GeForce GTX 690, 2047 MB, CUDA Compute 3.0
-1- GeForce GTX 690, 2048 MB, CUDA Compute 3.0

x
[5 1 1 1]
0.7402
0.9210
0.0390
0.9690
0.9251

min of x
[1 1 1 1]
0.0390
max of x
[1 1 1 1]
0.9690

Documentation

TODO

Getting Started

Requirements

  • cmake
  • Visual Studio on Windows, clang / gcc on Linux / OSX.

Get ArrayFire libraries

You can install ArrayFire using one of the following two ways.

Post Installation Instructions

  • Please read the wiki page for setting up the proper environment variables.

Building the Lua module

Windows

  1. Launch cmake-gui. Set source and build directories.
  2. Press configure.
  3. Select generator as Visual Studio 12 2013 Win64.
    • You can choose a different generator as long as it is Win64.
  4. Set CMAKE_INSTALL_PREFIX to a location of choice.
  5. Press generate. The generated visual studio solution file will be present in the build directory.
  6. Open the VS solution file and build the INSTALL project.

Linux / OSX

  1. Make sure the environment variable ArrayFire_DIR is set to /path/to/arrayfire/share/ArrayFire/cmake.
  2. Create a build directory and cd into it.
  3. Run cmake /path/to/arrayfire-lua/ -DCMAKE_INSTALL_PREFIX=package.
  4. Run make

Setting up Lua paths

Windows

> SET LUA_PATH=C:\path\to\install\location\arrayfire\?.lua;;
> SET LUA_CPATH=C:\path\to\install\location\?.dll;;
> lua.exe helloworld/helloworld.lua

Linux

$ export LUA_PATH="/path/to/install/location/arrayfire/?.lua;;"
$ export LUA_CPATH="/path/to/install/location/?.so;;"
$ lua helloworld/helloworld.lua

You should now be good to go!

Issues

This is a work in progress and is not intended for production use.

Acknowledgements

This project began with significant contributions from Steven Johnson. It is currently being maintained by @arrayfire/lua-devel team.

arrayfire-lua's People

Contributors

ggcrunchy avatar pavanky avatar shehzan10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arrayfire-lua's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.