[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Public WebCL] WebCL examples



Hi,

 

   Very good questions for starting discussions. Hopefully I manage to answer to them. Let us note that the answers relates only to current Nokia prototype, NOT to standard – standardization is about to begin.

 

1.       WebCL data object stores a buffer of binary data, which can be read from or written to a TypedArray. Essentially, it is used on the WebCL API where there would be a void pointer in relation to memory object in OpenCL API. It is expected that in time TypedArray will replace the WebCL Data Object and will be used directly by WebCL API. At the time of this implementation, however, the support for TypedArray across popular browsers is limited. It is also worth mentioning that we aimed at general solution meaning also environments that do not recognize TypedArrays.

2.       Vendor extensions or their usage is one topic to be discussed. At the moment, I would prefer not using the extensions, or at least it should not be part of WebCL layer. Idea behind is that the implementation should not assume anything about the actual execution environment. Naturally, the application may provide fallbacks in some cases.

3.       loadKernel is a help function and it doesn’t relate to WebCL extension. You may load kernel however you want as far as kernel is passed to WebCL extension as a text string. Regarding the given examples, I don’t see huge differences. Nokia’s case supports kernel loading from  URL.

4.       No technical reason, it is just design time choice and easy to redefine. J Purpose has been to emphasize WebCL technology and avoid name space collisions now and in future. As an off topic comment - conceptually, there is one remarkable difference between WebCL and WebGL – WebCL has here global visibility while gl. comes from canvas.

 

Jari Nikara

Nokia Research Center

 

From: owner-public_webcl@khronos.org [mailto:owner-public_webcl@khronos.org] On Behalf Of ext Evgeny Demidov
Sent: 10. toukokuuta 2011 7:17
To: public_webcl@khronos.org
Subject: [Public WebCL] WebCL examples

 

hi,

I'm starting my "WebCL examples" at
http://www.ibiblio.org/e-notes/webcl/webcl.htm
i have a few (or lot :) of questions?
1. What is the WebCL DataObject object?
2. The Mandelbrot set kernel uses the cl_amd_fp64 extension. How can I include cl_khr_fp64 e.g. for NVIDIA?
3. Which of these two scripts shall I use? WebGL like one

function loadKernel ( id ){
   var shaderScript = document.getElementById ( id );
   var str = "";
   var k = shaderScript.firstChild;
   while ( k ){
     if ( k.nodeType == 3 ) str += k.textContent;
     k = k.nextSibling;
   }
   return str;
}

or Nokia one

function loadKernel(id){
  var kernelElement = document.getElementById(id);
  var kernelSource = kernelElement.text;
  if (kernelElement.src != "") {
      var mHttpReq = new XMLHttpRequest();
      mHttpReq.open("GET", kernelElement.src, false);
      mHttpReq.send(null);
      kernelSource = mHttpReq.responseText;
  } 
  return kernelSource;
}
 

4. sorry, why "WebCL." prefix? (not simple "cl." as like as "gl." in WebGL)

Evgeny