To implement multi-GPU stencil computation using Accelerate

Takayuki Muranushi nushio at
Fri Jul 8 16:52:01 BST 2011

Hi, and thank you.

Sorry for my lazy response. I was devoted into necromancy last month : .
I'm now trying accelerate step by step.

while trying -fpcache option in accelerate, I got the following error.

Loading package fclabels- ... linking ... done.
Loading package extensible-exceptions- ... linking ... done.
Loading package cuda- ... linking ... done.
Loading package binary- ... linking ... done.
Loading package ffi-1.0 ... linking ... done.

Data/Array/Accelerate/CUDA/State.hs:133:11: Not in scope: `</>'

    Not in scope: `createDirectoryIfMissing'

    Not in scope: `canonicalizePath'

Data/Array/Accelerate/CUDA/State.hs:135:15: Not in scope: `</>'

    Not in scope: `doesFileExist'

    Not in scope: `replaceExtension'


This is probably because Data/Array/Accelerate/CUDA/State.hs lacked
the following imports.

import System.FilePath
import System.Directory

I also needed to modify the
unless cached $
from the function `build' to make accelerate generate cache every time.
build :: String -> OpenAcc aenv a -> [AccBinding aenv] -> CIO (AccKernel a)
build name acc fvar =
  let key = accToKey acc
  in do
    liftIO $ hPutStr stderr "build"
    mvar   <- liftIO newEmptyMVar
    table  <- getM kernelTable
    cached <- isJust `fmap` liftIO (Hash.lookup table key)
    unless cached $ compile table key acc fvar
    return . (name,) . liftIO $ memo mvar (link table key)

The Hakubi Center, Kyoto University :

More information about the Accelerate mailing list