]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/commitdiff
Added safety check for image dimensions in cuFFT version.
authorShanigen <vkaraf@gmail.com>
Mon, 16 Apr 2018 11:56:09 +0000 (13:56 +0200)
committerShanigen <vkaraf@gmail.com>
Mon, 16 Apr 2018 11:56:09 +0000 (13:56 +0200)
src/fft_cufft.cpp

index c94d61f14cdd6c3a790a38a7e836042447a60b2f..4e0142625b7ba0daebc20ca51d8878d280572d42 100644 (file)
@@ -84,6 +84,10 @@ void cuFFT::init(unsigned width, unsigned height, unsigned num_of_feats, unsigne
 
     std::cout << "FFT: cuFFT" << std::endl;
     
+    if(m_height*(m_width/2+1) > 1024){
+        std::cerr << "Image dimension after forward FFT are too big for CUDA kernels." << std::endl;
+        std::exit(EXIT_FAILURE);
+    }
 
     for (unsigned i = 0; i < m_num_of_streams; i++) cudaStreamCreate(&streams[i]);