import Data.Array.Repa
import Data.Vector.Unboxed hiding(zipWith)
import Prelude hiding(zipWith,replicate)
dotp :: Array U DIM1 Float -> Array U DIM1 Float -> IO Float
dotp x y = sumAllP $ zipWith (*) x y
x = fromUnboxed (Z:.20000000) $ replicate 20000000 1
y = fromUnboxed (Z:.20000000) $ replicate 20000000 1
main = (dotp x y) >>= print
编译ghc -O2 -threaded test.hs
但是,当我执行可执行文件时./test +RTS -N1
结果是1.6777216e7
同时./test +RTS -N2
或具有更多核心,
结果是正确的:2.0e7
我的代码有什么问题?