 getPtr :: Module -> String -> IO (DevicePtr a, Int)
 getPtr mdl name = do
   (status,dptr,bytes) <- cuModuleGetGlobal mdl name
-  resultIfOk (status,(dptr,bytes))
+  resultIfFound "global" name (status,(dptr,bytes))
 
 {# fun unsafe cuModuleGetGlobal
   { alloca-      `DevicePtr a' peekDeviceHandle*

import Unsafe.Coerce

import Control.Monad                            (liftM)
import Data.ByteString.Char8                    (ByteString)
import qualified Data.ByteString.Char8 as B


-- Returns a function handle
--
getFun :: Module -> String -> IO Fun
getFun mdl fn = resultIfFound "function" fn =<< cuModuleGetFunction mdl fn

{# fun unsafe cuModuleGetFunction
  { alloca-      `Fun'    peekFun*
