You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is just like Debug.Trace works in Haskell, but Haskell's behaviour is because of laziness, whereas Accelerate is strict and hence this behaviour is neither helpful nor terribly intuitive.
Steps to reproduce
{-# LANGUAGE OverloadedStrings #-}
moduleMainwhereimportqualifiedData.Array.AccelerateasAimportqualifiedData.Array.Accelerate.Debug.TraceasAimportqualifiedData.Array.Accelerate.LLVM.NativeasCPUprog::A.Acc (A.VectorInt) ->A.Acc (A.VectorInt)
prog a =A.atrace "second" (A.map (+1) (A.atrace "first" a))
main::IO()
main =print$CPU.runN prog (A.fromList (A.ZA.:.10) [1..10])
This prints:
second
first
Vector (Z :. 10) [2,3,4,5,6,7,8,9,10,11]
Expected behaviour
Get first, then second.
The text was updated successfully, but these errors were encountered:
Description
The implementation of
Atrace
prints the message before the argument (that is passed on) is evaluated:accelerate-llvm/accelerate-llvm/src/Data/Array/Accelerate/LLVM/Execute.hs
Lines 286 to 287 in 2b5d694
This is just like Debug.Trace works in Haskell, but Haskell's behaviour is because of laziness, whereas Accelerate is strict and hence this behaviour is neither helpful nor terribly intuitive.
Steps to reproduce
This prints:
Expected behaviour
Get first, then second.
The text was updated successfully, but these errors were encountered: