From b8e6e80c6d411d05a9e09f1e3676eb9a7f3ea0e8 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Fri, 03 Aug 2018 11:35:03 +0000
Subject: [PATCH] Added spatial Yolo v3 yolov3-spp.cfg

---
 src/yolo_v2_class.cpp |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/yolo_v2_class.cpp b/src/yolo_v2_class.cpp
index 980db93..8fcf935 100644
--- a/src/yolo_v2_class.cpp
+++ b/src/yolo_v2_class.cpp
@@ -60,6 +60,28 @@
     return 1;
 }
 
+int get_device_count() {
+#ifdef GPU
+    int count = 0;
+    cudaGetDeviceCount(&count);
+    return count;
+#else
+    return -1;
+#endif	// GPU
+}
+
+int get_device_name(int gpu, char* deviceName) {
+#ifdef GPU
+    cudaDeviceProp prop;
+    cudaGetDeviceProperties(&prop, gpu);
+    std::string result = prop.name;
+    std::copy(result.begin(), result.end(), deviceName);
+    return 1;
+#else
+    return -1;
+#endif	// GPU
+}
+
 #ifdef GPU
 void check_cuda(cudaError_t status) {
     if (status != cudaSuccess) {

--
Gitblit v1.10.0