Sort comparison function passed as a macro to kernel

Removed sorting direction parameter, which is now implicit in the
passed macro.