     convert_mat_to_layered (imgInLeft, mInLeft);
     convert_mat_to_layered (imgInRight, mInRight);
 
-    // get MU
-    float MU;
-    bool retVal = getParam("mu", MU, argc, argv);
-    if (!retVal) {
-        cerr << "ERROR: no MU specified" << endl;
-        cout << "Usage: " << argv[0] << " -mu <value> " << endl; return 1;
-    }
-
-    // get sigma
-    float SIGMA;
-    retVal = getParam("sigma", SIGMA, argc, argv);
-    if (!retVal) {
-        cerr << "ERROR: no SIGMA specified" << endl;
-    cout << "Usage: " << argv[0] << " -sigma <value>" << endl; return 1;
-    }
-
-    // get TAU
-    float TAU;
-    retVal = getParam("tau", TAU, argc, argv);
-    if (!retVal) {
-        cerr << "ERROR: no TAU specified" << endl;
-    cout << "Usage: " << argv[0] << " -tau <value>" << endl; return 1;
-    }
-
-    // get discretization
-    uint32_t nt;
-    retVal = getParam("nt", nt, argc, argv);
-    if (!retVal) {
-        cerr << "ERROR: no discretization specified" << endl;
-        cout << "Usage: " << argv[0] << " -nt <value>" << endl; return 1;
-    }
-
-    // get steps
-    uint32_t steps;
-    retVal = getParam("steps", steps, argc, argv);
-    if (!retVal) {
-        cerr << "ERROR: no step specified" << endl;
-        cout << "Usage: " << argv[0] << " -steps <value>" << endl; return 1;
-    }
-
-    // output parameters
-    cout << "MU: " << MU << endl;
-    cout << "SIGMA: " << SIGMA << endl;
-    cout << "TAU: " << TAU << endl;
-    cout << "nt: " << nt << endl;
-    cout << "Steps: " << steps << endl;
-   
     Timer timer; timer.start();
-
-    // GPU version
-    stereo_projection_PD(imgInLeft, imgInRight, imgOutDepth, dim3(w, h, 0), nc, dim3(w, h, nt), steps, MU, SIGMA, TAU);
+    
+    // GPU version based on implementation type selected
+    switch(impl) {
+        case 0:
+            stereo_projection_PD(imgInLeft, imgInRight, imgOutDepth, dim3(w, h, 0), nc, dim3(w, h, nt), steps, MU, SIGMA, TAU); break;
+        case 1:
+            stereo_projection_PD_tex(imgInLeft, imgInRight, imgOutDepth, dim3(w, h, 0), nc, dim3(w, h, nt), steps, MU, SIGMA, TAU); break;
+        case 2:
+            stereo_projection_PD_pitch(imgInLeft, imgInRight, imgOutDepth, dim3(w, h, 0), nc, dim3(w, h, nt), steps, MU, SIGMA, TAU); break;
+        case 3:
+            stereo_projection_PD_sm(imgInLeft, imgInRight, imgOutDepth, dim3(w, h, 0), nc, dim3(w, h, nt), steps, MU, SIGMA, TAU); break;
+        default:
+            break;
+    }
     
     timer.end();  float t = timer.get();  // elapsed time in seconds
-    cout << "time: " << t*1000 << " ms" << endl;
-
-    // show input image
-    showImage("Input Left", mInLeft, 100, 100);  // show at position (x_from_left=100,y_from_above=100)
-    showImage("Input Right", mInRight, 100+w+40, 100);  // show at position (x_from_left=100,y_from_above=100)
-
-    // ### Display your own output images here as needed
-    // show output image: first convert to interleaved opencv format from the layered raw array
-    /*for(int r = 0; r < h; r++)
-        for(int c = 0; c < w; c++)
-            cout << imgOutDepth[r * w + c] << ((c == w - 1) ? "\n" : "  ");*/
+    if(!suppressOut) cout << "time: " << t*1000 << " ms" << endl;
+
+    // for output calculation convert back to interleaved open cv and normalize
     convert_layered_to_mat(mOutDepth, imgOutDepth);
     double minVal, maxVal;
     minMaxLoc(mOutDepth, &minVal, &maxVal);
     mOutDepth /= maxVal;
-    cout << maxVal << endl;
-    showImage("Depth Mapping", mOutDepth, 100+2*w+40, 100);
+
+    // show input image
+    // show at position (x_from_left=100,y_from_above=100)
+    if(!suppressOut) showImage("Input Left", mInLeft, 100, 100);
+    // show at position (x_from_left=100,y_from_above=100)  
+    if(!suppressOut) showImage("Input Right", mInRight, 100+w+40, 100);
+
+    // ### Display your own output images here as needed
+    if(!suppressOut) showImage("Depth Mapping", mOutDepth, 100+2*w+40, 100);
     
 
 

    if (argc <= 1) { cout << "Usage: " << argv[0] << " -i_left <image> -i_right <image> [-repeats <repeats>] [-gray]" << endl; return 1; }
#endif
    
    // number of computation repetitions to get a better run time measurement
    int repeats = 1;
    getParam("repeats", repeats, argc, argv);
    cout << "repeats: " << repeats << endl;
    
    // load the input image as grayscale if "-gray" is specifed
    bool gray = false;
    getParam("gray", gray, argc, argv);
    cout << "gray: " << gray << endl;

    // ### Define your own parameters here as needed    




    // Init camera / Load input image
#ifdef CAMERA

    // wait for key inputs
    cv::waitKey(0);
#endif

    // save input and result
    cv::imwrite("images/out/depth_map.png", mOutDepth * 255.f);
