Skip to content

Commit 04a2387

Browse files
reunanendavisking
authored andcommitted
Make sure CUDA_VERSION is defined (davisking#1663)
1 parent 23f874d commit 04a2387

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dlib/cuda/gpu_data.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <iostream>
1212
#include "cuda_utils.h"
1313
#include <cstring>
14-
14+
#include <cuda.h>
1515

1616
namespace dlib
1717
{
@@ -81,7 +81,9 @@ namespace dlib
8181

8282
void synchronize_stream(cudaStream_t stream)
8383
{
84-
#if CUDA_VERSION >= 9020 && CUDA_VERSION <= 10000
84+
#if !defined CUDA_VERSION
85+
#error CUDA_VERSION not defined
86+
#elif CUDA_VERSION >= 9020 && CUDA_VERSION <= 10000
8587
// This should be pretty much the same as cudaStreamSynchronize, which for some
8688
// reason makes training freeze in some cases.
8789
// (see https://github.com/davisking/dlib/issues/1513)

0 commit comments

Comments
 (0)