From 73a93b4eebd3afb025ac4923a619fa77268dce78 Mon Sep 17 00:00:00 2001 From: intwanghao Date: Tue, 24 Dec 2024 09:58:31 +0800 Subject: [PATCH] [SYCLomatic] Add template constraints for kernel_launcher::launch function (#2581) Signed-off-by: intwanghao --- clang/runtime/dpct-rt/include/dpct/kernel.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/clang/runtime/dpct-rt/include/dpct/kernel.hpp b/clang/runtime/dpct-rt/include/dpct/kernel.hpp index ec42bd63e0ff..46fcc5d6a2c2 100644 --- a/clang/runtime/dpct-rt/include/dpct/kernel.hpp +++ b/clang/runtime/dpct-rt/include/dpct/kernel.hpp @@ -521,9 +521,9 @@ class kernel_launcher { /// \param [in] que SYCL queue used to execute kernel. /// \param [in] args Kernel arguments. template - static void launch(FuncT *func, dim3 group_range, dim3 local_range, - unsigned int local_mem_size, queue_ptr que, - ArgsT... args) { + static std::enable_if_t, void> + launch(FuncT *func, dim3 group_range, dim3 local_range, + unsigned int local_mem_size, queue_ptr que, ArgsT... args) { set_execution_config(group_range, local_range, local_mem_size, que); func(args...); } @@ -551,8 +551,9 @@ class kernel_launcher { /// function. /// \param [in] que SYCL queue used to execute kernel. template - static void launch(FuncT *func, dim3 group_range, dim3 local_range, - void **args, unsigned int local_mem_size, queue_ptr que) { + static std::enable_if_t, void> + launch(FuncT *func, dim3 group_range, dim3 local_range, void **args, + unsigned int local_mem_size, queue_ptr que) { constexpr size_t p_num = args_selector<0, 0, FuncT>::params_num; set_execution_config(group_range, local_range, local_mem_size, que); args_selector selector(args, nullptr);