From 04a2387cfca242c8d00383f16fce8dd34b71afad Mon Sep 17 00:00:00 2001 From: Juha Reunanen Date: Wed, 20 Feb 2019 15:33:01 +0200 Subject: [PATCH] Make sure CUDA_VERSION is defined (#1663) --- dlib/cuda/gpu_data.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlib/cuda/gpu_data.cpp b/dlib/cuda/gpu_data.cpp index f19da2f3a..5f2f8e6d7 100644 --- a/dlib/cuda/gpu_data.cpp +++ b/dlib/cuda/gpu_data.cpp @@ -11,7 +11,7 @@ #include #include "cuda_utils.h" #include - +#include namespace dlib { @@ -81,7 +81,9 @@ namespace dlib void synchronize_stream(cudaStream_t stream) { -#if CUDA_VERSION >= 9020 && CUDA_VERSION <= 10000 +#if !defined CUDA_VERSION +#error CUDA_VERSION not defined +#elif CUDA_VERSION >= 9020 && CUDA_VERSION <= 10000 // This should be pretty much the same as cudaStreamSynchronize, which for some // reason makes training freeze in some cases. // (see https://github.com/davisking/dlib/issues/1513)