Make some tweaks to make `sum` operations less frequently
Fix build error.
Remove trailing whitespace.
Merge pull request #1345 from pengx17:2.4_tvl1ocl_opt