Commit 35d0646e authored by Carsten Heinz's avatar Carsten Heinz
Browse files

Revert "Remove duplicated function"

This reverts commit 5fc85b65.
parent 7402fcdf
Pipeline #555 passed with stage
in 8 minutes and 7 seconds
......@@ -216,6 +216,19 @@ struct Tapasco {
/** Returns true, if initialization was successful and device is ready. **/
bool is_ready() const noexcept { return _ok; }
template<typename R, typename... Targs>
job_future launch(tapasco_kernel_id_t const k_id,
RetVal<R>& ret, Targs... args) noexcept
{
tapasco_job_id_t j_id { 0 };
tapasco_res_t res { TAPASCO_SUCCESS };
auto mkerr = [](tapasco_res_t r) { return [r]() { return r; }; };
if ((res = tapasco_device_acquire_job_id(devctx, &j_id, k_id, TAPASCO_DEVICE_ACQUIRE_JOB_ID_BLOCKING)) != TAPASCO_SUCCESS) return mkerr(res);
if ((res = set_args(j_id, 0, args...)) != TAPASCO_SUCCESS) return mkerr(res);
if ((res = tapasco_device_job_launch(devctx, j_id, TAPASCO_DEVICE_JOB_LAUNCH_NONBLOCKING)) != TAPASCO_SUCCESS) return mkerr(res);
return [this, j_id, &ret, &args...]() { return collect<R, Targs...>(j_id, ret, args...); };
}
template<typename... Targs>
job_future launch(tapasco_kernel_id_t const k_id, Targs... args) noexcept
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment