Skip to content

Commit 2a5418d

Browse files
committed
Correct incorrect output of ending memory address
1 parent 193db17 commit 2a5418d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/cuda_mav.cuh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ public:
144144

145145
for (auto region : memoryRegions) {
146146
htmlStream << "<h2>Region: " << std::get<3>(region) << "</h2>" << std::endl;
147-
htmlStream << "<p>Start Address: " << std::get<0>(region) << " (End Address:) " << std::get<0>(region)+ std::get<1>(region) * std::get<2>(region) << "</p>" << std::endl;
147+
// As the memory region is already a pointer of the correct data type, we do not actually need to multiply the size by the size of the data type
148+
htmlStream << "<p>Start Address: " << std::get<0>(region) << " (End Address:) " << std::get<0>(region) + std::get<1>(region) << "</p>" << std::endl;
148149
htmlStream << "<p>Number of Elements: " << std::get<1>(region) << "</p>" << std::endl;
149150
htmlStream << "<p>Size of Single Element: " << std::get<2>(region) << "</p>" << std::endl;
150151
}
@@ -224,7 +225,8 @@ public:
224225
// Store the start address, number of elements and the size of a single element
225226
jsStream << "{";
226227
jsStream << "\"StartAddress\": \"" << std::hex << std::get<0>(region) << "\",";
227-
jsStream << "\"EndAddress\": \"" << std::get<0>(region) + std::get<1>(region) * std::get<2>(region) << "\",";
228+
// As the memory region is already a pointer of the correct data type, we do not actually need to multiply the size by the size of the data type
229+
jsStream << "\"EndAddress\": \"" << std::get<0>(region) + std::get<1>(region) << "\",";
228230
jsStream << "\"NumberOfElements\": " << std::dec << std::get<1>(region) << ",";
229231
jsStream << "\"SizeOfSingleElement\": " << std::get<2>(region) << ",";
230232
jsStream << "\"Name\": \"" << std::get<3>(region) << "\"";

0 commit comments

Comments
 (0)