Skip to content

Commit 4196de2

Browse files
committed
Do not use define inside macro evaluation
1 parent e686d70 commit 4196de2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/torchhull/_C/src/gaussian_blur_cuda.cu

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,20 @@ gaussian_blur_cuda_sparse(const torch::Tensor& images,
447447
dim3 grid_convolution;
448448
at::cuda::getApplyGrid(M, grid_convolution, images.device().index(), threads_per_block);
449449

450+
#define CASE_TILE_CONVOLUTION_KERNEL_SPECIALIZED(KERNEL_SIZE) \
451+
case KERNEL_SIZE: \
452+
{ \
453+
tile_convolution_kernel_specialized<KERNEL_SIZE><<<grid_convolution, threads, 0, stream>>>(tile_indices_, \
454+
M, \
455+
tile_size, \
456+
sigma, \
457+
images_, \
458+
blurred_images_); \
459+
DEFER(AT_CUDA_CHECK(cudaGetLastError());) \
460+
DEFER(AT_CUDA_CHECK(cudaStreamSynchronize(stream));) \
461+
} \
462+
break;
463+
450464
AT_DISPATCH_ALL_TYPES_AND(
451465
torch::ScalarType::Half,
452466
images.scalar_type(),
@@ -464,20 +478,6 @@ gaussian_blur_cuda_sparse(const torch::Tensor& images,
464478
auto blurred_images_ =
465479
blurred_images.packed_accessor64<scalar_t, 4, torch::RestrictPtrTraits>();
466480

467-
#define CASE_TILE_CONVOLUTION_KERNEL_SPECIALIZED(KERNEL_SIZE) \
468-
case KERNEL_SIZE: \
469-
{ \
470-
tile_convolution_kernel_specialized<KERNEL_SIZE><<<grid_convolution, threads, 0, stream>>>(tile_indices_, \
471-
M, \
472-
tile_size, \
473-
sigma, \
474-
images_, \
475-
blurred_images_); \
476-
DEFER(AT_CUDA_CHECK(cudaGetLastError());) \
477-
DEFER(AT_CUDA_CHECK(cudaStreamSynchronize(stream));) \
478-
} \
479-
break;
480-
481481
switch (kernel_size)
482482
{
483483
// Tested all possible values up to 21 for specialization.

0 commit comments

Comments
 (0)