Memoize misc.select_block_grid_sizes() and functions for getting device attribs.