Page 1 of 1

how to use culaDeviceSgels in C

PostPosted: Sat Jan 11, 2014 11:15 pm
by sawyer
Hi, I'm new in CULA and get some troubles.
1. the matrix is in col major,i want get the x where Ax=B in least square solution.A demension is m×n,so x is n×1 ,B is m×1. The problem is I copy A and B to device and set them in culaDeviceSgels , how I get x. The dimension of B is different from x. I dont know how to copy x to the host.
Code: Select all
   //A ,B is given,and m>=n
        float* d_A;
   float* d_B;
   cudaMalloc((void**)&d_A,sizeof(float)*m*n); //allocate device memory for d_A
   cudaMalloc((void**)&d_B,m*sizeof(float)); //I allocate device memory  for d_B
         //Then how I copy B and get x??????

2.if A and B are both in row-major ,how I call the function?