SWDEV-378006 - Adding a new guarantee macro to support printing args.

Change-Id: I9c838644e31a84d96a44b2bd10525a08d805a047
Dieser Commit ist enthalten in:
kjayapra-amd
2023-01-18 13:25:07 -08:00
committet von Karthik Jayaprakash
Ursprung 8c421b62f2
Commit b968394b4e
5 geänderte Dateien mit 15 neuen und 35 gelöschten Zeilen
+6 -4
Datei anzeigen
@@ -729,14 +729,16 @@ bool HostBlitManager::FillBufferInfo::PackInfo(const device::Memory& memory, siz
std::vector<FillBufferInfo>& packed_info) {
// 1. Validate input arguments
guarantee(fill_size >= pattern_size, "Pattern Size cannot be greater than fill size");
guarantee(fill_size <= memory.size(), "Cannot fill more than the mem object size");
guarantee(fill_size >= pattern_size, "Pattern Size: %u cannot be greater than fill size: %u \n",
pattern_size, fill_size);
guarantee(fill_size <= memory.size(), "Cannot fill: %u more than the mem object size:%u \n",
fill_size, memory.size());
// 2. Calculate the next closest dword aligned address for faster processing
size_t dst_addr = memory.virtualAddress() + fill_origin;
size_t aligned_dst_addr = amd::alignUp(dst_addr, sizeof(size_t));
guarantee(aligned_dst_addr >= dst_addr, "Aligned address cannot be greater than destination"
"address");
guarantee(aligned_dst_addr >= dst_addr, "Aligned address: %u cannot be greater than destination"
"address :%u \n", aligned_dst_addr, dst_addr);
// 3. If given address is not aligned calculate head and tail size.
size_t head_size = std::min(aligned_dst_addr - dst_addr, fill_size);