← Winnitude! Search  ·  Reader Mode (793 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 98 LINKS

GitHub - arrayfire/arrayfire-haskell: Haskell bindings to ArrayFire

Repository navigation

arrayfire-haskell
Public

About

Haskell bindings to ArrayFire

hackage.haskell.org/package/arrayfire

Topics

array gpu haskell image-processing linear-algebra statistics visualization

Resources

Readme BSD-3-Clause license Activity Custom properties

Stars

60 stars

Watchers

7 watching

Forks

5 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


177 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.github/ workflows .github/ workflows    
cbits cbits    
doctests doctests    
exe exe    
gen gen    
include include    
nix nix    
src src    
test test    
.ghci .ghci    
.gitignore .gitignore    
CHANGELOG.md CHANGELOG.md    
LICENSE LICENSE    
README.md README.md    
Setup.hs Setup.hs    
arrayfire.cabal arrayfire.cabal    
cabal.project cabal.project    
default.nix default.nix    
flake.lock flake.lock    
flake.nix flake.nix    
pkg.nix pkg.nix    
shell.nix shell.nix    
stack.yaml stack.yaml    
stack.yaml.lock stack.yaml.lock    

Repository files navigation

See hosted Haddock documentation .

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.

Haskell Installation

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

cabal install arrayfire
stack install arrayfire
nix build -L # requires flakes

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 git@github.com:arrayfire/arrayfire-haskell.git
cd arrayfire-haskell

To build and run all tests in response to file changes

nix develop --command cabal test

To perform interactive development w/ ghcid

nix develop --command cabal repl

To interactively evaluate code in the repl

nix develop --command cabal repl

To produce the haddocks and open them in a browser

nix develop --command cabal haddock

Example

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

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

main :: IO ()
main = withArrayFire $ do
  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

-}

About

Haskell bindings to ArrayFire

hackage.haskell.org/package/arrayfire

Topics

array gpu haskell image-processing linear-algebra statistics visualization

Resources

Readme BSD-3-Clause license Activity Custom properties

Stars

60 stars

Watchers

7 watching

Forks

5 forks Report repository

Releases

Packages

Contributors

Languages