kfdtest: add KFDTestUtilQueue
Some infrastructures below, Implement SdmaTimePacket which records the global GPU timestamp. Introduce class AsyncMPSQ and AsyncMPMQ. AsyncMPSQ is aka async multiple packet single queue. It takes a set of packet when create and submits them to a GPU to run. While AsyncMPMQ is aka async multiple packet multiple queue. It manages a set of AsyncMPSQ, and use a forloop to do operations of AsyncMPSQ. Implement sdma_multicopy helper functions. Change-Id: I47e1d2ca9630113b2a1d85a0055f3f8ee629fb5f Signed-off-by: xinhui pan <xinhui.pan@amd.com>
This commit is contained in:
@@ -207,3 +207,24 @@ void SDMATrapPacket::InitPacket(unsigned int eventID) {
|
||||
packetData.HEADER_UNION.op = SDMA_OP_TRAP;
|
||||
packetData.INT_CONTEXT_UNION.int_context = eventID;
|
||||
}
|
||||
|
||||
SDMATimePacket::SDMATimePacket(void *destaddr) {
|
||||
InitPacket(destaddr);
|
||||
}
|
||||
|
||||
SDMATimePacket::~SDMATimePacket(void) {
|
||||
}
|
||||
|
||||
void SDMATimePacket::InitPacket(void *destaddr) {
|
||||
memset(&packetData, 0, SizeInBytes());
|
||||
|
||||
packetData.HEADER_UNION.op = SDMA_OP_TIMESTAMP;
|
||||
packetData.HEADER_UNION.sub_op = 1 << 1; /* Get Global GPU Timestamp*/
|
||||
|
||||
if (reinterpret_cast<unsigned long long>(destaddr) & 0x1f)
|
||||
WARN() << "SDMATimePacket dst address must aligned to 32bytes boundary" << std::endl;
|
||||
|
||||
SplitU64(reinterpret_cast<unsigned long long>(destaddr),
|
||||
packetData.ADDR_LO_UNION.DW_1_DATA, /*dst_addr_31_0*/
|
||||
packetData.ADDR_HI_UNION.DW_2_DATA); /*dst_addr_63_32*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user