pytorch / cpuinfo

CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)
BSD 2-Clause "Simplified" License
970 stars 308 forks source link

Fix size check of max processor count #199

Closed prashanthswami closed 8 months ago

prashanthswami commented 8 months ago

On 64-bit systems, size_t will not overflow when the function to get max processors returns UINT32_MAX. Explicitly check for the proper value so that both 32-bit and 64-bit systems will succeed.

prashanthswami commented 8 months ago

@malfet Flagging as the fix for the size check you flagged in the recently landed RISC-V CL.

prashanthswami commented 8 months ago

I see the cmake-windows bot failed but it seems to have failed in something unrelated . . . I'm assuming I can ignore that? (I don't see a button to re-run that might help me determine if this just flaked?)