     return BF_STATUS_INTERNAL_ERROR;
 }
 
+void test_bffft_real_2d()
+{
+    BFarray my_data;
+    BFarray out_data;
+    BFreal set_data[3][2] = 
+        {{1,2},{2,3},{3,4}};
+    BFreal** some_data;
+    BFcomplex* odata;
+    cudaMalloc((void**)&some_data, sizeof(BFreal)*6);
+    cudaMalloc((void**)&odata, sizeof(BFcomplex)*6);
+    cudaMemcpy(
+        some_data, set_data, 
+        sizeof(BFreal)*6, cudaMemcpyHostToDevice);
+    my_data.data = some_data;
+    my_data.space = BF_SPACE_CUDA;
+    my_data.shape[0] = 3;
+    my_data.shape[1] = 2;
+    my_data.dtype = 0;
+    my_data.ndim = 2;
+    my_data.strides[0] = 2*sizeof(BFreal);
+    my_data.strides[1] = sizeof(BFreal);
+    out_data = my_data;
+    out_data.data = odata;
+    out_data.dtype = 1;
+    out_data.strides[0] = 2*sizeof(BFcomplex);
+    out_data.strides[1] = sizeof(BFcomplex);
+    if (bfFFT(&my_data, &out_data) != BF_STATUS_SUCCESS)
+    {
+        printf("bfFFT failed!\n");
+        return; 
+    }
+    cufftComplex localdata[3][2] = {};
+    cudaMemcpy(
+        localdata, (cufftComplex*)out_data.data, 
+        sizeof(cufftComplex)*6, cudaMemcpyDeviceToHost);
+    for(int i = 0; i < 3; i++)
+    {
+        for (int j = 0; j < 2; j++)
+        {
+            printf(
+                "%f+I%f\n",
+                cuCrealf(localdata[i][j]),
+                cuCimagf(localdata[i][j]));
+        }
+    }
+    return;
+}
+void test_bffft_real()
+{
+    BFarray my_data;
+    BFarray out_data;
+    BFreal set_data[4] = {1,3,6,2.5134};
+    BFreal* some_data;
+    BFcomplex* odata;
+    cudaMalloc((void**)&some_data, sizeof(BFreal)*5);
+    cudaMalloc((void**)&odata, sizeof(BFcomplex)*3);
+    cudaMemcpy(
+        some_data, set_data, 
+        sizeof(BFreal)*4, cudaMemcpyHostToDevice);
+    my_data.data = some_data;
+    my_data.space = BF_SPACE_CUDA;
+    my_data.shape[0] = 4;
+    my_data.dtype = 0;
+    my_data.ndim = 1;
+    my_data.strides[0] = sizeof(BFreal);
+    out_data = my_data;
+    out_data.data = odata;
+    out_data.dtype = 1;
+    out_data.strides[0] = sizeof(BFcomplex);
+    if (bfFFT(&my_data, &out_data) != BF_STATUS_SUCCESS)
+    {
+        printf("bfFFT failed!\n");
+        return; 
+    }
+    cufftComplex localdata[3] = {};
+    cudaMemcpy(
+        localdata, (cufftComplex*)out_data.data, 
+        sizeof(cufftComplex)*3, cudaMemcpyDeviceToHost);
+    for(int i = 0; i < 3; i++)
+        printf("%f+I%f\n",cuCrealf(localdata[i]),cuCimagf(localdata[i]));
+    return;
+}
+
 void test_bffft_2d()
 {
     BFarray my_data;

BFstatus bfFFT(
    BFarray *input, BFarray *output)
{
    if (input->ndim == 1)
        return bfFFTC2C1d(
            (void**)&(input->data), (void**)&(output->data),

    my_data.space = BF_SPACE_CUDA;
    my_data.shape[0] = 3;
    my_data.shape[1] = 3;
    my_data.dtype = 1;
    my_data.ndim = 2;
    my_data.strides[0] = 3*sizeof(BFcomplex);
    my_data.strides[1] = sizeof(BFcomplex);
    if (bfFFT(&my_data, &my_data) != BF_STATUS_SUCCESS)
    {
        printf("bfFFT failed!\n");
