Solved by jvilchis in post #8 
              
              
                Hi all, finally I got what was wrong with my code: 
a) I had a very old NVIDIA driver and CUDA 8.0. So, I update my system to have a clean installation: 
NVIDIA-SMI 410.104      Driver Version: 410.104      CUDA Version: 10.0 
b) * AT_CUDA_CHECK(cudaStreamSynchronize(stream));* was throwing out an e…