The Journal of Supercomputing

, Volume 71, Issue 6, pp 2050–2065 | Cite as

O2WebCL: an automatic OpenCL-to-WebCL translator for high performance web computing

  • Myeongjin Cho
  • Youngsun Han
  • Minseong Kim
  • Seon Wook Kim


HTML5 has become very attractive for cross-platform applications on software-side. Likewise, GPU has increased in popularity due to its energy efficiency of parallel execution on hardware-side. JavaScript, which performs dynamic operations of HTML5, is natively slow. To resolve the performance problem, web computing language (WebCL) can be utilized. WebCL operates by adapting open computing language (OpenCL) codes for web execution. Programming of WebCL code can be quite challenging, however, for both OpenCL and web programmers. In this paper, we propose an OpenCL-to-WebCL translator infrastructure, called O2WebCL. O2WebCL consists of a fully automated OpenCL-to-WebCL translator and O2WebCL library. The O2WebCL translator converts OpenCL codes into WebCL codes and O2WebCL application programming interfaces. The O2WebCL library operates as a bridge between the OpenCL and WebCL libraries. We resolved some implementation issues for the bridge such as type conversion and indirect addressing. We evaluated the performance of our work and found that we could achieve, on average, 75 % of the performance of the equivalent OpenCL execution.


OpenCL WebCL JavaScript OpenCL to WebCL translation 



This work was supported by the Industrial Strategic Technology Development Program (10041664, The Development of Fusion Processor based on Multi-Shader GPU) funded by the Ministry of Trade, Industry and Energy (MI, Korea).


  1. 1.
    Worth C, Packard K (2003) Cairo: cross-device rendering for vector graphics. In: Proceedings of the 2003 Linux symposiumGoogle Scholar
  2. 2.
    Pennington H (1999) GTK+/Gnome application development. New Riders, IndianapolisGoogle Scholar
  3. 3.
    Dalheimer M (2002) Programming with QT: writing portable GUI applications on Unix and Win32. O’Reilly Media, Inc., USAGoogle Scholar
  4. 4.
    Neuburg M, Hayes S (1999) Real basic: the definitive guide. O’Reilly & Associates, Inc., USAGoogle Scholar
  5. 5.
    RAD Studio XE5. Available online
  6. 6.
    Berjon R, Faulkner S, Leithead T, Navara ED, O’Connor E, Pfeiffer S, Hickson I (2013) HTML5: A vocabulary and associated APIs for HTML and XHTML. W3C Candidate Recommendation World Wide Web Consortium, W3C (February 4, 2014)Google Scholar
  7. 7.
    Martinsen JK, Grahn H (2010) An alternative optimization technique for JavaScript engines. In: Proceedings of the third Swedish workshop on multi-core computing (MCC-10), pp 155–160Google Scholar
  8. 8.
    Mehrara M, Hsu P-C, Samadi M, Mahlke S (2011) Dynamic parallelization of JavaScript applications using an ultra-lightweight speculation mechanism. In: 2011 IEEE 17th international symposium on high performance computer architecture (HPCA). IEEE, pp 87–98Google Scholar
  9. 9.
    Fortuna E, Anderson O, Ceze L, Eggers S (2010) A limit study of JavaScript parallelism. In: 2010 IEEE international symposium on workload characterization (IISWC). IEEE, pp 1–10Google Scholar
  10. 10.
    Khronos OpenCL Working Group (2010) The OpenCL Specification, Version 1.1. Document Revision, 44Google Scholar
  11. 11.
    Pheatt C (2008) Intel threading building blocks. J Comput Sci Coll 23(4):298–298Google Scholar
  12. 12.
  13. 13.
    WebCL-Heterogeneous parallel computing in HTML5 web browsers. Available online
  14. 14.
    Jeon W, Brutch T, Gibbs S (2012) WebCL for hardware-accelerated web applications. In: WWW’12 Dev. Lyon, FranceGoogle Scholar
  15. 15.
    Vaughan-Nichols SJ (2008) The mobile web comes of age. IEEE Comput 41(11):15–17CrossRefGoogle Scholar
  16. 16.
    Nokia WebCL Extension for Firefox. Available online
  17. 17.
    FireFox WebCL Branch. Available online
  18. 18.
    Node-webcl, an implementation of Khronos WebCL specification using Node.JS. Available online
  19. 19.
    V8 JavaScript Engine. Available online
  20. 20.
    SpiderMonkey JavaScript Engine. Available online
  21. 21.
    WebKit: an open source web browser engine. Available online
  22. 22.
    Ha J, Haghighat MR, Cong S, McKinley KS (2009) A concurrent trace-based just-in-time compiler for single-threaded JavaScript. PESPMA 2009:47Google Scholar
  23. 23.
    Lee S-W, Moon S-M (2011) Selective just-in-time compilation for client-side mobile javascript engine. In: Proceedings of the 14th international conference on compilers, architectures and synthesis for embedded systems. ACM, pp 5–14Google Scholar
  24. 24.
    Martinsen JK, Grahn H (2011) Thread-level speculation as an optimization technique in web applications—initial results. In: 2011 6th IEEE international symposium on industrial embedded systems (SIES). IEEE, pp 83–86Google Scholar
  25. 25.
    Baskaran MM, Ramanujam J, Sadayappan P (2010) Automatic C-to-CUDA code generation for affine programs. In: Compiler construction. Springer, Berlin, pp 244–263Google Scholar
  26. 26.
    Lee S, Eigenmann R (2010) OpenMPC: Extended OpenMP programming and tuning for GPUs. In: Proceedings of the 2010 ACM/IEEE international conference for high performance computing, networking, storage and analysis. IEEE Computer Society, pp 1–11Google Scholar
  27. 27.
    Zakai A (2011) Emscripten: an LLVM-to-JavaScript compiler. In: Proceedings of the ACM international conference companion on object oriented programming systems languages and applications companion. ACM, pp 301–312Google Scholar
  28. 28.
  29. 29.
  30. 30.
    Terry P (1985) CLANG—a simple teaching language. ACM SIGPLAN Not 20(12):54–63CrossRefGoogle Scholar
  31. 31.
    Typed Array Specification. Available online
  32. 32.

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  1. 1.Department of Electrical and Computer EngineeringKorea UniversitySeoulRepublic of Korea
  2. 2.Department of Electronic EngineeringKyungil UniversityGyeongsan-siRepublic of Korea

Personalised recommendations