WebCL Overview and Roadmap

Similar documents
Heterogeneous Computing

GPGPU IGAD 2014/2015. Lecture 1. Jacco Bikker

Copyright Khronos Group 2012 Page 1. OpenCL 1.2. August 2012

ECE 574 Cluster Computing Lecture 17

Khronos and the Mobile Ecosystem

Neil Trevett Vice President, NVIDIA OpenCL Chair Khronos President

OpenCL Press Conference

Neil Trevett Vice President, NVIDIA OpenCL Chair Khronos President. Copyright Khronos Group, Page 1

Rock em Graphic Cards

OpenCL The Open Standard for Heterogeneous Parallel Programming

OpenCL. Matt Sellitto Dana Schaa Northeastern University NUCAR

OpenCL API. OpenCL Tutorial, PPAM Dominik Behr September 13 th, 2009

CS/EE 217 GPU Architecture and Parallel Programming. Lecture 22: Introduction to OpenCL

WebGL, WebCL and OpenCL

WebGL, WebCL and Beyond!

OpenCL Base Course Ing. Marco Stefano Scroppo, PhD Student at University of Catania

Introduction to Parallel & Distributed Computing OpenCL: memory & threads

Mali -T600 Series GPU OpenCL ARM. Developer Guide. Version 2.0. Copyright ARM. All rights reserved. DUI0538F (ID012914)

OpenCL in Action. Ofer Rosenberg

Instructions for setting up OpenCL Lab

OpenCL Training Course

OpenCL / OpenGL Texture Interoperability: An Image Blurring Case Study

The State of Gaming APIs

WebGL Meetup GDC Copyright Khronos Group, Page 1

Debugging and Analyzing Programs using the Intercept Layer for OpenCL Applications

Performing Reductions in OpenCL

Design and implementation of a highperformance. platform on multigenerational GPUs.

Introduction to OpenCL!

From Application to Technology OpenCL Application Processors Chung-Ho Chen

GPGPU COMPUTE ON AMD. Udeepta Bordoloi April 6, 2011

Introduction à OpenCL

Towards Transparent and Efficient GPU Communication on InfiniBand Clusters. Sadaf Alam Jeffrey Poznanovic Kristopher Howard Hussein Nasser El-Harake

OpenCL. Dr. David Brayford, LRZ, PRACE PATC: Intel MIC & GPU Programming Workshop

OpenCL Overview. Shanghai March Neil Trevett Vice President Mobile Content, NVIDIA President, The Khronos Group

Web Physics: A Hardware Accelerated Physics Engine for Web- Based Applications

SimpleOpenCL: desenvolupament i documentació d'una llibreria que facilita la programació paral lela en OpenCL

Sistemi Operativi e Reti

GPU COMPUTING RESEARCH WITH OPENCL

Lecture Topic: An Overview of OpenCL on Xeon Phi

Next Generation OpenGL Neil Trevett Khronos President NVIDIA VP Mobile Copyright Khronos Group Page 1

CS 677: Parallel Programming for Many-core Processors Lecture 12

SIGGRAPH Briefing August 2014

GPU acceleration on IB clusters. Sadaf Alam Jeffrey Poznanovic Kristopher Howard Hussein Nasser El-Harake

High Dynamic Range Tone Mapping Post Processing Effect Multi-Device Version

OpenCL on the GPU. San Jose, CA September 30, Neil Trevett and Cyril Zeller, NVIDIA

The Open Computing Language (OpenCL)

The Open Computing Language (OpenCL)

The Open Computing Language (OpenCL)

Data Parallelism. CSCI 5828: Foundations of Software Engineering Lecture 28 12/01/2016

GPGPU Applications. for Hydrological and Atmospheric Simulations. and Visualizations on the Web. Ibrahim Demir

OpenCL. An Introduction for HPC programmers. Benedict Gaster, AMD Tim Mattson, Intel. - Page 1

Colin Riddell GPU Compiler Developer Codeplay Visit us at

Masterpraktikum Scientific Computing

Advanced OpenMP. Other threading APIs

NVIDIA OpenCL JumpStart Guide. Technical Brief

Advanced OpenCL Event Model Usage

Copyright Khronos Group Page 1

Intel SDK for OpenCL* - Sample for OpenCL* and Intel Media SDK Interoperability

Copyright Khronos Group Page 1. Vulkan Overview. June 2015

OpenCL. Computation on HybriLIT Brief introduction and getting started

Mobile AR Hardware Futures

OpenCL Overview Benedict R. Gaster, AMD

Parallelization using the GPU

