diff --git a/CMakeLists.txt b/CMakeLists.txt index 966967a..74360af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ #Specify the version being used aswell as the language -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.16) #Name your project here project(ga-gpu) @@ -32,8 +32,8 @@ SET( CUDA_NVCC_FLAGS "--gpu-architecture=compute_50 --gpu-code=sm_50,compute_50" #find packages----------------------------------- #find OpenCV -find_package(OpenCV REQUIRED) -add_definitions(-DUSING_OPENCV) +#find_package(OpenCV REQUIRED) +#add_definitions(-DUSING_OPENCV) #find the pthreads package find_package(Threads) diff --git a/FindSTIM.cmake b/FindSTIM.cmake index a83481a..cb2bcc7 100644 --- a/FindSTIM.cmake +++ b/FindSTIM.cmake @@ -3,20 +3,14 @@ include(FindPackageHandleStandardArgs) -set(STIM_INCLUDE_DIR $ENV{STIMLIB_PATH}) +set(STIM_ROOT $ENV{STIM_ROOT}) -find_package_handle_standard_args(STIM DEFAULT_MSG STIM_INCLUDE_DIR) +IF(NOT STIM_ROOT) + MESSAGE("ERROR: STIM_ROOT environment variable must be set!") +ENDIF(NOT STIM_ROOT) -if(STIM_FOUND) - set(STIM_INCLUDE_DIRS ${STIM_INCLUDE_DIR}) -elseif(STIM_FOUND) - #if the STIM library isn't found, download it - #file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/stimlib) #remove the stimlib directory if it exists - #set(STIM_GIT "https://git.stim.ee.uh.edu/codebase/stimlib.git") - #execute_process(COMMAND git clone --depth 1 ${STIM_GIT} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) - #set(STIM_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/stimlib" CACHE TYPE PATH) - message("STIM library not found. Set the STIMLIB_PATH environment variable to the STIMLIB location.") - message("STIMLIB can be found here: https://git.stim.ee.uh.edu/codebase/stimlib") -endif(STIM_FOUND) + FIND_PATH(STIM_INCLUDE_DIRS DOC "Path to STIM include directory." + NAMES stim/image/image.h + PATHS ${STIM_ROOT}) -find_package_handle_standard_args(STIM DEFAULT_MSG STIM_INCLUDE_DIR) +find_package_handle_standard_args(STIM DEFAULT_MSG STIM_INCLUDE_DIRS) diff --git a/src/ga_gpu.h b/src/ga_gpu.h index e05bd6e..eaec051 100644 --- a/src/ga_gpu.h +++ b/src/ga_gpu.h @@ -4,7 +4,7 @@ #include #include #include -#include +//#include #include #include #include diff --git a/src/main.cpp b/src/main.cpp index 5c09727..71ac674 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -153,6 +153,7 @@ void gpuComputeEignS( size_t g, size_t fea){ std::cout< threads; - //for (size_t g = 0; g ga.gnrtn - 2){ std::cout << "gpu_eigen time "<(elapsed1).count() << "us" << std::endl; profilefile<< "gpu_eigen time "<(elapsed1).count() << "us" << std::endl; } - //ga.S = gnom.score; - //size_t bestGnomeIdx = ga.sortSIndx()[0]; }//end of fitness function @@ -276,7 +248,6 @@ void advertisement() { std::cout << "=========================================================================" << std::endl; std::cout << "Thank you for using the GA-GPU features selection for spectroscopic image!" << std::endl; std::cout << "=========================================================================" << std::endl << std::endl; -// std::cout << args.str(); } int main(int argc, char* argv[]){ @@ -335,8 +306,7 @@ int main(int argc, char* argv[]){ E.close(); //close the hyperspectral file time_t t_end = time(NULL); std::cout<<"Total time: "< bestgnome; //holds best gnome after each generation evaluation @@ -468,9 +433,6 @@ int main(int argc, char* argv[]){ std::ofstream csv(outfile.c_str(), std::ios::out); //open outfstream for outfile size_t ldaindx = bestG_Indx * (nC-1) * ga.f ; //Compute LDA basis index of best gnome - //if(binaryClass){ //this option is for binary class feature selection from joint classes but not fully implemented - // csv<