generalize for MKL