- Add conditional header includes for uint64_t in all build modes
- Include <stdint.h> in SIMPLESTL mode, <cstdint> in normal mode
- Move standard library headers to conditional compilation blocks
- Fix unsafe bit shift operations that could cause undefined behavior
- Ensure >64 CPU support works correctly in both SIMPLESTL and normal modes
- Tested successfully in NCNN_SIMPLESTL=ON mode
- Fix compilation error for std::pair usage in Windows processor detection
- std::pair requires <utility> header to be explicitly included
- Ensures compatibility across different compilers and environments
- Add #include <cstdint> to cpu.h, cpu.cpp, and platform.h.in
- Implement extended CpuSet class supporting >64 CPUs
- Add fast path for <=64 CPUs and extended path for >64 CPUs
- Include necessary headers for std::max, std::vector, memset, etc.
- Fix original code's missing stdint.h includes for uint64_t usage
- Maintain backward compatibility with platform-specific APIs
Fixes#6142
* Use platform-specific APIs for environment variables
The previous patch used `putenv` as a quick fix for Windows compatibility. However, `putenv` is a legacy API and not the recommended choice.
This commit replaces the single `putenv` call with the most appropriate function for each platform:
- On Windows, it now uses the modern and secure `_putenv_s`.
- On Unix-like systems, it uses the standard `setenv`.
---------
Co-authored-by: nihui <shuizhuyuanluo@126.com>
* zfh zvfh xtheadvector infra
* dispatch for rvv and xtheadvector
* dispatch for non-vector zfh
* port xtheadvector recp rsqrt trunc
* general rvv gemm
* c906 and c910 ci
* old tuple code clean
* update riscv64 ci
* update build doc
* drop old th1520 toolchain
* benchmark: Don't use std::thread when NCNN_THREADS is OFF
* Add wasi support
cmake -B build -DCMAKE_BUILD_TYPE=Release \
--toolchain ${wasi_sdk}/share/cmake/wasi-sdk.cmake \
-DNCNN_RUNTIME_CPU=OFF \
-DNCNN_DISABLE_EXCEPTION=ON \
-DNCNN_THREADS=OFF
cmake --build build
After build, you can run benchncnn on cmdline with wasmtime:
wasmtime --dir . benchncnn
* get_physical_cpu_count api family
* set default to physical big cpu
* always treat smt core as big core
* is_smt_cpu
* get max freq mhz on windows
* windows thread affinity