Apply a single, repeatable style checklist across all new/modified code:
1) Remove unused/redundant code
#includes and unused variables.2) Keep compiler/standard compatibility
{...} initializer lists).for if the codebase/toolchain constraints require explicit indexing.const T t = {}; over uninitialized default construction).3) Factor preprocessor/SIMD-heavy logic for readability
#if/#ifdef blocks for SSE/AVX/AVX512, move the implementation into small helper functions (e.g., packA_*, packB_*, subkernel_*) so the main algorithm focuses on tiling/control flow.4) Enforce formatting conventions
// comment with a space; keep meaningful text aligned with code).#if vs #ifdef) and consistent patterns.(void)opt;).Example (SIMD factoring)
static void packA_sse(const float* src, float* dst, int k, const Option& opt);
static void packA_avx(const float* src, float* dst, int k, const Option& opt);
for (int i = 0; i < M; i += TILE_M)
{
// keep tiling/control logic here
if (j == 0)
{
#if __SSE2__
#if __AVX__
packA_avx(A_ptr, AT_ptr, k, opt);
#else
packA_sse(A_ptr, AT_ptr, k, opt);
#endif
#endif
}
}
Enter the URL of a public GitHub repository