Indic threads pune12-accelerating computation in html 5
Upcoming SlideShare
Loading in...5
×
 

Indic threads pune12-accelerating computation in html 5

on

  • 883 views

The 7th Annual IndicThreads Pune Conference was held on 14-15 December 2012. http://pune12.indicthreads.com/

The 7th Annual IndicThreads Pune Conference was held on 14-15 December 2012. http://pune12.indicthreads.com/

Statistics

Views

Total Views
883
Views on SlideShare
883
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Html applications use multicores
  • What are multicores?Compare Cpu and GpuAdvantages of using GPUHow is it possible to do so.Moors lawSimple questions
  • -Explain network diagram-how to render-performance issue-solve it using parallel computation opencl technologyUse different color force directed.Real time use ,giving imp to diagram than textReplace Force directed algorithm with simple lay out algo.
  • Fontext for demoPause and explain details,with variation in speech
  • Brief OpenCl intro.Dreaft and open specification.Parallel only!!!Thread amnagement,synch is simple
  • Why this models?How architecture helps in improving performance
  • HierarcyHosta calls
  • What to do with execution model.Acces threads,Create memory,execute program,CommandsWorkgrou-cores corrospondence
  • Explain mapping data structures
  • More details on WebCL
  • variation in speechConclusion… and question

Indic threads pune12-accelerating computation in html 5 Indic threads pune12-accelerating computation in html 5 Presentation Transcript

  • Accelerating computation in html 5Ashish ShahSAS R&D INDIA
  • Outline • Multicore Computing • Problem statement • Demo • Introduction to OpenCL and WebCL • Conclusion • References
  • Multicore Computing
  • Problem statement Layout algorithm for node-linked graphs Layout Algorithm
  • DEMODemo 1 – Serial versionDemo 2 - Parallel version with multi-core CPUDemo 3 - Parallel version with many-core GPU
  • Performance analysisTime in ms Number of particles
  • Introduction to OpenCL• Open Compute Language, C- like language.• Framework for writing parallel algorithms• Heterogeneous platforms• Developed by Apple• Is an open standard and controlled by Khronos group
  • Example of adding two vectorsSerial versionFor(i=1 to n)c[i]= a[i]+b[i];Using OpenCL_kernel add(a,b,c) { int i =get_global_id(); //get thread id c[i]=a[i]+b[i]; }
  • OpenCL Architecture1. Platform model2. Execution model3. Memory model4. Programming model
  • OpenCL -Platform• Device• Host Host Intel CPU GPU 2 Compute Device 1 (GPU 1) Compute unite (Cores)
  • OpenCL-Execution Model _kernel add(a,b,c)1. Kernel {2. Work-items int i =get_global_id();//get thread/workitem id c[i]=a[i]+b[i];3. Work group }4. ND-range5. Program6. Memory objects7. Command queues
  • Memory Model in OpenCL Compute Device Private register Private register Private register Compute unit 0 Compute unit 1 Compute unit 2 Local memory/cache Local memory/cache Local memory/cache Global constant memory-DRAM Global Memory -DRAM
  • Programming model1. Data parallel-single function on multiple data2. Task parallel-Multiple functions on single data
  • OpenCL Stack Java,c,.net, HTML,.java, WebCL Applications .NET,c,c++ kernals OpenCL-Api Compiler String data context Memory Api’s OpenCL Framework OpenCL Runtime Command queues, buffer objects, kernel Device driver execution OpenCL Device (GPU/CPU hardware)
  • Essential Development Tasks C-code with restrictions Initialize Initiate Execute Read back Parallelize Code Kernel OpenCL kernels and kernel data to host environment data
  • Essential Development Tasks • Query compute device • Create context • Compile kernels Initialize Initiate Execute Read back Parallelize Code Kernel OpenCL kernels and kernel data to host environment data
  • Essential Development Tasks • Create memory objects • Map data structures to OpenCL supported data structures. • Initialize kernel parameters Initialize Initiate Execute Read back Parallelize Code Kernel OpenCL kernels and kernel data to host environment data
  • Essential Development Tasks • Specify number of threads to execute task • Trigger the execution of kernel- sync or async Initialize Initiate Execute Read back Parallelize Code Kernel OpenCL kernels and kernel data to host environment data
  • Essential Development Tasks • Map to application datastructure Initialize Initiate Execute Read back Parallelize Code Kernel OpenCL kernels and kernel data to host environment data
  • Introduction to WebCL• Java Script bindings for OpenCL• First announced in March 2011 by Khronos• API definition underway• Prototype plugin is available only for Firefox browser
  • Binding OpenCL to WebCL CPU Host application JavaScript WebCL OpenCL OpenCL Framework compliant device
  • Coding with WebCLplatforms = WebCL.getPlatformIDs();context = WebCL.createContextFromType([WebCL.CL_CONTEXT_PLATFORM, platforms[0]], WebCL.CL_DEVICE_TYPE_CPU);devices = context .getContextInfo(WebCL.CL_CONTEXT_DEVICES);program = context .createProgramWithSource(kernelSrc);kernelfunction1 = program.createKernel(“function1");buffparam = context.createBuffer(WebCL.CL_MEM_READ_WRITE, bufSize);cmdQueue = context.createCommandQueue(devices[0], 0); cmdQueue.enqueueWriteBuffer(buffparam , true, 0, bufSize, parameter, []); kernelfunction1.setKernelArg(0, buffparam , WebCL.types.float2); cmdQueue.enqueueNDRangeKernel(kernelfunction1 , 1, [], totalWorkitems, totalWorkgroups, []); cmdQueue.finish ();cmdQueue.enqueueReadBuffer(‘xyz’, true, 0, bufSize, ‘xyzParam’, []);
  • Applications of OpenCL• Database mining• Neural networks• Physics based simulation,mechanics• Image processing• Speech processing• Weather forecasting and climate research• Bioinformatics
  • Conclusion • Significant performance gains in using OpenCL for computations in client-side environments like HTML5 • Algorithms need to be ‘parallelizable’ • Further optimizations can be achieved by exploiting memory model
  • Software/Hardware used in demo applicationHardware Intel(R) Core(TM)2 Quad core CPU Q8400 @ 2.66GHz Nvidia 160m Quadro 8 cores @ 580 MHzSoftware OpenCL runtime for CPU http://software.intel.com/en-us/articles/vcsource- tools-opencl-sdk/ OpenCL runtime for GPU http://www.nvidia.com/object/quadro_nvs_notebook. html WebCL plugin for Firefox http://webcl.nokiaresearch.com/
  • References http://www.macresearch.org/opencl http://en.wikipedia.org/wiki/GPGPU http://www.khronos.org/webcl/