Repa的所有約簡函數都可以折回與數組內容相同的類型。例如: foldAllP :: (Shape sh, Source r a, Elt a, Unbox a, Monad m) => (a -> a -> a) -> a -> Array r sh a -> m a
foldAllS :: (Shape sh, Source r a, Elt a, Unbox a) => (a -> a -
我想在repa-io使用writeImageToBMP將陣列寫入BMP文件之前將加速陣列轉換爲repa陣列。忽略加速中存在這樣一個函數的事實,我只是用它作爲問題的一個例子。採取: {-# LANGUAGE ScopedTypeVariables #-}
import qualified Data.Array.Accelerate.Interpreter as A (run)
import Da
我已經使用Cabal for GHC 7.10.2安裝了Vector包和REPA。運行這個程序: import qualified Data.Array.Repa as R
import qualified Data.Vector.Unboxed as U
main = print $ R.fromUnboxed (R.Z R.:. 16 R.:. 16) (U.replicate 10 0