Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arrayfire/arrayfire-haskell
Haskell bindings to ArrayFire
https://github.com/arrayfire/arrayfire-haskell
array gpu haskell image-processing linear-algebra statistics visualization
Last synced: about 3 hours ago
JSON representation
Haskell bindings to ArrayFire
- Host: GitHub
- URL: https://github.com/arrayfire/arrayfire-haskell
- Owner: arrayfire
- License: bsd-3-clause
- Created: 2018-11-16T23:35:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-14T00:02:35.000Z (about 1 month ago)
- Last Synced: 2025-01-13T12:56:47.208Z (8 days ago)
- Topics: array, gpu, haskell, image-processing, linear-algebra, statistics, visualization
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/arrayfire
- Size: 405 KB
- Stars: 60
- Watchers: 9
- Forks: 5
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
##
`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](https://haskell.org) binding to [ArrayFire](https://arrayfire.com).
## Table of Contents
- [Installation](#Installation)
- [Haskell Installation](#haskell-installation)
- [Documentation](#Documentation)
- [Hacking](#Hacking)
- [Example](#Example)## Installation
Install `ArrayFire` via the download page.
- https://arrayfire.com/download/`ArrayFire` can also be fetched from [nixpkgs](https://github.com/nixos/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
- [Hackage](http://hackage.haskell.org/package/arrayfire)
- [ArrayFire](http://arrayfire.org/docs/gettingstarted.htm)## Hacking
To hack on this library locally, complete the installation step above. We recommend installing the [nix](https://nixos.org/nix/download.html) package manager to facilitate development.After the above tools are installed, clone the source from Github.
```bash
git clone [email protected]:arrayfire/arrayfire-haskell.git
cd arrayfire-haskell
```To build and run all tests in response to file changes
```bash
nix-shell --run test-runner
```To perform interactive development w/ `ghcid`
```bash
nix-shell --run ghcid
```To interactively evaluate code in the `repl`
```bash
nix-shell --run repl
```To produce the haddocks and open them in a browser
```bash
nix-shell --run docs
```## Example
```haskell
{-# LANGUAGE TypeApplications, ScopedTypeVariables #-}
module Main whereimport 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-}
```