Implement SDMA copy rect for gfx9.

Fix pitch overflow due to small element detection.
Add wide pitch 2D copy handling.
Cleanup code duplication.

Change-Id: I93b1584aba8e5964957eb7ab3544df806ca3e2f9
这个提交包含在:
Sean Keely 于 2018-08-29 19:13:07 -04:00 提交
1 父节点 aca00b7238
当前提交 e0839ab27e
13 个文件已更改
+1015 -473

没有与搜索条件相匹配的文件

+1
查看文件
@@ -172,6 +172,7 @@ struct AmdExtTable {
decltype(hsa_amd_queue_intercept_create)* hsa_amd_queue_intercept_create_fn;
decltype(hsa_amd_queue_intercept_register)* hsa_amd_queue_intercept_register_fn;
decltype(hsa_amd_queue_set_priority)* hsa_amd_queue_set_priority_fn;
decltype(hsa_amd_memory_async_copy_rect)* hsa_amd_memory_async_copy_rect_fn;
};
// Table to export HSA Core Runtime Apis
+37
查看文件
@@ -882,6 +882,43 @@ hsa_status_t HSA_API
const hsa_signal_t* dep_signals,
hsa_signal_t completion_signal);
/*
[Provisional API]
Pitched memory descriptor.
All elements must be 4 byte aligned. Pitch and slice are in bytes.
*/
typedef struct hsa_pitched_ptr_s {
void* base;
size_t pitch;
size_t slice;
} hsa_pitched_ptr_t;
/*
[Provisional API]
Copy direction flag.
*/
typedef enum {
hsaHostToHost = 0,
hsaHostToDevice = 1,
hsaDeviceToHost = 2,
hsaDeviceToDevice = 3
} hsa_amd_copy_direction_t;
/*
[Provisional API]
SDMA 3D memory copy API. The same requirements must be met by src and dst as in
hsa_amd_memory_async_copy.
Both src and dst must be directly accessible to the copy_agent during the copy, src and dst rects
must not overlap.
CPU agents are not supported. API requires SDMA and will return an error if SDMA is not available.
Offsets and range carry x in bytes, y and z in rows and layers.
*/
hsa_status_t HSA_API hsa_amd_memory_async_copy_rect(
const hsa_pitched_ptr_t* dst, const hsa_dim3_t* dst_offset, const hsa_pitched_ptr_t* src,
const hsa_dim3_t* src_offset, const hsa_dim3_t* range, hsa_agent_t copy_agent,
hsa_amd_copy_direction_t dir, uint32_t num_dep_signals, const hsa_signal_t* dep_signals,
hsa_signal_t completion_signal);
/**
* @brief Type of accesses to a memory pool from a given agent.
*/