     }
     
     // Test output lens for a given mini-batch
-    printf("i=%d, len=%d, out_len=%d \n", 0, wordvecs[test_batch].lens[0], outputs[test_batch].lens[0]);
-    for (int i=1; i < wordvecs[test_batch].b_size; i++) {
-        printf("i=%d, len=%d, out_len=%d \n", i, wordvecs[test_batch].lens[i] - wordvecs[test_batch].lens[i-1],  outputs[test_batch].lens[i]-outputs[test_batch].lens[i-1]);
-    }
+    if (DEBUG) {
+        printf("i=%d, len=%d, out_len=%d \n", 0, wordvecs[test_batch].lens[0], outputs[test_batch].lens[0]);
+        for (int i=1; i < wordvecs[test_batch].b_size; i++) {
+            printf("i=%d, len=%d, out_len=%d \n", i, wordvecs[test_batch].lens[i] - wordvecs[test_batch].lens[i-1],  outputs[test_batch].lens[i]-outputs[test_batch].lens[i-1]);
+        }
+    }
+
     
     //Allocate outputs
     for (int batch=0; batch < n_batches; batch++) {
         outputs[batch].out = (float*) calloc(kerns.num*outputs[batch].lens[batch_size-1], sizeof(float));
     }
     
-    
-    // CPU loop
-    for (int batch=0; batch < n_batches; batch++) {
+    if (DEBUG) {
+        // CPU loop
+        for (int batch=0; batch < n_batches; batch++) {
             conv1d(wordvecs[batch], kerns, outputs[batch]);
-    }
-    
-    //Testing computation
-    printf("CPU Output: \n");
-    if (test_idx == 0) {
-        print_mat(&(outputs[test_batch].out[0*kerns.num]), outputs[test_batch].lens[test_idx], kerns.num);
-    } else {
-        print_mat(&(outputs[test_batch].out[outputs[test_batch].lens[test_idx-1]*kerns.num]), outputs[test_batch].lens[test_idx]-outputs[test_batch].lens[test_idx-1], kerns.num);
-    }
-    
-    //Set back output results to zero.
-    for (int batch=0; batch < n_batches; batch++) {
-        memset(outputs[batch].out, 0, kerns.num*outputs[batch].lens[batch_size-1]*sizeof(float));
+        }
+        
+        //Testing computation
+        printf("CPU Output: \n");
+        if (test_idx == 0) {
+            print_mat(&(outputs[test_batch].out[0*kerns.num]), outputs[test_batch].lens[test_idx], kerns.num);
+        } else {
+            print_mat(&(outputs[test_batch].out[outputs[test_batch].lens[test_idx-1]*kerns.num]), outputs[test_batch].lens[test_idx]-outputs[test_batch].lens[test_idx-1], kerns.num);
+        }
+        
+        //Set back output results to zero.
+        for (int batch=0; batch < n_batches; batch++) {
+            memset(outputs[batch].out, 0, kerns.num*outputs[batch].lens[batch_size-1]*sizeof(float));
+        }
     }
     
     //Select the device you want to run the code.

        
        float* d_out;
        cudaMalloc((void **) &(d_out), sizeof(float)*kerns.num*outputs[batch].lens[batch_size-1]);
        printf("Done allocating d_out \n");
        
        err = cudaGetLastError();
        if (err != cudaSuccess)
            printf("***ERROR***: %s\n", cudaGetErrorString(err));
        
        cudaMemcpy(d_out, outputs[batch].out, sizeof(float)*kerns.num*outputs[batch].lens[batch_size-1], cudaMemcpyHostToDevice);
        printf("Done transfering outputs[batch].out -> d_out \n");
        d_output.out = d_out;
        
        err = cudaGetLastError();

    
    // Test sentence lens for a given mini-batch
    int test_batch = 9, test_idx = 9;
    if (DEBUG){
        printf("i=%d, len=%d \n", 0, wordvecs[test_batch].lens[0]);
        for (int i=1; i < wordvecs[test_batch].b_size; i++) {
            printf("i=%d, len=%d \n", i, wordvecs[test_batch].lens[i] - wordvecs[test_batch].lens[i-1]);
        }
    }
    
    // Allocate word vectors and initialize
