Exemple #1
0
 public void close() {
   //    System.err.printf("close() in CUDAMatrix\n");
   if (this.cPointer != null) {
     //      System.out.printf("Releasing the CUDA Pointer\n");
     this.persist = false;
     SimpleCuBlas.free(this.cPointer);
     //      JCublas.cublasInit();
     //      JCublas.cublasFree(this.cPointer);
     this.cPointer = null;
   }
 }
Exemple #2
0
  public void copyHtoD() {
    if (System.getProperty("use_cuda").equals("true")) {
      if (this.persist == false) this.persist = true;
      if (this.cPointer != null) {
        SimpleCuBlas.free(this.cPointer);
        //        JCublas.cublasInit();
        //        JCublas.cublasFree(this.cPointer);
        this.cPointer = null;
      }

      this.cPointer = SimpleCuBlas.alloc(this.data());
    }
  }