@tmcdonell Good! Keeping busy. Chasing a toddler around also now. How have you been?
After I posted my question I did see a lot of the modules are still importable (I thought they were hidden from import because they were hidden from haddock). Is acceleratefft the gold standard now for an cuda ffi?
@tmcdonell Hey, thanks! I seem to have gotten it all working based on those two templates, thanks for the help.
I'm also trying to add a native implementation using MWC randoms and wrapping the call to randomArray into a "Par Native (Future (Vector Float))" but the Array types aren't working together. How do I move the Array from Data.Array.Accelerate into the one from Data.Array.Accelerate.Representation.Array?
I'll take a look, thanks.
Hey, yeah, here's a gist https://gist.github.com/fabricatedmath/90e64295975288161c0bdbf8f5662692.
The ptx part compiles and runs just fine, the native is giving the error in the gist
Hi~
I want to wield Accelerate, but I am compiling my project with GHC 9.2.2 and I find that the latest version on Hackage is not up to date but the source repository it. (I infer that from looking at the bounds on base
in the Cabal manifest.) What is the appropriate way for me to get a stable version? Should I clone the master
branch?
iterate
in accelerate? I've tried to use awhile
, but I'm not sure how should I implemented the counter. I've looked at the implementation of the iterate
for Exp
s, but I am somewhat stuck because the awhile
condition wants a Scalar Bool
, and I'm not sure how to create that from the counter (which is packed in a tuple together with the actual array, just like in the iterate
implementation.)
*** Exception:
*** Internal error in package accelerate ***
*** Please submit a bug report at https://github.com/AccelerateHS/accelerate/issues
CUDA Exception: an illegal memory access was encountered
CallStack (from HasCallStack):
internalError: Data.Array.Accelerate.LLVM.PTX.State:53:9
And besides, the docs recommend
It is usually best to keep all intermediate computations in
Acc
, and only run the computation at the very end to produce the final result. This enables optimisations between intermediate results (e.g. array fusion) and, if the target architecture has a separate memory space, as is the case of GPUs, to prevent excessive data transfers.
Acc tree
. the Haskell program loops over the tree, building up an Acc expression that is then run afterwards. hopefully that makes sense...?
src\Data\Array\Accelerate\AST\Idx.hs:42:24: error:
* Couldn't match type: Code m0 (Idx (env0, t0) t0)
with: Q (TExp (Idx (env2, t) t))
Expected: Q (TExp (Idx env t))
Actual: Code m0 (Idx (env0, t0) t0)
* In the Template Haskell quotation [ ZeroIdx ]
In the expression: [ ZeroIdx ]
In an equation for `liftIdx': liftIdx ZeroIdx = [ ZeroIdx ]
* Relevant bindings include
liftIdx :: Idx env t > Q (TExp (Idx env t))
(bound at src\Data\Array\Accelerate\AST\Idx.hs:42:1)

42  liftIdx ZeroIdx = [ ZeroIdx ]
 ^^^^^^^^^^^^^^^
src\Data\Array\Accelerate\AST\Idx.hs:43:24: error:
* Couldn't match type: Code m1 (Idx (env1, s0) t1)
with: Q (TExp (Idx (env2, s) t))
Expected: Q (TExp (Idx env t))
Actual: Code m1 (Idx (env1, s0) t1)
* In the Template Haskell quotation [ SuccIdx $$(liftIdx ix) ]
In the expression: [ SuccIdx $$(liftIdx ix) ]
In an equation for `liftIdx':
liftIdx (SuccIdx ix) = [ SuccIdx $$(liftIdx ix) ]
* Relevant bindings include
ix :: Idx env2 t
(bound at src\Data\Array\Accelerate\AST\Idx.hs:43:18)
liftIdx :: Idx env t > Q (TExp (Idx env t))
(bound at src\Data\Array\Accelerate\AST\Idx.hs:42:1)

43  liftIdx (SuccIdx ix) = [ SuccIdx $$(liftIdx ix) ]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src\Data\Array\Accelerate\AST\Idx.hs:43:39: error:
* Couldn't match expected type: Code m1 (Idx env1 t1)
with actual type: Q (TExp (Idx env2 t))
* In the expression: liftIdx ix
In the Template Haskell splice $$(liftIdx ix)
In the first argument of `SuccIdx', namely `$$(liftIdx ix)'
* Relevant bindings include
ix :: Idx env2 t
(bound at src\Data\Array\Accelerate\AST\Idx.hs:43:18)
liftIdx :: Idx env t > Q (TExp (Idx env t))
(bound at src\Data\Array\Accelerate\AST\Idx.hs:42:1)

43  liftIdx (SuccIdx ix) = [ SuccIdx $$(liftIdx ix) ]
 ^^^^^^^^^^