Add interface to DMA copy directly to a target engine.

Change-Id: Ic87cfeabb11c1a465f98f3f444d39955f5300525
This commit is contained in:
Jonathan Kim
2023-02-02 14:42:30 -05:00
parent 8f27f495c6
commit 30920fc94d
12 changed files with 224 additions and 0 deletions
+1
View File
@@ -155,6 +155,7 @@ struct AmdExtTable {
decltype(hsa_amd_memory_pool_allocate)* hsa_amd_memory_pool_allocate_fn;
decltype(hsa_amd_memory_pool_free)* hsa_amd_memory_pool_free_fn;
decltype(hsa_amd_memory_async_copy)* hsa_amd_memory_async_copy_fn;
decltype(hsa_amd_memory_async_copy_on_engine)* hsa_amd_memory_async_copy_on_engine_fn;
decltype(hsa_amd_memory_copy_engine_status)* hsa_amd_memory_copy_engine_status_fn;
decltype(hsa_amd_agent_memory_pool_get_info)* hsa_amd_agent_memory_pool_get_info_fn;
decltype(hsa_amd_agents_allow_access)* hsa_amd_agents_allow_access_fn;
+35
View File
@@ -1273,6 +1273,41 @@ hsa_status_t HSA_API
uint32_t num_dep_signals,
const hsa_signal_t* dep_signals,
hsa_signal_t completion_signal);
/**
* @brief Asynchronously copy a block of memory from the location pointed to by
* @p src on the @p src_agent to the memory block pointed to by @p dst on the @p
* dst_agent on engine_id.
*
* WARNING: Concurrent use of this call with hsa_amd_memory_async_copy can result
* in resource conflicts as HSA runtime will auto assign engines with the latter
* call. Approach using both calls concurrently with caution.
*
* All param definitions are identical to hsa_amd_memory_async_copy with the
* exception of engine_id and force_copy_on_sdma.
*
* @param[in] - engine_id Target engine defined by hsa_amd_sdma_engine_id_t.
* Client should use hsa_amd_memory_copy_engine_status first to get the ID
* availability.
*
* @param[in] - force_copy_on_sdma By default, blit kernel copies are used when
* dst_agent == src_agent. Setting this to true will force the copy over SDMA1.
*
* All return definitions are identical to hsa_amd_memory_async_copy with the
* following ammendments:
*
* @retval ::HSA_STATUS_ERROR_INVALID_ARGUMENT The source or destination
* pointers are NULL, or the completion signal is 0 or engine_id is improperly
* bounded.
*/
hsa_status_t HSA_API
hsa_amd_memory_async_copy_on_engine(void* dst, hsa_agent_t dst_agent, const void* src,
hsa_agent_t src_agent, size_t size,
uint32_t num_dep_signals,
const hsa_signal_t* dep_signals,
hsa_signal_t completion_signal,
hsa_amd_sdma_engine_id_t engine_id,
bool force_copy_on_sdma);
/**
* @brief Reports the availability of SDMA copy engines.
*