/** * Get the handle for the current thread * @return the handle for the current thread */ public cublasHandle getHandle() { cublasHandle handle = handleMap.get(Thread.currentThread().getName()); if(handle != null) return handle; handle = new cublasHandle(); JCublas2.cublasCreate(handle); handleMap.put(Thread.currentThread().getName(),handle); return handle; }