Browse Source

Catch invalid cpu count returned by CPU_COUNT_S

mips32 was seen to return zero here, driving nthreads to zero with subsequent fpe in blas_quickdivide
tags/v0.3.0^2
Martin Kroeker GitHub 7 years ago
parent
commit
7c861605b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      driver/others/memory.c

+ 2
- 1
driver/others/memory.c View File

@@ -209,7 +209,8 @@ int ret;
size = CPU_ALLOC_SIZE(nums);
ret = sched_getaffinity(0,size,cpusetp);
if (ret!=0) return nums;
nums = CPU_COUNT_S(size,cpusetp);
ret = CPU_COUNT_S(size,cpusetp);
if (ret > 0 && ret < nums) nums = ret;
CPU_FREE(cpusetp);
return nums;
#endif


Loading…
Cancel
Save