GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - arrayfire/arrayfire-haskell: Haskell bindings to ArrayFire

BranchesTags
Open more actions menu

Latest commit

 

History

177 Commits
177 Commits

Folders and files

NameName
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

CI Hackage

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
    • Haskell Installation
  • Documentation
  • Hacking
  • Example

Installation

Install ArrayFire via the download page.

  • https://arrayfire.com/download/

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

  • Hackage
  • ArrayFire

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 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

arraygpuhaskellimage-processinglinear-algebrastatisticsvisualization

Resources

Readme
BSD-3-Clause license
Activity
Custom properties

Stars

60 stars

Watchers

7 watching

Forks

5 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.