Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions runtime/executor/tensor_parser_exec_aten.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,16 +56,15 @@ ET_NODISCARD Result<void*> getMemPlannedPtr(
const uint32_t memory_offset_high = allocation_info->memory_offset_high();

size_t memory_offset = memory_offset_low;
if (memory_offset_high > 0) {
if ((sizeof(size_t) > sizeof(uint32_t)) && (memory_offset_high > 0)) {
// The compiler should remove this always-true check on 64-bit systems.
ET_CHECK_OR_RETURN_ERROR(
sizeof(size_t) >= sizeof(uint64_t),
NotSupported,
"size_t cannot hold memory offset 0x%08" PRIx32 ".%08" PRIx32,
memory_offset_high,
memory_offset_low);
memory_offset |= static_cast<size_t>(memory_offset_high)
<< (sizeof(size_t) - sizeof(uint32_t));
memory_offset |= static_cast<size_t>(memory_offset_high) << 32;
}
return allocator->get_offset_address(memory_id, memory_offset, nbytes);
}
Expand Down