@@ -381,7 +381,7 @@ bool OCL4DNNConvSpatial<Dtype>::Forward(const UMat& bottom,
381
381
prepareKernel (bottom, top, weight, bias, numImages);
382
382
if (bestKernelConfig.empty ())
383
383
return false ;
384
- return convolve (bottom, top, weight, bias, numImages, bestKernelConfig, cv::ocl::Queue::getDefault () );
384
+ return convolve (bottom, top, weight, bias, numImages, bestKernelConfig);
385
385
}
386
386
387
387
template <typename Dtype>
@@ -392,7 +392,7 @@ void OCL4DNNConvSpatial<Dtype>::calculateBenchmark(const UMat &bottom, UMat &ver
392
392
options_.str (" " ); options_.clear (); // clear contents and state flags
393
393
createBasicKernel (1 , 1 , 1 );
394
394
kernel_index_ = kernelQueue.size () - 1 ;
395
- convolve (bottom, verifyTop, weight, bias, numImages, kernelQueue[kernel_index_], cv::ocl::Queue::getDefault () );
395
+ convolve (bottom, verifyTop, weight, bias, numImages, kernelQueue[kernel_index_]);
396
396
CV_Assert (phash.find (kernelQueue[kernel_index_]->kernelName ) != phash.end ());
397
397
// unloadProgram(kernelQueue[kernel_index_]->kernelName);
398
398
kernelQueue.pop_back ();
@@ -649,8 +649,7 @@ void OCL4DNNConvSpatial<float>::CreateSubBuffer(const UMat& buffer, UMat& sub_bu
649
649
template <>
650
650
bool OCL4DNNConvSpatial<float >::convolve(const UMat &bottom, UMat &top,
651
651
const UMat &weight, const UMat &bias,
652
- int32_t numImages, kernelConfig* config,
653
- const cv::ocl::Queue& queue)
652
+ int32_t numImages, kernelConfig* config)
654
653
{
655
654
ocl::Program program;
656
655
phash_t ::iterator it = phash.find (config->kernelName );
@@ -926,17 +925,17 @@ float OCL4DNNConvSpatial<float>::timedConvolve(const UMat &bottom, UMat &top,
926
925
const UMat &weight, const UMat &bias,
927
926
int32_t numImages, kernelConfig* config)
928
927
{
929
- cv::ocl::Queue profilingQueue ;
928
+ cv::ocl::Queue queue ;
930
929
try
931
930
{
932
- profilingQueue = cv::ocl::Queue::getDefault (). getProfilingQueue ();
931
+ queue = cv::ocl::Queue::getDefault ();
933
932
}
934
933
catch (const cv::Exception&)
935
934
{
936
935
static int warn_ = 0 ;
937
936
if (!warn_)
938
937
{
939
- std::cout << " OpenCV(ocl4dnn): Can't create OpenCL profiling queue for auto-tuning." << std::endl;
938
+ std::cout << " OpenCV(ocl4dnn): Can't get OpenCL default queue for auto-tuning." << std::endl;
940
939
warn_ = true ;
941
940
}
942
941
return 1e6 ;
@@ -945,16 +944,16 @@ float OCL4DNNConvSpatial<float>::timedConvolve(const UMat &bottom, UMat &top,
945
944
// warm up.
946
945
bool saved_tuned = tuned_;
947
946
tuned_ = false ;
948
- convolve (bottom, top, weight, bias, numImages, config, profilingQueue );
947
+ convolve (bottom, top, weight, bias, numImages, config);
949
948
950
- cv::ocl::Timer timer (profilingQueue );
949
+ cv::ocl::Timer timer (queue );
951
950
timer.start ();
952
951
bool res = true ;;
953
952
dbgPrint (std::cout << " Benchmarking kernel: " << config->kernelName << std::endl);
954
953
tuned_ = true ;
955
954
int loop_cnt = 4 ;
956
955
for (int i = 0 ; i < loop_cnt; i++) {
957
- res = convolve (bottom, top, weight, bias, numImages, config, profilingQueue );
956
+ res = convolve (bottom, top, weight, bias, numImages, config);
958
957
if (!res)
959
958
break ;
960
959
}
@@ -1009,7 +1008,7 @@ bool OCL4DNNConvSpatial<float>::verifyResult(const UMat &bottom,
1009
1008
top.zeros (4 , sz, CV_32FC1);
1010
1009
bool saved_tuned = tuned_;
1011
1010
tuned_ = false ;
1012
- convolve (bottom, top, weight, bias, numImages, config, cv::ocl::Queue::getDefault () );
1011
+ convolve (bottom, top, weight, bias, numImages, config);
1013
1012
tuned_ = saved_tuned;
1014
1013
1015
1014
float *data = (float *)top.getMat (ACCESS_READ).ptr <float >();
0 commit comments