Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.
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
4 changes: 4 additions & 0 deletions utils.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -673,6 +673,10 @@ CUHOST inline bool canUse32BitIndexMath(
if (numel >= max32) return false;
if (numel == 0) return max32 > 0;

// A null stride array is DLPack's compact row-major tensor: the largest
// offset is numel-1, already known < max32 here, so 32-bit math is safe.
if (stride == nullptr) return true;

int64_t offset = 0;
int64_t lin_index = numel - 1;

Expand Down