Copyright Khronos Group Page 1. OpenCL BOF SIGGRAPH 2013

Martin Kruliš, v

CLU: Open Source API for OpenCL Prototyping

Enabling GPU support for the COMPSs-Mobile framework

AMath 483/583, Lecture 24, May 20, Notes: Notes: What s a GPU? Notes: Some GPU application areas

SYCL: An Abstraction Layer for Leveraging C++ and OpenCL

INTRODUCTION TO OPENCL TM A Beginner s Tutorial. Udeepta Bordoloi AMD

MULTIMEDIA PROCESSING Real-time H.264 video enhancement by using AMD APP SDK

Copyright Khronos Group, Page 1. Khronos Overview. Taiwan, February 2012

Making OpenCL Simple with Haskell. Benedict R. Gaster January, 2011

Open Standards for Today s Gaming Industry

Mining the Rendering Power in Web Browsers. Jianxia Xue Jan. 28, 2014

Introduction à OpenCL et applications

Copyright 2013 by Yong Cao, Referencing UIUC ECE408/498AL Course Notes. OpenCL. OpenCL

OpenCL / OpenGL Vertex Buffer Interoperability: A Particle System Case Study

OpenCL / OpenGL Vertex Buffer Interoperability: A Particle System Case Study

Press Briefing SIGGRAPH 2015 Neil Trevett Khronos President NVIDIA Vice President Mobile Ecosystem. Copyright Khronos Group Page 1

Copyright Khronos Group, Page 1. OpenCL Overview. February 2010

Open API Standards for Mobile Graphics, Compute and Vision Processing GTC, March 2014

Andrew Brownsword, EA BlackBox March Copyright Khronos Group, Page 1

GPGPU on ARM. Tom Gall, Gil Pitney, 30 th Oct 2013

Michael Kinsner, Dirk Seynhaeve IWOCL 2018

WebGL. Announcements. WebGL for Graphics Developers. WebGL for Web Developers. Homework 5 due Monday, 04/16. Final on Tuesday, 05/01

Introduction to OpenCL. Benedict R. Gaster October, 2010

Khronos Connects Software to Silicon

AR Standards Update Austin, March 2012

Next Generation Visual Computing

Hardware Accelerated Graphics for High Performance JavaFX Mobile Applications

WebGL Seminar: O3D. Alexander Lokhman Tampere University of Technology

Martin Kruliš, v

ENHANCED VIDEO PROCESSING WITH FFMPEG AND OPENCL. Kelvin Phan Massey University. 2016

Scientific Computing WS 2017/2018. Lecture 27. Jürgen Fuhrmann Lecture 27 Slide 1

3D Fluid Simulation Sample

OpenCL* Device Fission for CPU Performance

WebGL. WebGL. Bring 3D to the Masses. WebGL. The web has text, images, and video. We want to support. Put it in on a webpage

A Case for Better Integration of Host and Target Compilation When Using OpenCL for FPGAs

HTML5 Evolution and Development. Matt Spencer UI & Browser Marketing Manager

Transcription:

Copyright Khronos Group, 2011 - Page 1 WebCL Overview and Roadmap Tasneem Brutch Chair WebCL Working Group Samsung Electronics

Copyright Khronos Group, 2011 - Page 2 WebCL Motivation Enable high performance parallel processing on GPU/multicore by web applications. Portable and efficient access to heterogeneous multicore devices. Platform independent, efficient and standards compliant solution. - Leverage device s multicore/parallel computing resources from web-based apps. Integration of OpenCL capabilities in the JavaScript environment. - Enhanced performance (comparable to native OpenCL). Enable a breadth of interactive web applications with high compute demands, on mobile platforms with multicore resources. - E.g. apps: Object Recognition, Speech Recognition, Gaming, Augmented Reality, etc.

Copyright Khronos Group, 2011 - Page 3 WebCL Design Goals Enable general purpose parallel programming on heterogeneous processing elements, with following design philosophy: - A single coherent standard across desktop and mobile devices. - Open, royalty-free standard for general purpose parallel programming. - Encourage openness with public specification drafts, mailing lists, forums, etc. - Public and Khronos mailing lists and Wiki to facilitate discussion. - webcl_public@khronos.org - https://www.khronos.org/webcl/wiki/main_page - Design with security as #1 focus.

Copyright Khronos Group, 2011 - Page 4 WebCL HW and SW Requirements WebCL will require a modified browser with OpenCL/WebCL support. Hardware, driver and runtime support for OpenCL. OpenCL program flow and OpenCL platform model: Context Programs Kernels Memory Objects Command Queue Kernel0 Images Programs Kernel1 Kernel2 Buffers In order & out of order Compile Create data and arguments Send for execution Creating an OpenCL Program OpenCL Platform Model

