Making OpenCL? Simple with Haskell - AMD Developer Central
Making OpenCL? Simple with Haskell - AMD Developer Central Making OpenCL? Simple with Haskell - AMD Developer Central
MAPPING OPENCL STATIC VALUES class Const t u | t -> u where value :: t -> u 30 | Making OpenCL Simple | January, 2011 | Public data Platform_ type Platform = Ptr Platform_ type CLPlatformInfo = Word32 data PlatformInfo t where PlatformProfile :: PlatformInfo String PlatformVersion :: PlatformInfo String PlatformName :: PlatformInfo String PlatformVendor :: PlatformInfo String PlatformExtensions :: PlatformInfo String instance Const (PlatformInfo t) CLPlatformInfo where value PlatformProfile = 0x0900 value PlatformVersion = 0x0901 value PlatformName = 0x0902 value PlatformVendor = 0x0903 value PlatformExtensions = 0x0904
MAPPING OPENCL API getPlatforms :: IO [Platform] getPlatforms = appendingLocation "getPlatforms" $ getCountedArray clGetPlatformIDs getPlatformInfo :: Platform -> PlatformInfo u -> IO u getPlatformInfo platform plInf = case plInf of PlatformProfile -> get PlatformVersion -> get PlatformName -> get PlatformVendor -> get PlatformExtensions -> get where get = appendingLocation "getPlatformInfo" $ getString (clGetPlatformInfo platform (value plInf)) 31 | Making OpenCL Simple | January, 2011 | Public
- Page 1 and 2: Making OpenCL Simple with Haskell B
- Page 3 and 4: AGENDA Motivation Whistle stop intr
- Page 5 and 6: OPENCL PROGRAM STRUCTURE 5 | Making
- Page 7 and 8: HELLO WORLD OPENCL C SOURCE __const
- Page 9 and 10: HELLO WORLD - HOST PROGRAM // creat
- Page 11 and 12: USING HASKELL OUR GOAL IS TO WRITE
- Page 13 and 14: LEARN FROM COMMON USES In OpenCL w
- Page 15 and 16: IT’S A HETEROGENEOUS WORLD A mod
- Page 17 and 18: OPENCL EXECUTION MODEL An OpenCL a
- Page 19 and 20: THE BIG IDEA BEHIND OPENCL OpenCL e
- Page 21 and 22: OPENCL MEMORY MODEL •Private Memo
- Page 23 and 24: OPENCL SUMMARY __kernel void dp_mul
- Page 25 and 26: PROGRAMMING KERNELS: OPENCL C Deri
- Page 27 and 28: PROGRAMMING KERNELS: DATA TYPES Sca
- Page 29: THE BASICS - HELLO WORLD main = do
- Page 33 and 34: Lifting to something more in the sp
- Page 35 and 36: MOVE TO AN IMPLICIT MODEL 35 | Maki
- Page 37 and 38: CONTEXTUAL/QUEUED MONADS Function l
- Page 39 and 40: EMBEDDING MONADS In fact, the only
- Page 41 and 42: 41 | Making OpenCL Simple | January
- Page 43 and 44: HELLO WORLD REVISITED import Langua
- Page 45 and 46: REALLY WE WOULD LIKE TO WRITE impor
- Page 47 and 48: WHAT WE REALLY WANT Build a delaye
- Page 49 and 50: Issues we face using Haskell at AMD
- Page 51 and 52: USING HASKELL AT AMD Many Universi
- Page 53: DISCLAIMER The information presente
MAPPING OPENCL STATIC VALUES<br />
class Const t u | t -> u<br />
where value :: t -> u<br />
30 | <strong>Making</strong> <strong>OpenCL</strong> <strong>Simple</strong> | January, 2011 | Public<br />
data Platform_<br />
type Platform = Ptr Platform_<br />
type CLPlatformInfo = Word32<br />
data PlatformInfo t<br />
where PlatformProfile :: PlatformInfo String<br />
PlatformVersion :: PlatformInfo String<br />
PlatformName :: PlatformInfo String<br />
PlatformVendor :: PlatformInfo String<br />
PlatformExtensions :: PlatformInfo String<br />
instance Const (PlatformInfo t) CLPlatformInfo<br />
where value PlatformProfile = 0x0900<br />
value PlatformVersion = 0x0901<br />
value PlatformName = 0x0902<br />
value PlatformVendor = 0x0903<br />
value PlatformExtensions = 0x0904