add a generic macro to define kernels