Copyright Khronos Group, 2011 - Page 5 WebCL Approach Stay close to the OpenCL standard. - To preserve developer familiarity and to facilitate adoption. - Allow developers to translate their OpenCL knowledge to web environment. - Easier to keep OpenCL and WebCL in sync, as the two evolve. Intended to be an interface above OpenCL. - Facilitate layering of higher level abstractions on top of WebCL API Design with focus on security. Portable by design. - Simplification of initialization to promote portability.

Copyright Khronos Group, 2011 - Page 6 WebCL Status and Roadmap Status: Khronos BoD approved the creation of WebCL Working Group-May 2011. Nokia and Samsung made their prototype implementations open source. - WebCL standard is currently being defined by Khronos. Roadmap: An online specification and IDL. - A WebCL Reference Card - WebCL logo and rules of use Implementation document on guidelines for layering WebCL on OpenCL. Definition of conformance process. - A conformance test suite for testing WebCL implementations Security will remain #1 priority for WebCL. - WebCL WG will publish security guidelines.

Copyright Khronos Group, 2011 - Page 7 Design with Focus on Security Security is the highest priority for WebCL. - WebCL will be designed for security. - Hardening for WebCL will be promoted and enabled. Ensure that new functionality in the browser does not increase its exposure to attacks. Near Term: - Provisions to promote robustness. Longer Term: - Work with OpenCL device vendors, driver vendors and browser vendors for an in-depth secure solution, and hardware/firmware supported multitasking.

Copyright Khronos Group, 2011 - Page 8 Nokia s WebCL Prototype Nokia open sourced their prototype in May 2011 (LGPL). Web-based interactive photo editor utilizing GPU for image processing, through WebGL & Nokia s OpenCL bindings for JavaScript. YouTube Demo: http://www.youtube.com/watch?v=9bf7zzum1ky Add-on for Firefox 4 on Win/Linux(Firefox 5 coming soon) Visit http://webcl.nokiaresearch.com for binaries, source code, demos and tutorials.

Copyright Khronos Group, 2011 - Page 9 Samsung WebCL Prototype Samsung open sourced their prototype WebCL implementation for WebKit in July 2011 (BSD license). Allows JavaScript to run computations on GPU. Demos on YouTube: http://www.youtube.com/user/samsungsisa Demos use WebGL for 3D rendering. - Computing N-Body gravitational interactions. - Computing surface deformations using a fractal noise function. Code available at http://code.google.com/p/webcl/ - For comparison, same computations were also done in pure JavaScript. - WebCL gave performance increases of up to 100x. - Test Platform: MacBook Pro with NVIDIA GPGPU.

Copyright Khronos Group, 2011 - Page 10 Samsung WebCL Prototype (cont.) OpenCL to WebCL Mapping: Samsung s WebCL prototype implementation attempts to provide for nearly 1:1 mapping with OpenCL. - OpenCL APIs are accessed from JavaScript through the WebCLComputeContext class. - Mapping OpenCL to WebCL: cl = new WebCLComputeContext ( ) OpenCL - WebCL API Syntax Examples OpenCL API WebCL API Calling WebCL APIs from JS cl_kernel clcreatekernel (cl_program program, const char *kernel_name, cl_int *errcode_ret); cl_mem clcreatebuffer (cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret); WebCLKernel createkernel (WebCLProgram*, const String&); WebCLBuffer createbuffer (WebCLContext context, cl_mem_flags flags, size_t size, ArrayBuffer host_ptr); cl.createkernel ( ) cl.createbuffer ( )

Copyright Khronos Group, 2011 - Page 11 Samsung WebCL Prototype Demo N-Body Simulation: Calculates the positions and velocities of N particles and animates them Two simulation modes: JavaScript and WebCL Two drawing modes: JavaScript and WebGL with 2D/3D rendering option For 1024 particles, WebCL gets 20~40x faster simulation time on Mac http://www.youtube.com/user/samsungsisa#p/a/u/0/ F7YSQxz3j7o

Copyright Khronos Group, 2011 - Page 12 Samsung WebCL Prototype Demo Deformation Demo: Calculates and renders transparent and reflective deformed spheres on top of photo background Performance comparison on Mac - JS: ~1 FPS - WebCL: 87-116 FPS http://www.youtube.com/user/samsungsisa#p/a/u/1/9ttux1a-nuc

