module Futhark.CodeGen.OpenCL.Kernels
( SizeHeuristic (..)
, DeviceType (..)
, WhichSize (..)
, HeuristicValue (..)
, sizeHeuristicsTable
)
where
data DeviceType = DeviceCPU | DeviceGPU
data HeuristicValue = HeuristicConst Int
| HeuristicDeviceInfo String
data WhichSize = LockstepWidth | NumGroups | GroupSize | TileSize
data SizeHeuristic =
SizeHeuristic { platformName :: String
, deviceType :: DeviceType
, heuristicSize :: WhichSize
, heuristicValue :: HeuristicValue
}
sizeHeuristicsTable :: [SizeHeuristic]
sizeHeuristicsTable =
[ SizeHeuristic "NVIDIA CUDA" DeviceGPU LockstepWidth $ HeuristicConst 32
, SizeHeuristic "AMD Accelerated Parallel Processing" DeviceGPU LockstepWidth $ HeuristicConst 64
, SizeHeuristic "" DeviceGPU LockstepWidth $ HeuristicConst 1
, SizeHeuristic "" DeviceGPU NumGroups $ HeuristicConst 256
, SizeHeuristic "" DeviceGPU GroupSize $ HeuristicConst 256
, SizeHeuristic "" DeviceGPU TileSize $ HeuristicConst 32
, SizeHeuristic "" DeviceCPU LockstepWidth $ HeuristicConst 1
, SizeHeuristic "" DeviceCPU NumGroups $ HeuristicDeviceInfo "MAX_COMPUTE_UNITS"
, SizeHeuristic "" DeviceCPU GroupSize $ HeuristicConst 32
, SizeHeuristic "" DeviceCPU TileSize $ HeuristicConst 4
]