Skip to content

Commit

Permalink
Call clSetKernelArg with the integer-type defined in the header-file …
Browse files Browse the repository at this point in the history
…instead of always using CULong
  • Loading branch information
dybber committed Jul 18, 2013
1 parent f5b1c8a commit ed2f53b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Foreign/OpenCL/Bindings/Kernel.chs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ setKernelArg :: Kernel -> Int -> KernelArg -> IO ()
setKernelArg kernel n param =
withForeignPtr kernel $ \k ->
withPtr param $ \param_ptr -> do
err <- {# call unsafe clSetKernelArg #} k (fromIntegral n) (size param) param_ptr
err <- {# call unsafe clSetKernelArg #} k (fromIntegral n) (fromIntegral $ size param) param_ptr
case toEnum $ fromIntegral err of
InvalidArgSize -> error $ "ClInvalidArgSize occurred in call to: clSetKernelArg. Argument #"
++ show n ++ " was set to size " ++ show (size param)
Expand Down

0 comments on commit ed2f53b

Please sign in to comment.