Commit 1b5c8286 authored by Jens Korinth's avatar Jens Korinth
Browse files

Implement top-level API for job-attached transfers

* top-level API is tapasco_device_job_set_transfer, which in turn uses
  tapasco_job level functions
parent 277dd3dd
......@@ -148,6 +148,15 @@ tapasco_res_t tapasco_device_job_set_arg(tapasco_dev_ctx_t *dev_ctx,
return tapasco_jobs_set_arg(dev_ctx->jobs, j_id, arg_idx, arg_len, arg_value);
}
tapasco_res_t tapasco_device_job_set_arg_transfer(tapasco_dev_ctx_t *dev_ctx,
tapasco_job_id_t const job_id, uint32_t arg_idx,
size_t const arg_len, void *arg_value,
tapasco_device_alloc_flag_t const flags)
{
return tapasco_jobs_set_arg_transfer(dev_ctx->jobs, job_id, arg_idx,
arg_len, arg_value, flags);
}
tapasco_res_t tapasco_device_job_get_return(tapasco_dev_ctx_t *dev_ctx,
tapasco_job_id_t const j_id, size_t const ret_len,
void *ret_value)
......
......@@ -396,6 +396,25 @@ tapasco_res_t tapasco_device_job_set_arg(tapasco_dev_ctx_t *dev_ctx,
tapasco_job_id_t const job_id, uint32_t arg_idx,
size_t const arg_len, void const *arg_value);
/**
* Sets the arg_idx'th argument of function func_id to trigger an automatic
* transfer to and from memory allocated internally. Copies data from arg_value
* to a newly allocated buffer before execution of the job, and copies data from
* the buffer back to arg_value after its end.
* Use flags to control memory location, e.g., pe-local memory.
* @param dev_ctx device context
* @param job_id job id
* @param arg_idx argument number
* @param arg_len length of arg_value in bytes (must be power of 4)
* @param arg_value data to set argument to.
* @param flags allocation flags, see @tapasco_device_alloc_flag_t.
* @return TAPASCO_SUCCESS if successful, TAPASCO_FAILURE otherwise.
**/
tapasco_res_t tapasco_device_job_set_arg_transfer(tapasco_dev_ctx_t *dev_ctx,
tapasco_job_id_t const job_id, uint32_t arg_idx,
size_t const arg_len, void *arg_value,
tapasco_device_alloc_flag_t const flags);
/**
* Gets the value of the arg_idx'th argument of function func_id.
* @param dev_ctx device context
......
Markdown is supported
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