SWDEV-301823 - Optimize hipMemset2D/3D

Change-Id: Ibe560149a263c2ac6b08e4eb1a1d331d2aeac78c
Bu işleme şunda yer alıyor:
Sarbojit Sarkar authored and Saleel Kudchadker committed 2021-09-27 14:10:06 -04:00
1 ebeveyn cbb8d82bdb
işleme 22a847f3ce
2 files changed
+24 -6

No files matched your search

+17 -4
Dosyayı Görüntüle
@@ -2211,10 +2211,23 @@ void VirtualGPU::submitFillMemory(amd::FillMemoryCommand& cmd) {
amd::ScopedLock lock(execution());
profilingBegin(cmd);
if (!fillMemory(cmd.type(), &cmd.memory(), cmd.pattern(), cmd.patternSize(), cmd.origin(),
cmd.size())) {
cmd.setStatus(CL_INVALID_OPERATION);
size_t width = cmd.size().c[0];
size_t height = cmd.size().c[1];
size_t depth = cmd.size().c[2];
size_t pitch = cmd.surface().c[0];
amd::Coord3D origin = cmd.origin();
amd::Coord3D region{cmd.surface().c[1], cmd.surface().c[2], depth};
amd::BufferRect rect;
rect.create(static_cast<size_t*>(origin), static_cast<size_t*>(region),
pitch, 0);
for (size_t slice = 0; slice < depth; slice++) {
for (size_t row = 0; row < height; row++) {
const size_t rowOffset = rect.offset(0, row, slice);
if (!fillMemory(cmd.type(), &cmd.memory(), cmd.pattern(), cmd.patternSize(),
amd::Coord3D{rowOffset, 0, 0}, amd::Coord3D{width, 1, 1})) {
cmd.setStatus(CL_INVALID_OPERATION);
}
}
}
profilingEnd(cmd);
}