Skip to content

Instantly share code, notes, and snippets.

View kinchungwong's full-sized avatar

Ryan Wong kinchungwong

View GitHub Profile
@kinchungwong
kinchungwong / RectUtility.cpp
Created March 19, 2018 08:33
RectUtility.cpp
// ======
//
// This code is not intended to be valid for C++ compilation.
//
// It is provided to illustrate idea and design, and is provided
// for the purpose of discussion.
//
// ======
#include <cstdint>
@kinchungwong
kinchungwong / SimdRowFilterExample.cpp
Created March 19, 2018 08:37
SimdRowFilterExample.cpp
//
// SimdRowFilterExample.cpp
//
// This code skeleton illustrates the structure of SIMD code
// used to take three input rows and generate one output row.
//
// In a different sample file, "SimdBetterStyleSupport.cpp",
// a small SIMD stylistic support library will be sketched
// to improve the readability of SIMD code.
//
@kinchungwong
kinchungwong / SimdBetterStyleSupport.cpp
Created March 19, 2018 08:38
SimdBetterStyleSupport.cpp
//
// SimdBetterStyleSupport.cpp
//
// This is a code skeleton that illustrates how to improve the readability
// of SIMD code using a small stylistic support library.
//
#include <cstdint>
#include <vector>
#include <emmintrin.h>
@kinchungwong
kinchungwong / cpp_template_based_micro_opt_from_stackoverflow_profile.md
Created March 19, 2018 11:11
Guidelines for C++ template-based micro-optimization

Guidelines for C++ template-based micro-optimization

  1. Start with the lowest level, most frequently executed code first.
  2. Having chosen a fixed set of data types, implement the code in assembly.
  3. Reimplement the code in plain C, not using any abstract data types, so that it compiles into the same assembly instructions.
  4. Repeat steps 2 and 3 with a few different sets of data types.
  5. Take all of the C code from steps 2 and 4, and reimplement using C++ templates. Determine the template arguments.
  6. Identify all of the non-type-based validations needed by the template function.
  7. Identify all of the type-based validations needed by the template function.
  8. Package the template function into a class template method, and implement the non-type-based validations as its methods.
@kinchungwong
kinchungwong / question_rv32v_imgproc.md
Last active March 26, 2018 11:00
Question on RISC-V Vector Extension (RV32V) regarding applications in image processing
@kinchungwong
kinchungwong / my_pledge_to_opencv.md
Created March 26, 2018 20:45
My pledge to OpenCV

My pledge to OpenCV

I will put, the greater good to the OpenCV project and its community, before:

  • my time
  • my expenditure
  • my views
  • my ego.
@kinchungwong
kinchungwong / opencv_universal_intrinsics_doctrine_vadim.md
Last active March 28, 2018 05:44
The philosophy of OpenCV universal intrinsics (must read)
@kinchungwong
kinchungwong / git_clone_same_repo_repeatedly_save_bandwidth.md
Last active March 28, 2018 05:46
Q: Having to clone OpenCV everyday, bandwidth?
@kinchungwong
kinchungwong / install_python_on_windows.md
Created March 28, 2018 06:14
Installing Python on Windows where CMake can find it easily
@kinchungwong
kinchungwong / removing_symlink_windows10.md
Created March 28, 2018 06:18
Removing symbolic link on Windows 10