In this tutorial, we will introduce the Cache-aware Roofline Model (CARM) and expose its principles when modelling the performance of Intel CPU and GPU devices. We will also showcase how CARM implementation in Intel® Advisor can be used to drive the application optimization. For this purpose, we will rely on epistasis detection as a case-study, which is an important application in bioinformatics. For lntel GPUs, we will show how CARM can be used to detect execution bottlenecks and provide useful hints on which type of optimizations to apply to fully exploit device capabilities. The guidelines provided by CARM were fundamental to achieve the speedups of more than 20x when compared to the baseline code.