public CUfunction getKernelFunction(Kernel f) {
   CUfunction function = kernels.get(f);
   if (function == null) throw new CudaException("No such function " + f);
   return function;
 }
 private void initFunction(CUmodule module, Kernel name) {
   CUfunction function = new CUfunction();
   JCudaDriver.cuModuleGetFunction(function, module, name.name());
   kernels.put(name, function);
 }