@@ -134,11 +134,27 @@ namespace hpx::cuda::experimental {
134134 // -------------------------------------------------------------------------
135135 // OneWay Execution
136136 // -------------------------------------------------------------------------
137+ template <typename F, typename ... Ts>
138+ void post (F&& f, Ts&&... ts) const
139+ {
140+ post_impl (HPX_FORWARD (F, f), HPX_FORWARD (Ts, ts)...);
141+ }
142+
143+ // -------------------------------------------------------------------------
144+ // TwoWay Execution
145+ // -------------------------------------------------------------------------
146+ template <typename F, typename ... Ts>
147+ decltype (auto ) async_execute(F&& f, Ts&&... ts) const
148+ {
149+ return async_impl (HPX_FORWARD (F, f), HPX_FORWARD (Ts, ts)...);
150+ }
151+
152+ protected:
137153 // This is a simple wrapper for any cublas call, pass in the same arguments
138154 // that you would use for a cublas call except the cublas handle which is omitted
139155 // as the wrapper will supply that for you
140156 template <typename R, typename ... Params, typename ... Args>
141- std::enable_if_t <std::is_same_v<cublasStatus_t, R>, R> post (
157+ std::enable_if_t <std::is_same_v<cublasStatus_t, R>, R> post_impl (
142158 R (*cublas_function)(Params...), Args&&... args) const
143159 {
144160 // make sure we run on the correct device
@@ -159,30 +175,20 @@ namespace hpx::cuda::experimental {
159175 // forward a cuda function through to the cuda executor base class
160176 // (we permit the use of a cublas executor for cuda calls)
161177 template <typename R, typename ... Params, typename ... Args>
162- inline std::enable_if_t <std::is_same_v<cudaError_t, R>> post (
178+ inline std::enable_if_t <std::is_same_v<cudaError_t, R>> post_impl (
163179 R (*cuda_function)(Params...), Args&&... args) const
164180 {
165- return cuda_executor::post (
181+ return cuda_executor::post_impl (
166182 cuda_function, HPX_FORWARD (Args, args)...);
167183 }
168184
169- // -------------------------------------------------------------------------
170- // TwoWay Execution
171- // -------------------------------------------------------------------------
172- template <typename F, typename ... Ts>
173- decltype (auto ) async_execute(F&& f, Ts&&... ts) const
174- {
175- return async (HPX_FORWARD (F, f), HPX_FORWARD (Ts, ts)...);
176- }
177-
178- protected:
179185 // -------------------------------------------------------------------------
180186 // launch a cuBlas function and return a future that will become ready
181187 // when the task completes, this allows integration of GPU kernels with
182188 // hpx::futures and the tasking DAG.
183189 template <typename R, typename ... Params, typename ... Args>
184- hpx::future<std::enable_if_t <std::is_same_v<cublasStatus_t, R>>> async (
185- R (*cublas_function)(Params...), Args&&... args) const
190+ hpx::future<std::enable_if_t <std::is_same_v<cublasStatus_t, R>>>
191+ async_impl ( R (*cublas_function)(Params...), Args&&... args) const
186192 {
187193 return hpx::detail::try_catch_exception_ptr (
188194 [&]() {
@@ -208,9 +214,9 @@ namespace hpx::cuda::experimental {
208214 // forward a cuda function through to the cuda executor base class
209215 template <typename R, typename ... Params, typename ... Args>
210216 inline hpx::future<std::enable_if_t <std::is_same_v<cudaError_t, R>>>
211- async (R (*cuda_function)(Params...), Args&&... args) const
217+ async_impl (R (*cuda_function)(Params...), Args&&... args) const
212218 {
213- return cuda_executor::async (
219+ return cuda_executor::async_impl (
214220 cuda_function, HPX_FORWARD (Args, args)...);
215221 }
216222
0 commit comments