mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
introduce functions to detect build features
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@ -23,6 +23,12 @@ build_*/
|
||||
!build/darknet/YoloWrapper.cs
|
||||
.fuse*
|
||||
*.weights
|
||||
build/*.cmake
|
||||
build/*.ninja
|
||||
build/*.txt
|
||||
build/*.json
|
||||
build/CMakeFiles/
|
||||
build/detect_cuda_compute_capabilities.cu
|
||||
|
||||
# OS Generated #
|
||||
.DS_Store*
|
||||
|
@ -62,6 +62,9 @@ extern "C" LIB_API int detect_mat(const uint8_t* data, const size_t data_length,
|
||||
extern "C" LIB_API int dispose();
|
||||
extern "C" LIB_API int get_device_count();
|
||||
extern "C" LIB_API int get_device_name(int gpu, char* deviceName);
|
||||
extern "C" LIB_API bool built_with_cuda();
|
||||
extern "C" LIB_API bool built_with_cudnn();
|
||||
extern "C" LIB_API bool built_with_opencv();
|
||||
extern "C" LIB_API void send_json_custom(char const* send_buf, int port, int timeout);
|
||||
|
||||
class Detector {
|
||||
|
@ -72,6 +72,31 @@ int get_device_count() {
|
||||
#endif // GPU
|
||||
}
|
||||
|
||||
bool built_with_cuda(){
|
||||
#ifdef GPU
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool built_with_cudnn(){
|
||||
#ifdef CUDNN
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool built_with_opencv(){
|
||||
#ifdef OPENCV
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int get_device_name(int gpu, char* deviceName) {
|
||||
#ifdef GPU
|
||||
cudaDeviceProp prop;
|
||||
|
Reference in New Issue
Block a user