 -- Returns 'True' if the function is executed successfully. It returns 'False' 
 -- if event is not a valid event object.
 clReleaseEvent :: CLEvent -> IO Bool
-clReleaseEvent ev = raw_clReleaseEvent ev
-                    >>= return . (==clSuccess) . ErrorCode
+clReleaseEvent ev = wrapCheckSuccess $ raw_clReleaseEvent ev
 
 #c
 enum CLEventInfo {

clWaitForEvents [] = return False
clWaitForEvents xs = allocaArray nevents $ \pevents -> do
  pokeArray pevents xs
  errcode <- fmap ErrorCode $ raw_clWaitForEvents (fromIntegral nevents) pevents
  return (errcode==clSuccess) 
    where
      nevents = length xs
  

(because the command identified by event has not completed), or if event is a 
not a valid event object.
-} 
clGetEventProfilingInfo :: CLEvent -> CLProfilingInfo -> IO (Either CLError CLulong)
clGetEventProfilingInfo ev prof = wrapGetInfo (\(dat :: Ptr CLulong) 
                                               -> raw_clGetEventProfilingInfo ev infoid size (castPtr dat)) id
    where 
      infoid = getCLValue prof
      size = fromIntegral $ sizeOf (0::CLulong)

-- -----------------------------------------------------------------------------
