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 error because I was not careful with the types of my tensors.  To solve this problem I made sure all types matched. Below the section of my code with types correctly set.
vector<at::Tensor> bspline_cuda(at::Tensor x, at::Tensor y)
{

    const int n= NCP;
    const int m_mm = NCP;
    const int n_mm = NCP;
    const int k_mm=1;

    dim3 dimGrid((k_mm + BLOCK_SIZE - 1) / BLOCK_SIZE, (m_mm + BLOCK_SIZE - 1) / BLOCK_SIZE);
    dim3 dimBlock(BLOCK_SIZE, BLOCK_SIZE);

    auto a  = at::zeros_like(x);
    auto b  = at::zeros_like(x);
    auto c  = at::zeros_like(x);
    auto d  = at::zeros_like(x);
    
    auto delta  = at::zeros(NCP-1,  x.type());
    auto Delta  = at::zeros(NCP-1,  x.type());
    auto M      = at::zeros({NCP,NCP},  x.type());
    auto D      = at::zeros(NCP,  x.type());

    auto TensorM_inv = at::zeros({NCP,NCP}, x.type());

    for (int j =0; j<n; j++)
        for (int i=0;i<n; i++)
            TensorM_inv[i][j] = M_inv[i][j];


AT_DISPATCH_ALL_TYPES( x.type(), 
                            "NaturalCubicSplinePart1",
                            ([&] 
                                {
                                 NaturalCubicSplinePart1<scalar_t><<< N/TPB, TPB >>>(
                                                                 a.data<scalar_t>(), 
                                                                 delta.data<scalar_t>(), 
                                                                 Delta.data<scalar_t>() , 
                                                                 x.data<scalar_t>(), 
                                                                 y.data<scalar_t>() 
                                                                 );
                                }
                            )
                        );


at::cuda::CUDAStream stream = at::cuda::getCurrentCUDAStream();
AT_CUDA_CHECK(cudaStreamSynchronize(stream));
Thanks a lot, my issue is fixed.