projectNe10 / Ne10

An open optimized software library project for the ARM® Architecture
Other
1.46k stars 408 forks source link

Ne10_init fails with many cores #194

Open philt2001 opened 6 years ago

philt2001 commented 6 years ago

To check if NEON is available, /proc/cpuinfo is read into a buffer of size 1024*4. On a CI server, has 8 cores with lots of options, the total length of /proc/cpuinfo is over 7500 bytes, so Ne10 fails to init. The simple fix was to increase the buffer size.

A more permanent fix, assuming each core has the same options, could be to check that a whole cores worth of options has been read (e.g. I think a new line is used to separate the cores) before checking the flags.

Additionally, if there is a "problem" reading in /proc/cpuinfo, then falling back to C mode could be an option, possible provided to Ne10_init()

StanLSun commented 6 years ago

The assumption of "echo core has the same options" seems dangerous to me. I think a better solution is to check every line on the fly.