Skip to main content
deleted 39 characters in body; edited tags; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

New Haskell Packagepackage: OpenCL

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently It currently only get Platformgets platform and Devicedevice info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

Edit: Code smell example 1

I have lots of functions that only change the returned type and the size of the type passed to the C library. But i, but I don't know whohow to fix it.

GitHub

getDeviceInfoUlong :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CLulong)
getDeviceInfoUlong infoid device = alloca $ \(dat :: Ptr CLulong) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CLulong)

getDeviceInfoSizet :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CSize)
getDeviceInfoSizet infoid device = alloca $ \(dat :: Ptr CSize) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CSize)

New Haskell Package: OpenCL

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

Edit: Code smell example 1

I have lots of functions that only change the returned type and the size of the type passed to the C library. But i don't know who to fix.

getDeviceInfoUlong :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CLulong)
getDeviceInfoUlong infoid device = alloca $ \(dat :: Ptr CLulong) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CLulong)

getDeviceInfoSizet :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CSize)
getDeviceInfoSizet infoid device = alloca $ \(dat :: Ptr CSize) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CSize)

New Haskell package: OpenCL

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing. It currently only gets platform and device info from OpenCL.

I have lots of functions that only change the returned type and the size of the type passed to the C library, but I don't know how to fix it.

GitHub

getDeviceInfoUlong :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CLulong)
getDeviceInfoUlong infoid device = alloca $ \(dat :: Ptr CLulong) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CLulong)

getDeviceInfoSizet :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CSize)
getDeviceInfoSizet infoid device = alloca $ \(dat :: Ptr CSize) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CSize)
added 844 characters in body
Source Link
Zhen
  • 265
  • 2
  • 15

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

Edit: Code smell example 1

I have lots of functions that only change the returned type and the size of the type passed to the C library. But i don't know who to fix.

getDeviceInfoUlong :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CLulong)
getDeviceInfoUlong infoid device = alloca $ \(dat :: Ptr CLulong) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CLulong)

getDeviceInfoSizet :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CSize)
getDeviceInfoSizet infoid device = alloca $ \(dat :: Ptr CSize) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CSize)

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

Edit: Code smell example 1

I have lots of functions that only change the returned type and the size of the type passed to the C library. But i don't know who to fix.

getDeviceInfoUlong :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CLulong)
getDeviceInfoUlong infoid device = alloca $ \(dat :: Ptr CLulong) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CLulong)

getDeviceInfoSizet :: CLDeviceInfo_ -> CLDeviceID -> IO (Either CLError CSize)
getDeviceInfoSizet infoid device = alloca $ \(dat :: Ptr CSize) -> do
  whenSuccess (raw_clGetDeviceInfo device infoid size (castPtr dat) nullPtr)
    $ peek dat
    where 
      size = fromIntegral $ sizeOf (0::CSize)
Tweeted twitter.com/#!/StackCodeReview/status/93025807542386689

I doingam developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

I doing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

I am developing a high level OpenCL binding in Haskell, and I need peer-review and testing.

Currently only get Platform and Device info from OpenCL.

http://github.com/zhensydow/opencl

Thanks a lot!

Source Link
Zhen
  • 265
  • 2
  • 15
Loading