automatically detect CUDA and use it, without any possible manual intervention

This commit is contained in:
Stefano Sinigardi
2019-02-20 11:42:53 +01:00
parent 9c64f885a8
commit f950085a45
5 changed files with 47 additions and 137 deletions

View File

@ -9,7 +9,7 @@ fi
rm -f uselib darknet
# CPU ONLY, DEBUG
# DEBUG
mkdir -p build_debug
cd build_debug
cmake .. -DCMAKE_BUILD_TYPE=Debug
@ -17,26 +17,10 @@ cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..
# CPU ONLY, RELEASE
# RELEASE
mkdir -p build_release
cd build_release
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..
# CUDA, DEBUG
mkdir -p build_debug_gpu
cd build_debug_gpu
cmake .. -DCMAKE_BUILD_TYPE=Debug -DENABLE_CUDA:BOOL=TRUE
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..
# CUDA, RELEASE
mkdir -p build_release_gpu
cd build_release_gpu
cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_CUDA:BOOL=TRUE
cmake --build . --target install -- -j${number_of_build_workers}
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
cd ..