module Data.Array.Accelerate.LLVM.PTX.Link.Object
where
import Data.Array.Accelerate.Lifetime
import Data.ByteString.Short.Char8 ( ShortByteString, unpack )
import Data.List
import qualified Foreign.CUDA.Driver as CUDA
data FunctionTable = FunctionTable { functionTable :: [Kernel] }
data Kernel = Kernel
{ kernelName :: {-# UNPACK #-} !ShortByteString
, kernelFun :: {-# UNPACK #-} !CUDA.Fun
, kernelSharedMemBytes :: {-# UNPACK #-} !Int
, kernelThreadBlockSize :: {-# UNPACK #-} !Int
, kernelThreadBlocks :: (Int -> Int)
}
instance Show FunctionTable where
showsPrec _ f
= showString "<<"
. showString (intercalate "," [ unpack (kernelName k) | k <- functionTable f ])
. showString ">>"
type ObjectCode = Lifetime CUDA.Module