Skip to content

Commit 843b6ed

Browse files
authored
Merge pull request #3800 from vrabaud:cuda
Get CUDA code to compile with clang CUDA and without CUDA #3800 Changelist: - there are some syntactic changes: `<< <` -> `<<<`. For some reason, I do not need to change all those in the code. - `::min` -> `std::min` in `__host__` code - `modules/cudaimgproc/src/moments.cpp` needs to have the CUDA code in the `#ifdef` - The signature of `cv::cuda::swapChannels` is not exactly the same as the C++ one in `modules/cudaimgproc/src/color.cpp` - `cv::cuda::FarnebackOpticalFlow::create` needs to be explicit about which FarnebackOpticalFlow it returns ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch
1 parent 80f1ca2 commit 843b6ed

File tree

22 files changed

+61
-47
lines changed

22 files changed

+61
-47
lines changed

modules/cudaarithm/src/arithm.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ void cv::cuda::mulAndScaleSpectrums(InputArray, InputArray, OutputArray, int, fl
5454

5555
void cv::cuda::dft(InputArray, OutputArray, Size, int, Stream&) { throw_no_cuda(); }
5656

57+
Ptr<DFT> cv::cuda::createDFT(Size, int) { throw_no_cuda(); return Ptr<DFT>(); }
58+
5759
Ptr<Convolution> cv::cuda::createConvolution(Size) { throw_no_cuda(); return Ptr<Convolution>(); }
5860

5961
#else /* !defined (HAVE_CUDA) */

modules/cudaarithm/src/cuda/polar_cart.cu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ namespace
289289
const T scale = angleInDegrees ? static_cast<T>(CV_PI / 180.0) : static_cast<T>(1.0);
290290

291291
if (mag.empty())
292-
polarToCartImpl_<T, false> << <grid, block, 0, stream >> >(mag, angle, x, y, scale);
292+
polarToCartImpl_<T, false> <<<grid, block, 0, stream >>>(mag, angle, x, y, scale);
293293
else
294-
polarToCartImpl_<T, true> << <grid, block, 0, stream >> >(mag, angle, x, y, scale);
294+
polarToCartImpl_<T, true> <<<grid, block, 0, stream >>>(mag, angle, x, y, scale);
295295
}
296296

297297
template <typename T>
@@ -305,9 +305,9 @@ namespace
305305
const T scale = angleInDegrees ? static_cast<T>(CV_PI / 180.0) : static_cast<T>(1.0);
306306

307307
if (mag.empty())
308-
polarToCartDstInterleavedImpl_<T, false> << <grid, block, 0, stream >> >(mag, angle, xy, scale);
308+
polarToCartDstInterleavedImpl_<T, false> <<<grid, block, 0, stream >>>(mag, angle, xy, scale);
309309
else
310-
polarToCartDstInterleavedImpl_<T, true> << <grid, block, 0, stream >> >(mag, angle, xy, scale);
310+
polarToCartDstInterleavedImpl_<T, true> <<<grid, block, 0, stream >>>(mag, angle, xy, scale);
311311
}
312312

313313
template <typename T>
@@ -320,7 +320,7 @@ namespace
320320

321321
const T scale = angleInDegrees ? static_cast<T>(CV_PI / 180.0) : static_cast<T>(1.0);
322322

323-
polarToCartInterleavedImpl_<T> << <grid, block, 0, stream >> >(magAngle, xy, scale);
323+
polarToCartInterleavedImpl_<T> <<<grid, block, 0, stream >>>(magAngle, xy, scale);
324324
}
325325
}
326326