Copyright Khronos Group, 2011 - Page 13 WebCL Resources WebCL public distribution list: webcl_public@khronos.org WebCL public Wiki: https://www.khronos.org/webcl/wiki/main_page Nokia s WebCL prototype resources: - Source code and tutorial (http://webcl.nokiaresearch.com/) - Demo on YouTube (http://www.youtube.com/watch?v=9bf7zzum1ky) Samsung s WebCL prototype resources: - Demos on YouTube: (http://www.youtube.com/user/samsungsisa - Code available on Google Docs (http://code.google.com/p/webcl/) Call for participation in Khronos WebCL Working Group. For further information on WebCL, contact: WebCL Chair: Tasneem Brutch (t.brutch@samsung.com) WebCL Editor: Tomi Aarnio (tomi.aarnio@nokia.com)

Backup Copyright Khronos Group, 2011 - Page 14

WebCL Class Hierarchy WebCLComputeContext + m_webclobjects + m_webcl_platform + m_webcl_device + m_webcl_program + m_webcl_memobject + m_webcl_sampler + m_webcl_commandqueue.. + getplatformids() + getdeviceids() + createcontext() + createcommandqueue() + getkernel() + createprogramwithsource() + buildprogram() + getprogrambuildinfo() + createkernel() + createbuffer() + enqueuewritebuffer() + enqueuereadbuffer() + setkernel() + getkernelworkinfo() + enqueuendrangekernel() + finish() + releasememobject() + releaseprogram() + releasekernel() + releasecommandqueue() + releasecontext() WebCLContext + cl_context* WebCLDevice + cl_device_id* WebCLPlatfom + cl_platform_id* WebCLProgram + cl_program* WebCLMemObject + cl_mem* WebCLCommandQueue + cl_command_queue* WebCLEvent + cl_event* WebCLSampler + cl_sampler* WebCLKernel + cl_kernel* WebCLBuffer WebCLImag e Copyright Khronos Group, 2011 - Page 15

Samsung WebCL Prototype Interface (Sample Calls from HelloWorld App for Illustration-1/3) <html> <head> <title>webcl Hello World</title> <script> function getkernel (id ) { var kernelscript = document.getelementbyid( id ); } </script> <script id="square" type="x-kernel"> kernel void square( global float* input, global float* output) { int i = get_global_id(0); output[i] = input[i] * input[i]; } </script> 1 <script> var cl; var platform_ids, device_ids; var context, queue, program, kernel, input, output; var err; var data = new Float32Array(DATA_SIZE); var results = new Float32Array(DATA_SIZE); Copyright Khronos Group, 2011 - Page 16

1 Copyright Khronos Group, 2011 - Page 17 Samsung WebCL Prototype Interface (Sample Calls from HelloWorld App for Illustration-2/3) function ExecuteCL( ) { cl = new WebCLComputeContext ( ); platform_ids = cl.getplatformids ( ); device_ids = cl.getdeviceids (platform_ids[0], cl.device_type_gpu ); context = cl.createcontext (null, device_ids[0], null, null); queue = cl.createcommandqueue (context, device_ids[0], null); var kernelsource = getkernel ("square"); program = cl.createprogramwithsource (context, kernelsource); err = cl.buildprogram (program, null, null, null); var info = cl.getprogrambuildinfo (program, device_ids[0], cl.program_build_log); kernel = cl.createkernel (program, "square"); input = cl.createbuffer (context, cl.mem_read_only, Float32Array.BYTES_PER_ELEMENT * count, null); output = cl.createbuffer (context, cl.mem_write_only, Float32Array.BYTES_PER_ELEMENT * count, null);

Samsung WebCL Prototype Interface (Sample Calls from HelloWorld App for Illustration-3/3) cl.enqueuewritebuffer (queue, input, true, 0, Float32Array.BYTES_PER_ELEMENT * count, data, null); err = cl.setkernelargglobal (kernel, 0, input); err = cl.setkernelargglobal (kernel, 1, output); var local = cl.getkernelworkgroupinfo (kernel, device_id, cl.kernel_work_group_size); cl.enqueuendrangekernel (queue, kernel, 1, 0, count, local, null); 1 cl.finish (queue, null, function(userdata) { cl.enqueuereadbuffer (queue, output, true, 0, Float32Array.BYTES_PER_ELEMENT * count, results, null); cl.releasememobject (input); cl.releasememobject (output); cl.releaseprogram (program); cl.releasekernel (kernel); cl.releasecommandqueue (queue); cl.releasecontext (context); }); } </script> </head> Copyright Khronos Group, 2011 - Page 18