add 'memoize' option to cache kernel computations