diff --git a/include/xgboost/context.h b/include/xgboost/context.h index 32e3749e9eaf..0f87731f26d0 100644 --- a/include/xgboost/context.h +++ b/include/xgboost/context.h @@ -269,15 +269,16 @@ struct Context : public XGBoostParameter { */ template decltype(auto) DispatchDevice(CPUFn&& cpu_fn, CUDAFn&& cuda_fn, SYCLFn&& sycl_fn) const { - static_assert(std::is_same_v, std::invoke_result_t>); #if defined(XGBOOST_USE_SYCL) static_assert(std::is_same_v, std::invoke_result_t>); -#endif // defined(XGBOOST_USE_SYCL) if (this->Device().IsSycl()) { return sycl_fn(); } else { return DispatchDevice(cpu_fn, cuda_fn); } +#else + return DispatchDevice(cpu_fn, cuda_fn); +#endif // defined(XGBOOST_USE_SYCL) } // declare parameters