Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Haskell bindings to ArrayFire

License

NotificationsYou must be signed in to change notification settings

arrayfire/arrayfire-haskell

Repository files navigation

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 aHaskell binding toArrayFire.

Table of Contents

Installation

InstallArrayFire via the download page.

ArrayFire can also be fetched fromnixpkgsmaster.

Haskell Installation

arrayfire can be installed w/cabal,stack ornix.

cabal install arrayfire
stack install arrayfire

Also note, if you plan on using ArrayFire's visualization features, you must installfontconfig andglfw on OSX or Linux.

Documentation

Hacking

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

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

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

nix-shell --run repl

To produce the haddocks and open them in a browser

nix-shell --run docs

Example

{-#LANGUAGE TypeApplications, ScopedTypeVariables #-}moduleMainwhereimportqualifiedArrayFireasAimportControl.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-}

[8]ページ先頭

©2009-2025 Movatter.jp