modules/cudaarithm/src/element_operations.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,13 @@ void cv::cuda::magnitude(InputArray, InputArray, OutputArray, Stream&) { throw_n
8484
void cv::cuda::magnitudeSqr(InputArray, OutputArray, Stream&) { throw_no_cuda(); }
8585
void cv::cuda::magnitudeSqr(InputArray, InputArray, OutputArray, Stream&) { throw_no_cuda(); }
8686
void cv::cuda::phase(InputArray, InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
87+
void cv::cuda::phase(InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
8788
void cv::cuda::cartToPolar(InputArray, InputArray, OutputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
89+
void cv::cuda::cartToPolar(InputArray, OutputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
90+
void cv::cuda::cartToPolar(InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
8891
void cv::cuda::polarToCart(InputArray, InputArray, OutputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
92+
void cv::cuda::polarToCart(InputArray, InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
93+
void cv::cuda::polarToCart(InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
8994

9095
#else
9196

modules/cudaarithm/src/reductions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ void cv::cuda::countNonZero(InputArray, OutputArray, Stream&) { throw_no_cuda();
6969

7070
void cv::cuda::reduce(InputArray, OutputArray, int, int, int, Stream&) { throw_no_cuda(); }
7171

72-
void cv::cuda::meanStdDev(InputArray, Scalar&, Scalar&) { throw_no_cuda(); }
72+
void cv::cuda::meanStdDev(InputArray, OutputArray, InputArray, Stream&) { throw_no_cuda(); }
7373
void cv::cuda::meanStdDev(InputArray, OutputArray, Stream&) { throw_no_cuda(); }
74+
void cv::cuda::meanStdDev(InputArray, Scalar&, Scalar&, InputArray) { throw_no_cuda(); }
75+
void cv::cuda::meanStdDev(InputArray, Scalar&, Scalar&) { throw_no_cuda(); }
7476

7577
void cv::cuda::rectStdDev(InputArray, InputArray, OutputArray, Rect, Stream&) { throw_no_cuda(); }
7678

modules/cudacodec/src/cuda/nv12_to_rgb.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ void nv12ToBgra(const GpuMat& decodedFrame, GpuMat& outFrame, int width, int hei
179179
dim3 block(32, 8);
180180
dim3 grid(divUp(width, 2 * block.x), divUp(height, block.y));
181181
if (videoFullRangeFlag)
182-
NV12_to_BGRA<true> << <grid, block, 0, stream >> > (decodedFrame.ptr<uchar>(), decodedFrame.step, outFrame.ptr<uint>(), outFrame.step, width, height);
182+
NV12_to_BGRA<true> <<<grid, block, 0, stream >>> (decodedFrame.ptr<uchar>(), decodedFrame.step, outFrame.ptr<uint>(), outFrame.step, width, height);
183183
else
184-
NV12_to_BGRA<false> << <grid, block, 0, stream >> > (decodedFrame.ptr<uchar>(), decodedFrame.step, outFrame.ptr<uint>(), outFrame.step, width, height);
184+
NV12_to_BGRA<false> <<<grid, block, 0, stream >>> (decodedFrame.ptr<uchar>(), decodedFrame.step, outFrame.ptr<uint>(), outFrame.step, width, height);
185185
CV_CUDEV_SAFE_CALL(cudaGetLastError());
186186
if (stream == 0)
187187
CV_CUDEV_SAFE_CALL(cudaDeviceSynchronize());

modules/cudaimgproc/src/color.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void cv::cuda::cvtColor(InputArray, OutputArray, int, int, Stream&) { throw_no_c
5151

5252
void cv::cuda::demosaicing(InputArray, OutputArray, int, int, Stream&) { throw_no_cuda(); }
5353

54-
void cv::cuda::swapChannels(InputOutputArray, const int[], Stream&) { throw_no_cuda(); }
54+
void cv::cuda::swapChannels(InputOutputArray, const int[4], Stream&) { throw_no_cuda(); }
5555

5656
void cv::cuda::gammaCorrection(InputArray, OutputArray, bool, Stream&) { throw_no_cuda(); }
5757

modules/cudaimgproc/src/connectedcomponents.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ using namespace cv::cuda;
99

1010
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
1111

12-
void cv::cuda::connectedComponents(InputArray img_, OutputArray labels_, int connectivity,
13-
int ltype, ConnectedComponentsAlgorithmsTypes ccltype) { throw_no_cuda(); }
12+
void cv::cuda::connectedComponents(InputArray, OutputArray, int, int, ConnectedComponentsAlgorithmsTypes) { throw_no_cuda(); }
13+
void cv::cuda::connectedComponents(InputArray, OutputArray, int, int) { throw_no_cuda(); }
1414

1515
#else /* !defined (HAVE_CUDA) */
1616

modules/cudaimgproc/src/cuda/canny.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ namespace canny
428428
cudaSafeCall( cudaMemsetAsync(d_counter, 0, sizeof(int), stream) );
429429

430430
const dim3 block(128);
431-
const dim3 grid(::min(count, 65535u), divUp(count, 65535), 1);
431+
const dim3 grid(std::min(count, 65535), divUp(count, 65535), 1);
432432

433433
edgesHysteresisGlobalKernel<<<grid, block, 0, stream>>>(map, st1, st2, d_counter, count);
434434
cudaSafeCall( cudaGetLastError() );
@@ -439,7 +439,7 @@ namespace canny
439439
cudaSafeCall( cudaMemcpyAsync(&count, d_counter, sizeof(int), cudaMemcpyDeviceToHost, stream) );
440440
cudaSafeCall( cudaStreamSynchronize(stream) );
441441

442-
count = min(count, map.cols * map.rows);
442+
count = std::min(count, map.cols * map.rows);
443443

444444
//std::swap(st1, st2);
445445
short2* tmp = st1;

modules/cudaimgproc/src/cuda/connectedcomponents.cu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,19 @@ void BlockBasedKomuraEquivalence(const cv::cuda::GpuMat& img, cv::cuda::GpuMat&
317317
grid_size = dim3((((img.cols + 1) / 2) - 1) / kblock_cols + 1, (((img.rows + 1) / 2) - 1) / kblock_rows + 1, 1);
318318
block_size = dim3(kblock_cols, kblock_rows, 1);
319319

320-
InitLabeling << <grid_size, block_size >> > (img, labels, last_pixel);
320+
InitLabeling <<<grid_size, block_size >>> (img, labels, last_pixel);
321321
cudaSafeCall(cudaGetLastError());
322322

323-
Compression << <grid_size, block_size >> > (labels);
323+
Compression <<<grid_size, block_size >>> (labels);
324324
cudaSafeCall(cudaGetLastError());
325325

326-
Merge << <grid_size, block_size >> > (labels, last_pixel);
326+
Merge <<<grid_size, block_size >>> (labels, last_pixel);
327327
cudaSafeCall(cudaGetLastError());
328328

329-
Compression << <grid_size, block_size >> > (labels);
329+
Compression <<<grid_size, block_size >>> (labels);
330330
cudaSafeCall(cudaGetLastError());
331331

332-
FinalLabeling << <grid_size, block_size >> > (img, labels);
332+
FinalLabeling <<<grid_size, block_size >>> (img, labels);
333333
cudaSafeCall(cudaGetLastError());
334334

335335
if (last_pixel_allocated) {

modules/cudaimgproc/src/cuda/generalized_hough.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ namespace cv { namespace cuda { namespace device
302302
int totalCount;
303303
cudaSafeCall( cudaMemcpy(&totalCount, counterPtr, sizeof(int), cudaMemcpyDeviceToHost) );
304304

305-
totalCount = ::min(totalCount, maxSize);
305+
totalCount = std::min(totalCount, maxSize);
306306

307307
return totalCount;
308308
}
@@ -812,7 +812,7 @@ namespace cv { namespace cuda { namespace device
812812
int totalCount;
813813
cudaSafeCall( cudaMemcpy(&totalCount, counterPtr, sizeof(int), cudaMemcpyDeviceToHost) );
814814

815-
totalCount = ::min(totalCount, maxSize);
815+
totalCount = std::min(totalCount, maxSize);
816816

817817
return totalCount;
818818
}

modules/cudaimgproc/src/cuda/hough_circles.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ namespace cv { namespace cuda { namespace device
238238
cudaSafeCall( cudaMemcpyAsync(&totalCount, counterPtr, sizeof(int), cudaMemcpyDeviceToHost, stream) );
239239
cudaSafeCall( cudaStreamSynchronize(stream) );
240240

241-
totalCount = ::min(totalCount, maxCircles);
241+
totalCount = std::min(totalCount, maxCircles);
242242

243243
return totalCount;
244244
}

modules/cudaimgproc/src/cuda/hough_lines.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ namespace cv { namespace cuda { namespace device
189189

190190
cudaSafeCall( cudaStreamSynchronize(stream) );
191191

192-
totalCount = ::min(totalCount, maxSize);
192+
totalCount = std::min(totalCount, maxSize);
193193

194194
if (doSort && totalCount > 0)
195195
{

modules/cudaimgproc/src/cuda/hough_segments.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ namespace cv { namespace cuda { namespace device
241241

242242
cudaSafeCall( cudaStreamSynchronize(stream) );
243243

244-
totalCount = ::min(totalCount, maxSize);
244+
totalCount = std::min(totalCount, maxSize);
245245
return totalCount;
246246
}
247247
}

modules/cudaimgproc/src/cuda/moments.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ template <typename TSrc, typename TMoments, int nMoments> struct momentsDispatch
139139
static void call(const PtrStepSz<TSrc> src, PtrStepSz<TMoments> moments, const bool binary, const int offsetX, const cudaStream_t stream) {
140140
dim3 blockSize(blockSizeX, blockSizeY);
141141
dim3 gridSize = dim3(divUp(src.rows, blockSizeY));
142-
spatialMoments<TSrc, TMoments, false, false, nMoments> << <gridSize, blockSize, 0, stream >> > (src, binary, moments.ptr());
142+
spatialMoments<TSrc, TMoments, false, false, nMoments> <<<gridSize, blockSize, 0, stream >>> (src, binary, moments.ptr());
143143
if (stream == 0)
144144
cudaSafeCall(cudaStreamSynchronize(stream));
145145
};
@@ -150,9 +150,9 @@ template <typename TSrc, int nMoments> struct momentsDispatcherChar {
150150
dim3 blockSize(blockSizeX, blockSizeY);
151151
dim3 gridSize = dim3(divUp(src.rows, blockSizeY));
152152
if (offsetX)
153-
spatialMoments<TSrc, float, true, false, nMoments> << <gridSize, blockSize, 0, stream >> > (src, binary, moments.ptr(), offsetX);
153+
spatialMoments<TSrc, float, true, false, nMoments> <<<gridSize, blockSize, 0, stream >>> (src, binary, moments.ptr(), offsetX);
154154
else
155-
spatialMoments<TSrc, float, true, true, nMoments> << <gridSize, blockSize, 0, stream >> > (src, binary, moments.ptr());
155+
spatialMoments<TSrc, float, true, true, nMoments> <<<gridSize, blockSize, 0, stream >>> (src, binary, moments.ptr());
156156

157157
if (stream == 0)
158158
cudaSafeCall(cudaStreamSynchronize(stream));

modules/cudaimgproc/src/histogram.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ using namespace cv::cuda;
4848
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
4949

5050
void cv::cuda::calcHist(InputArray, OutputArray, Stream&) { throw_no_cuda(); }
51+
void cv::cuda::calcHist(InputArray, InputArray, OutputArray, Stream&) { throw_no_cuda(); }
5152

5253
void cv::cuda::equalizeHist(InputArray, OutputArray, Stream&) { throw_no_cuda(); }
5354

modules/cudaimgproc/src/moments.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@
33
// of this distribution and at http://opencv.org/license.html.
44

55
#include "precomp.hpp"
6-
#include "cuda/moments.cuh"
76

87
using namespace cv;
98
using namespace cv::cuda;
109

11-
int cv::cuda::numMoments(const MomentsOrder order) {
12-
return order == MomentsOrder::FIRST_ORDER_MOMENTS ? device::imgproc::n1 : order == MomentsOrder::SECOND_ORDER_MOMENTS ? device::imgproc::n12 : device::imgproc::n123;
13-
}
14-
1510
template<typename T>
1611
cv::Moments convertSpatialMomentsT(Mat spatialMoments, const MomentsOrder order) {
1712
switch (order) {
@@ -32,10 +27,17 @@ cv::Moments cv::cuda::convertSpatialMoments(Mat spatialMoments, const MomentsOrd
3227
}
3328

3429
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
30+
int cv::cuda::numMoments(MomentsOrder) { throw_no_cuda(); return 0; }
3531
Moments cv::cuda::moments(InputArray src, const bool binary, const MomentsOrder order, const int momentsType) { throw_no_cuda(); }
36-
void spatialMoments(InputArray src, OutputArray moments, const bool binary, const MomentsOrder order, const int momentsType, Stream& stream) { throw_no_cuda(); }
32+
void cv::cuda::spatialMoments(InputArray src, OutputArray moments, const bool binary, const MomentsOrder order, const int momentsType, Stream& stream) { throw_no_cuda(); }
3733
#else /* !defined (HAVE_CUDA) */
3834

35+
#include "cuda/moments.cuh"
36+
37+
int cv::cuda::numMoments(const MomentsOrder order) {
38+
return order == MomentsOrder::FIRST_ORDER_MOMENTS ? device::imgproc::n1 : order == MomentsOrder::SECOND_ORDER_MOMENTS ? device::imgproc::n12 : device::imgproc::n123;
39+
}
40+
3941
namespace cv { namespace cuda { namespace device { namespace imgproc {
4042
template <typename TSrc, typename TMoments>
4143
void moments(const PtrStepSzb src, PtrStepSzb moments, const bool binary, const int order, const int offsetX, const cudaStream_t stream);

modules/cudaoptflow/src/cuda/nvidiaOpticalFlow.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ void FlowUpsample(void* srcDevPtr, uint32_t nSrcWidth, uint32_t nSrcPitch, uint3
9090

9191
dim3 blockDim(BLOCKDIM_X, BLOCKDIM_Y);
9292
dim3 gridDim((nDstWidth + blockDim.x - 1) / blockDim.x, (nDstHeight + blockDim.y - 1) / blockDim.y);
93-
NearestNeighborFlowKernel << <gridDim, blockDim >> > (0, srcDevPtr, nSrcWidth, nSrcPitch, nSrcHeight,
93+
NearestNeighborFlowKernel <<<gridDim, blockDim >>> (0, srcDevPtr, nSrcWidth, nSrcPitch, nSrcHeight,
9494
0, dstDevPtr, nDstWidth, nDstPitch, nDstHeight,
9595
nScaleFactor);
9696

modules/cudaoptflow/src/farneback.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ using namespace cv::cuda;
4747

4848
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
4949

50-
Ptr<FarnebackOpticalFlow> cv::cuda::FarnebackOpticalFlow::create(int, double, bool, int, int, int, double, int) { throw_no_cuda(); return Ptr<FarnebackOpticalFlow>(); }
50+
Ptr<cv::cuda::FarnebackOpticalFlow> cv::cuda::FarnebackOpticalFlow::create(int, double, bool, int, int, int, double, int) { throw_no_cuda(); return Ptr<FarnebackOpticalFlow>(); }
5151

5252
#else
5353

modules/cudaoptflow/src/precomp.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
#include "opencv2/video.hpp"
5353

5454
#include "opencv2/core/private.cuda.hpp"
55+
#if defined HAVE_CUDA
5556
#include "opencv2/core/cuda/vec_traits.hpp"
57+
#endif
5658
#include "opencv2/opencv_modules.hpp"
5759

5860
#ifdef HAVE_OPENCV_CUDALEGACY

modules/cudev/include/opencv2/cudev/grid/detail/minmaxloc.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ namespace grid_minmaxloc_detail
148148
block = dim3(Policy::block_size_x, Policy::block_size_y);
149149
grid = dim3(divUp(cols, block.x * Policy::patch_size_x), divUp(rows, block.y * Policy::patch_size_y));
150150

151-
grid.x = ::min(grid.x, block.x);
152-
grid.y = ::min(grid.y, block.y);
151+
grid.x = std::min(grid.x, block.x);
152+
grid.y = std::min(grid.y, block.y);
153153
}
154154

155155
template <class Policy, class SrcPtr, typename ResType, class MaskPtr>

modules/hfs/src/cuda/gslic_seg_engine_gpu.cu

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void SegEngineGPU::cvtImgSpace(Ptr<UChar4Image> inimg, Ptr<Float4Image> outimg)
7575

7676
dim3 blockSize(HFS_BLOCK_DIM, HFS_BLOCK_DIM);
7777
dim3 gridSize = getGridSize(img_size, blockSize);
78-
cvtImgSpaceDevice << <gridSize, blockSize >> >(inimg_ptr, img_size, outimg_ptr);
78+
cvtImgSpaceDevice <<<gridSize, blockSize >>>(inimg_ptr, img_size, outimg_ptr);
7979
}
8080

8181
void SegEngineGPU::initClusterCenters()
@@ -85,7 +85,7 @@ void SegEngineGPU::initClusterCenters()
8585

8686
dim3 blockSize(HFS_BLOCK_DIM, HFS_BLOCK_DIM);
8787
dim3 gridSize = getGridSize(map_size, blockSize);
88-
initClusterCentersDevice << <gridSize, blockSize >> >
88+
initClusterCentersDevice <<<gridSize, blockSize >>>
8989
(img_ptr, map_size, img_size, spixel_size, spixel_list);
9090
}
9191

@@ -98,7 +98,7 @@ void SegEngineGPU::findCenterAssociation()
9898
dim3 blockSize(HFS_BLOCK_DIM, HFS_BLOCK_DIM);
9999
dim3 gridSize = getGridSize(img_size, blockSize);
100100

101-
findCenterAssociationDevice << <gridSize, blockSize >> >
101+
findCenterAssociationDevice <<<gridSize, blockSize >>>
102102
(img_ptr, spixel_list, map_size, img_size,
103103
spixel_size, slic_settings.coh_weight,
104104
max_xy_dist, max_color_dist, idx_ptr);
@@ -116,13 +116,13 @@ void SegEngineGPU::updateClusterCenter()
116116
dim3 blockSize(HFS_BLOCK_DIM, HFS_BLOCK_DIM);
117117
dim3 gridSize(map_size.x, map_size.y, no_grid_per_center);
118118

119-
updateClusterCenterDevice << <gridSize, blockSize >> >
119+
updateClusterCenterDevice <<<gridSize, blockSize >>>
120120
(img_ptr, idx_ptr, map_size, img_size,
121121
spixel_size, no_blocks_per_line, accum_map_ptr);
122122

123123
dim3 gridSize2(map_size.x, map_size.y);
124124

125-
finalizeReductionResultDevice << <gridSize2, blockSize >> >
125+
finalizeReductionResultDevice <<<gridSize2, blockSize >>>
126126
(accum_map_ptr, map_size, no_grid_per_center, spixel_list_ptr);
127127
}
128128

@@ -134,13 +134,13 @@ void SegEngineGPU::enforceConnectivity()
134134
dim3 blockSize(HFS_BLOCK_DIM, HFS_BLOCK_DIM);
135135
dim3 gridSize = getGridSize(img_size, blockSize);
136136

137-
enforceConnectivityDevice << <gridSize, blockSize >> >
137+
enforceConnectivityDevice <<<gridSize, blockSize >>>
138138
(idx_ptr, img_size, tmp_idx_ptr);
139-
enforceConnectivityDevice << <gridSize, blockSize >> >
139+
enforceConnectivityDevice <<<gridSize, blockSize >>>
140140
(tmp_idx_ptr, img_size, idx_ptr);
141-
enforceConnectivityDevice1_2 << <gridSize, blockSize >> >
141+
enforceConnectivityDevice1_2 <<<gridSize, blockSize >>>
142142
(idx_ptr, img_size, tmp_idx_ptr);
143-
enforceConnectivityDevice1_2 << <gridSize, blockSize >> >
143+
enforceConnectivityDevice1_2 <<<gridSize, blockSize >>>
144144
(tmp_idx_ptr, img_size, idx_ptr);
145145
}
146146

modules/hfs/src/cuda/magnitude.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ void Magnitude::derrivativeXYGpu()
194194
dim3 gridSize((int)ceil((float)img_size.x / (float)blockSize.x),
195195
(int)ceil((float)img_size.y / (float)blockSize.y));
196196

197-
derrivativeXYDevice << <gridSize, blockSize >> >
197+
derrivativeXYDevice <<<gridSize, blockSize >>>
198198
(gray_ptr, dx_ptr, dy_ptr, mag_ptr, img_size);
199199
}
200200

@@ -209,7 +209,7 @@ void Magnitude::nonMaxSuppGpu()
209209
dim3 gridSize((int)ceil((float)img_size.x / (float)blockSize.x),
210210
(int)ceil((float)img_size.y / (float)blockSize.y));
211211

212-
nonMaxSuppDevice << <gridSize, blockSize >> >
212+
nonMaxSuppDevice <<<gridSize, blockSize >>>
213213
(nms_ptr, dx_ptr, dy_ptr, mag_ptr, img_size);
214214
}
215215

0 commit comments

Comments
 (0)