cublasStbsv in cuda kernel

Hello,

I try to solve a equation with cublasStbsv function in my cuda kernel.
Here is my cuda kernel:

__global__ void invokeDeviceCublasSgemm(cublasStatus_t *returnValue,
                                        int n,
                                        const float *d_alpha,
                                        const float *d_A,
                                        const float *d_B,
                                        const float *d_beta,
                                        float *d_C)
{
    cublasHandle_t cnpHandle;
    cublasStatus_t status = cublasCreate(&cnpHandle);

    if (status != CUBLAS_STATUS_SUCCESS)
    {
        *returnValue = status;
        return;
    }

//    /* Perform operation using cublas */
//    status =
//        cublasSgemm(cnpHandle,
//                    CUBLAS_OP_N, CUBLAS_OP_N,
//                    n, n, n,
//                    d_alpha,
//                    d_A, n,
//                    d_B, n,
//                    d_beta,
//                    d_C, n);

    float d_AA[5*5];
    float d_BB[5];
//    float d_X[5];

    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        {
            if(i==j)
            {
                d_AA[i*5+j] = i;
            }else
            {
                d_AA[i*5+j] = 0;
            }

        }
        d_BB[i] = i*i;
    }

    status = cublasStbsv(cnpHandle,
                         CUBLAS_FILL_MODE_UPPER,
                         CUBLAS_OP_N,
                         CUBLAS_DIAG_NON_UNIT,
                         n,n,
                         d_AA,
                         5,
                         d_BB,
                         1);

    for(int i=0;i<5;i++)
    {
           printf("B i %d %f \n",i,d_BB[i]);
    }

    cublasDestroy(cnpHandle);

    *returnValue = status;
}

I don’t understand I get that error:

Starting /home/xavier/Bureau/Developpement/Cuda/build-Cuda_CUBLAS-Qt_5_6_0_gcc_64-Release/Cuda_CUBLAS...
simpleDevLibCUBLAS test running...
GPU Device 0: "GeForce GTX 750 Ti" with compute capability 5.0

Host and device APIs will be tested.
 ** On entry to SBSV  parameter number 7 had an illegal value
B i 0 0.000000 
B i 1 1.000000 
B i 2 4.000000 
B i 3 9.000000 
B i 4 16.000000 
!!!! CUBLAS Device API call failed with code 7

Can someone help me?

cross posting:

[url]cublas - Using cublasStbsv in CUDA kernel - Stack Overflow

you need to malloc (or cudaMalloc) d_AA and d_BB