The Journal of Supercomputing

, Volume 72, Issue 2, pp 545–566 | Cite as

Kernel density estimation in accelerators

Implementation and performance evaluation
  • Unai Lopez-Novoa
  • Alexander Mendiburu
  • Jose Miguel-Alonso


Kernel density estimation (KDE) is a popular technique used to estimate the probability density function of a random variable. KDE is considered a fundamental data smoothing algorithm, and it is a common building block in many scientific applications. In a previous work we presented S-KDE, an efficient algorithmic approach to compute KDE that outperformed other state-of-the-art implementations, providing accurate results in much reduced execution times. Its parallel implementation targeted multi- and many-core processors. In this work we present an OpenCL implementation of S-KDE, targeting modern accelerators in a portable way. We test our implementation on three accelerators from different manufacturers, achieving speedups around \(5\times \) compared to a hand-tuned serial version of S-KDE. We also analyze the performance of the code in these accelerators, to find out to what extent our code exploits their capabilities.


Kernel density estimation Performance analysis OpenCL  Many-core processors GPGPU 


  1. 1.
    Agosta G, Barenghi A, Di Federico A, Pelosi G (2015) Opencl performance portability for general-purpose computation on graphics processor units: an exploration on cryptographic primitives. Concurr Comput Pract Exp 27(14):3633–3660CrossRefGoogle Scholar
  2. 2.
  3. 3.
    Cramer T, Schmidl D, Klemm M, an Mey D (2012) Openmp programming on intel xeon phi coprocessors: an early performance comparison. In: Proceedings of the many-core applications research community symposium, pp 38–44Google Scholar
  4. 4.
    Danalis A, Marin G, McCurdy C, Meredith JS, Roth PC, Spafford K, Tipparaju V, Vetter JS (2010) The scalable heterogeneous computing (shoc) benchmark suite. In: Proceedings of the 3rd workshop on general-purpose computation on graphics processing units, ACM, New York, GPGPU ’10, pp 63–74Google Scholar
  5. 5.
    Elgammal A, Duraiswami R, Davis L (2003) Efficient kernel density estimation using the fast gauss transform with applications to color modeling and tracking. IEEE Trans Pattern Anal Mach Intell 25(11):1499–1504CrossRefGoogle Scholar
  6. 6.
    Fukunaga K (1990) Introduction to statistical pattern recognition, 2nd edn. Academic Press Professional Inc, San DiegoMATHGoogle Scholar
  7. 7.
    Jeffers J, Reinders J (2013) Intel Xeon Phi Coprocessor High Performance Programming, 1st edn. Morgan Kaufmann Publishers Inc., San FranciscoGoogle Scholar
  8. 8.
    Jia H, Zhang Y, Long G, Xu J, Yan S, Li Y (2012) Gpuroofline: a model for guiding performance optimizations on gpus. Euro-Par Parallel Processing, Lecture Notes in Computer Science, vol 7484. Springer, Berlin, pp 920–932Google Scholar
  9. 9.
    Khronos OpenCL Working Group , Munshi A (ed) (2008) The OpenCL specification. Khronos Group, Beaverton, ORGoogle Scholar
  10. 10.
    Kim KH, Kim K, Park QH (2011) Performance analysis and optimization of three-dimensional FDTD on GPU using roofline model. Comput Phys Commun 182(6):1201–1207CrossRefMATHGoogle Scholar
  11. 11.
    Kirk DB, WmW Hwu (2010) Programming Massively Parallel Processors: A Hands-on Approach, 1st edn. Morgan Kaufmann Publishers Inc., San FranciscoGoogle Scholar
  12. 12.
    Lattner C, Adve V (2004) Llvm: a compilation framework for lifelong program analysis transformation. In: Proceedings of the international symposium on code generation and optimization, CGO, pp 75–86Google Scholar
  13. 13.
    Lee VW, Kim C, Chhugani J, Deisher M, Kim D, Nguyen AD, Satish N, Smelyanskiy M, Chennupaty S, Hammarlund P, Singhal R, Dubey P (2010) Debunking the 100x gpu vs. cpu myth: an evaluation of throughput computing on cpu and gpu. SIGARCH Comput Archit News 38(3):451–460CrossRefGoogle Scholar
  14. 14.
    Lopez-Novoa U, Mendiburu A, Miguel-Alonso J (2015a) A survey of performance modeling and simulation techniques for accelerator-based computing. IEEE Trans Parallel Distrib Syst 26(1):272–281Google Scholar
  15. 15.
    Lopez-Novoa U, Sáenz J, Mendiburu A, Miguel-Alonso J (2015b) An efficient implementation of kernel density estimation for multi-core and many-core architectures. Int J High Perform Comput Appl 29(3):331–347CrossRefGoogle Scholar
  16. 16.
    Lopez-Novoa U, Sáenz J, Mendiburu A, Miguel-Alonso J, Errasti I, Esnaola G, Ezcurra A, Ibarra-Berastegi G (2015c) Multi-objective environmental model evaluation by means of multidimensional kernel density estimators: Efficient and multi-core implementations. Environ Model Softw 63:123–136CrossRefGoogle Scholar
  17. 17.
    Munshi A, Gaster B, Mattson TG, Fung J, Ginsburg D (2011) OpenCL Programming Guide, 1st edn. Addison-Wesley Professional, USAGoogle Scholar
  18. 18.
    Nickolls J, Dally W (2010) The gpu computing era. IEEE Micro 30(2):56–69CrossRefGoogle Scholar
  19. 19.
  20. 20.
    Pennycook S, Hammond S, Wright S, Herdman J, Miller I, Jarvis S (2013) An investigation of the performance portability of opencl. J Parallel Distrib Comput 73(11):1439–1450CrossRefGoogle Scholar
  21. 21.
    Seo S, Lee J, Jo G, Lee J (2013) Automatic opencl work-group size selection for multicore cpus. In: Proceedings of the 22nd international conference on parallel architectures and compilation techniques (PACT), pp 387–397Google Scholar
  22. 22.
    Sheather SJ (2004) Density estimation. Statist Sci 588–597Google Scholar
  23. 23.
    Silverman BW (1986) Density estimation for statistics and data analysis. Chapman & Hall, LondonGoogle Scholar
  24. 24.
    Torres Y, Gonzalez-Escribano A, Llanos DR (2013) ubench: exposing the impact of cuda block geometry in terms of performance. J Supercomput 65(3):1150–1163CrossRefGoogle Scholar
  25. 25.
    Wang Y, Qin Q, SEE SCW, Lin J (2013) Performance portability evaluation for openacc on intel knights corner and nvidia kepler. In: HPC China 2013Google Scholar
  26. 26.
    Weissbach R (2006) A general kernel functional estimator with general bandwidth-strong consistency and applications. J Nonparam Stat 18(1):1–12CrossRefMathSciNetMATHGoogle Scholar
  27. 27.
    Williams S, Waterman A, Patterson D (2009) Roofline: an insightful visual performance model for multicore architectures. Commun ACM 52(4):65–76CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2015

Authors and Affiliations

  • Unai Lopez-Novoa
    • 1
    • 2
  • Alexander Mendiburu
    • 1
  • Jose Miguel-Alonso
    • 1
  1. 1.Department of Computer Architecture and Technology, Intelligent Systems GroupUniversity of the Basque Country UPV/EHUSan SebastiánSpain
  2. 2.Deusto Institute of Technology, DeustoTechUniversity of DeustoBilbaoSpain

Personalised recommendations