Evaluating the impact of cache optimizations for stencil operations via two programming paradigms