Giter Club home page Giter Club logo

arrayfire-haskell's Introduction

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.

arrayfire-haskell is a Haskell binding to ArrayFire.

Table of Contents

Installation

Install ArrayFire via the download page.

ArrayFire can also be fetched from nixpkgs master.

Haskell Installation

arrayfire can be installed w/ cabal, stack or nix.

cabal install arrayfire
stack install arrayfire

Also note, if you plan on using ArrayFire's visualization features, you must install fontconfig and glfw on OSX or Linux.

Documentation

Hacking

To hack on this library locally, complete the installation step above. We recommend installing the nix package manager to facilitate development.

After the above tools are installed, clone the source from Github.

git clone [email protected]:arrayfire/arrayfire-haskell.git
cd arrayfire-haskell

To build and run all tests in response to file changes

nix-shell --run test-runner

To perform interactive development w/ ghcid

nix-shell --run ghcid

To interactively evaluate code in the repl

nix-shell --run repl

To produce the haddocks and open them in a browser

nix-shell --run docs

Example

{-# LANGUAGE TypeApplications, ScopedTypeVariables #-}
module Main where

import qualified ArrayFire as A
import           Control.Exception (catch)

main :: IO ()
main = print newArray `catch` (\(e :: A.AFException) -> print e)
  where
    newArray = A.matrix @Double (2,2) [ [1..], [1..] ] * A.matrix @Double (2,2) [ [2..], [2..] ]

{-|

ArrayFire Array
[2 2 1 1]
    2.0000     6.0000
    2.0000     6.0000

-}

arrayfire-haskell's People

Contributors

danielkroeni avatar dmjio avatar

Watchers

 avatar  avatar

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.