arrayfire-0.4.0.0: Haskell bindings to the ArrayFire general-purpose GPU library

CopyrightDavid Johnson (c) 2019-2020
LicenseBSD 3
MaintainerDavid Johnson <djohnson.m@gmail.com>
StabilityExperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

ArrayFire.Backend

Description

Set and get available ArrayFire Backends.

module Main where

import ArrayFire

main :: IO ()
main = print =<< getAvailableBackends
[CPU,OpenCL]
Synopsis

Documentation

setBackend Source #

Arguments

:: Backend

Backend to use for Array construction

-> IO () 

Set specific Backend to use

>>> setBackend OpenCL
()

getBackendCount :: IO Int Source #

Retrieve count of Backends available

>>> getBackendCount
2

getAvailableBackends :: IO [Backend] Source #

Retrieve available Backends

>>> mapM_ print =<< getAvailableBackends
CPU
OpenCL

getBackend :: Array a -> Backend Source #

Retrieve Backend that specific Array was created from

>>> getBackend (scalar @Double 2.0)
OpenCL

getActiveBackend :: IO Backend Source #

Retrieve active Backend

>>> getActiveBackend
OpenCL

getDeviceID :: Array a -> Int Source #

Retrieve Device ID that Array was created from

>>> getDeviceID (scalar \@Double 2.0)
1