mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add support for batched dispatch to userspace AUBs
This commit as aimed to add support for batched dispatch, but doesn't make it the default mode for AubCSR yet. Change-Id: I4dc366ec5f01adf2c4793009da2100ba0230c60a
This commit is contained in:

committed by
sys_ocldev

parent
920d952a4a
commit
7c42353c4c
@ -168,28 +168,28 @@ HWTEST_P(AUBMapImage, MapUpdateUnmapVerify) {
|
||||
auto mappedPtr = pCmdQ->enqueueMapImage(srcImage, CL_TRUE, CL_MAP_WRITE | CL_MAP_READ,
|
||||
origin, region, &mappedRowPitch, &mappedSlicePitch,
|
||||
0, nullptr, nullptr, retVal);
|
||||
if (!srcImage->allowTiling()) {
|
||||
pCommandStreamReceiver->makeResident(*srcImage->getGraphicsAllocation());
|
||||
pCommandStreamReceiver->makeNonResident(*srcImage->getGraphicsAllocation());
|
||||
}
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
auto mappedPtrStart = static_cast<uint8_t *>(mappedPtr);
|
||||
auto srcMemoryStart = srcMemory;
|
||||
uint8_t *mappedPtrStart;
|
||||
uint8_t *srcMemoryStart;
|
||||
|
||||
// validate mapped region
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputSlicePitch * origin[2]);
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputRowPitch * origin[1]);
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, elementSize * origin[0]);
|
||||
for (size_t z = 0; z < region[2]; z++) {
|
||||
for (size_t y = 0; y < region[1]; y++) {
|
||||
AUBCommandStreamFixture::expectMemory<FamilyType>(mappedPtrStart, srcMemoryStart, elementSize * region[0]);
|
||||
mappedPtrStart = ptrOffset(mappedPtrStart, mappedRowPitch);
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputRowPitch);
|
||||
if (srcImage->allowTiling()) {
|
||||
mappedPtrStart = static_cast<uint8_t *>(mappedPtr);
|
||||
srcMemoryStart = srcMemory;
|
||||
|
||||
// validate mapped region
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputSlicePitch * origin[2]);
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputRowPitch * origin[1]);
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, elementSize * origin[0]);
|
||||
for (size_t z = 0; z < region[2]; z++) {
|
||||
for (size_t y = 0; y < region[1]; y++) {
|
||||
AUBCommandStreamFixture::expectMemory<FamilyType>(mappedPtrStart, srcMemoryStart, elementSize * region[0]);
|
||||
mappedPtrStart = ptrOffset(mappedPtrStart, mappedRowPitch);
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputRowPitch);
|
||||
}
|
||||
mappedPtrStart = ptrOffset(mappedPtrStart, mappedSlicePitch - (mappedRowPitch * region[1]));
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputSlicePitch - (inputRowPitch * (region[1])));
|
||||
}
|
||||
mappedPtrStart = ptrOffset(mappedPtrStart, mappedSlicePitch - (mappedRowPitch * region[1]));
|
||||
srcMemoryStart = ptrOffset(srcMemoryStart, inputSlicePitch - (inputRowPitch * (region[1])));
|
||||
}
|
||||
|
||||
// write to mapped ptr
|
||||
|
@ -107,14 +107,18 @@ TEST_F(AUBcommandstreamTests, makeResident) {
|
||||
uint8_t buffer[0x10000];
|
||||
size_t size = sizeof(buffer);
|
||||
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
|
||||
commandStreamReceiver.createAllocationAndHandleResidency(buffer, size);
|
||||
auto graphicsAllocation = commandStreamReceiver.createAllocationAndHandleResidency(buffer, size);
|
||||
ResidencyContainer allocationsForResidency = {graphicsAllocation};
|
||||
commandStreamReceiver.processResidency(&allocationsForResidency);
|
||||
}
|
||||
|
||||
HWTEST_F(AUBcommandstreamTests, expectMemorySingle) {
|
||||
uint32_t buffer = 0xdeadbeef;
|
||||
size_t size = sizeof(buffer);
|
||||
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
|
||||
commandStreamReceiver.createAllocationAndHandleResidency(&buffer, size);
|
||||
auto graphicsAllocation = commandStreamReceiver.createAllocationAndHandleResidency(&buffer, size);
|
||||
ResidencyContainer allocationsForResidency = {graphicsAllocation};
|
||||
commandStreamReceiver.processResidency(&allocationsForResidency);
|
||||
|
||||
AUBCommandStreamFixture::expectMemory<FamilyType>(&buffer, &buffer, size);
|
||||
}
|
||||
@ -128,7 +132,10 @@ HWTEST_F(AUBcommandstreamTests, expectMemoryLarge) {
|
||||
}
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
|
||||
commandStreamReceiver.createAllocationAndHandleResidency(buffer, sizeBuffer);
|
||||
auto graphicsAllocation = commandStreamReceiver.createAllocationAndHandleResidency(buffer, sizeBuffer);
|
||||
ResidencyContainer allocationsForResidency = {graphicsAllocation};
|
||||
commandStreamReceiver.processResidency(&allocationsForResidency);
|
||||
|
||||
AUBCommandStreamFixture::expectMemory<FamilyType>(buffer, buffer, sizeBuffer);
|
||||
delete[] buffer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user