Skip to content

Commit f0407dc

Browse files
committed
fix
1 parent f235c28 commit f0407dc

File tree

1 file changed

+11
-8
lines changed
  • libcudacxx/include/cuda/__launch

1 file changed

+11
-8
lines changed

libcudacxx/include/cuda/__launch/launch.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,24 +351,27 @@ template <class _Kernel, class _Config, class... _Args>
351351
using _BlockDesc = typename _Hierarchy::template level_desc_type<block_level>;
352352
using _BlockExts = typename _BlockDesc::extents_type;
353353

354-
if constexpr (_Hierarchy::has_level(cluster))
354+
if constexpr (_BlockExts::rank_dynamic() != 0)
355+
{
356+
return ::cuda::__kernel_launcher<_Config, _Kernel, _Args...>;
357+
}
358+
else if constexpr (_Hierarchy::has_level(cluster))
355359
{
356360
using _ClusterDesc = typename _Hierarchy::template level_desc_type<cluster_level>;
357361
using _ClusterExts = typename _ClusterDesc::extents_type;
358362

359-
if constexpr (_BlockExts::rank_dynamic() == 0 && _ClusterExts::rank_dynamic() == 0)
363+
if constexpr (_ClusterExts::rank_dynamic() == 0)
360364
{
361365
return ::cuda::__kernel_launcher_with_block_size<_Config, _Kernel, _Args...>;
362366
}
363-
}
364-
365-
if constexpr (_BlockExts::rank_dynamic() == 0)
366-
{
367-
return ::cuda::__kernel_launcher_with_launch_bounds<_Config, _Kernel, _Args...>;
367+
else
368+
{
369+
return ::cuda::__kernel_launcher_with_launch_bounds<_Config, _Kernel, _Args...>;
370+
}
368371
}
369372
else
370373
{
371-
return ::cuda::__kernel_launcher<_Config, _Kernel, _Args...>;
374+
return ::cuda::__kernel_launcher_with_launch_bounds<_Config, _Kernel, _Args...>;
372375
}
373376
}
374377

0 commit comments

Comments
 (0)