Open main menu

CDOT Wiki β

Changes

GPU621/Group 3

702 bytes added, 21:19, 11 April 2023
Testing and Demonstration Program
We broke down are program into a tester class and have main in our Demo.cpp. This was done in order for the code to be more human readable in demonstration purposes.
 
<syntaxhighlight>
#include "Tester.h"
 
//argument is ../sample_images/test.jpg
int main(int argc, char* argv[]) {
Tester demo(argv[1]);
demo.display_img(0);
 
//run omp
//omp_set_num_threads(15); //Olivia- 15 was opt choice for my system
demo.omp_brighten(50);
demo.omp_sharpen();
demo.omp_saturate(2.0);
//disable OpenMP so it can't be incidently used in the backend
omp_set_num_threads(1);
omp_set_dynamic(0);
//run ipp
demo.ipp_brighten(50);
demo.ipp_sharpen();
demo.ipp_saturate();
 
//run serial
cv::setNumThreads(0); //turn all parallelization of the backend off
demo.serial_brighten(50);
demo.serial_sharpen();
demo.serial_saturate(2.0);
 
return 0;
}
</syntaxhighlight>
<syntaxhighlight>
72
edits