 //cuTensor context:
      err_cutensor=cutensorCreate(&(cutensor_handle[i]));
      if(err_cutensor != CUTENSOR_STATUS_SUCCESS) return -7;
+     err=cudaMalloc(&cutensor_workspace[i],CUTENSOR_WORKSPACE_SIZE);
+     if(err == cudaSuccess){
+      cutensor_worksize[i]=CUTENSOR_WORKSPACE_SIZE;
+     }else{
+      cutensor_workspace[i]=NULL;
+      cutensor_worksize[i]=0;
+     }
 #endif
     }
 //CUDA stream bank:

/** Tensor Algebra Library for NVidia GPU: NV-TAL (CUDA based).
AUTHOR: Dmitry I. Lyakh (Liakh): quant4me@gmail.com, liakhdi@ornl.gov
REVISION: 2019/09/17

Copyright (C) 2014-2019 Dmitry I. Lyakh (Liakh)
Copyright (C) 2014-2019 Oak Ridge National Laboratory (UT-Battelle)

    n++; err=cudaSetDevice(i);
    if(err == cudaSuccess){
#ifdef USE_CUTENSOR
     if(cutensor_workspace[i] != NULL) cudaFree(cutensor_workspace[i]);
     cutensor_workspace[i]=NULL;
     cutensor_worksize[i]=0;
     err_cutensor=cutensorDestroy(cutensor_handle[i]);
#endif
#ifndef NO_BLAS
