From 9598294c8d1d15fc65a72a55ff476050a2eadf38 Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Sun, 28 Jan 2024 00:19:57 +0200 Subject: [PATCH] Prefer use of `bool_constant` instead of `::std::integral_constant` --- src/cuda/api/kernel_launch.hpp | 18 +++++++++--------- .../api/multi_wrapper_impls/kernel_launch.hpp | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cuda/api/kernel_launch.hpp b/src/cuda/api/kernel_launch.hpp index eb7bdfb4..8ab03eb9 100644 --- a/src/cuda/api/kernel_launch.hpp +++ b/src/cuda/api/kernel_launch.hpp @@ -104,7 +104,7 @@ template using kernel_parameter_decay_t = typename kernel_parameter_decay

::type; template -struct is_function_ptr: ::std::integral_constant::value and ::std::is_function::type>::value> { }; inline void collect_argument_addresses(void**) { } @@ -128,8 +128,8 @@ struct enqueue_launch_helper { template void enqueue_launch( - ::std::integral_constant, - ::std::integral_constant, + bool_constant, + bool_constant, Kernel&& kernel_function, const stream_t& stream, launch_configuration_t launch_configuration, @@ -137,8 +137,8 @@ void enqueue_launch( template void enqueue_launch( - ::std::integral_constant, - ::std::integral_constant, + bool_constant, + bool_constant, Kernel&& kernel, const stream_t& stream, launch_configuration_t launch_configuration, @@ -146,8 +146,8 @@ void enqueue_launch( template void enqueue_launch( - ::std::integral_constant, - ::std::integral_constant, + bool_constant, + bool_constant, Kernel&& kernel, const stream_t& stream, launch_configuration_t launch_configuration, @@ -333,8 +333,8 @@ void enqueue_launch( // use tagged dispatch for the separate behavior for raw and wrapped kernels - although the enqueue_launch // function for each of them will basically be just a one-liner :-( detail_::enqueue_launch( - ::std::integral_constant{}, - ::std::integral_constant{}, + detail_::bool_constant{}, + detail_::bool_constant{}, ::std::forward(kernel), stream, launch_configuration, ::std::forward(parameters)...); } diff --git a/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp b/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp index 24278859..8583b674 100644 --- a/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp +++ b/src/cuda/api/multi_wrapper_impls/kernel_launch.hpp @@ -207,8 +207,8 @@ struct enqueue_launch_helper { template void enqueue_launch( - ::std::integral_constant, // Not a wrapped contextual kernel, - ::std::integral_constant, // and not a library kernel, so it must be a raw kernel function + bool_constant, // Not a wrapped contextual kernel, + bool_constant, // and not a library kernel, so it must be a raw kernel function RawKernelFunction&& kernel_function, const stream_t& stream, launch_configuration_t launch_configuration, @@ -229,8 +229,8 @@ void enqueue_launch( template void enqueue_launch( - ::std::integral_constant, // a kernel wrapped in a kernel_t (sub)class - ::std::integral_constant, // Not a library kernel + bool_constant, // a kernel wrapped in a kernel_t (sub)class + bool_constant, // Not a library kernel Kernel&& kernel, const stream_t& stream, launch_configuration_t launch_configuration, @@ -244,8 +244,8 @@ void enqueue_launch( #if CUDA_VERSION >= 12000 template void enqueue_launch( - ::std::integral_constant, // Not a wrapped contextual kernel, - ::std::integral_constant, // but a library kernel + bool_constant, // Not a wrapped contextual kernel, + bool_constant, // but a library kernel Kernel&& kernel, const stream_t& stream, launch_configuration_t launch_configuration,