Skip to content
C++ C JavaScript Python GLSL Makefile HTML
Latest commit 40639a4 Apr 29, 2016 @anthonyliot anthonyliot fix settings
Signed-off-by: Anthony Liot <anthony.liot@gmail.com>

README.md

webcl-translator

logo

Requirement :

Python2.7

NodeJS

Emscripten Tutorial

Emscripten Fastcomp

Emscripten Fastcomp Clang

WebCL Validator

How To (OSX) :

Step 1 :

install python and nodejs on your system

cd YOUR_ROOT_DIRECTORY
git clone https://github.com/kripken/emscripten-fastcomp.git -b incoming
cd emscripten-fastcomp/tools/
git clone https://github.com/kripken/emscripten-fastcomp-clang.git -b incoming clang
build the llvm/clang emscripten-fastcomp using "configure --enable-optimized --disable-assertions --enable-targets=host,js"

cd YOUR_ROOT_DIRECTORY
git clone https://github.com/KhronosGroup/webcl-validator
build the llvm/clang webcl-validator
go inside your binary build folder and type :
"install_name_tool -change libclv_standalone.dylib @executable_path/../lib/libclv_standalone.dylib"

Step 2 :

cd YOUR_ROOT_DIRECTORY
git clone https://github.com/wolfviking0/webcl-translator
cd webcl-translator/
git submodule init
git submodule update

Step 3 :

cd YOUR_ROOT_DIRECTORY
rm ~/.emscripten
rm -rf ~/.emscripten_cache
cd webcl-translator/emscripten
./emcc --help
open ~/.emscripten
set LLVM_ROOT with your llvm path
add LLVM_VALIDATOR_ROOT with your webcl-validator path

Step 4 :

cd YOUR_ROOT_DIRECTORY/webcl-translator
python automator.py --help
or
cd YOUR_ROOT_DIRECTORY/webcl-translator/webcl
make

General :

webcl-translator is an OpenCL to WebCL converter, it's based on the Emscripten LLVM-to-JavaScript compiler.

Need webkit-webcl from Samsung research for OS X 10.8, you can use my custom version of webkit-webcl for OS X 10.9.

Links to demos, tutorial, patch, etc: Wiki

Automator :

At the top of the repositories, you can use python automator.py for update all the samples repositories and automaticaly build all the demos.

You can call python automator.py -h for call the automator script help.

Validator :

You can use the webcl-validator with the webcl-translator. You need to add the LLVM_VALIDATOR_ROOT inside the ~/.emscripten config file.

If you build a sample using settings -s CL_VALIDATOR=1, automaticaly all the .cl file embedded are modify by the validator. You can specify parameter to the webcl-validator using -s CL_VAL_PARAM='["-DPARAM1","-DPARAM2"]'.

Settings.js :

The sample are using a Settings.js file who automaticaly add parameter to all the webcl-translator samples. When you launch the translator.html file (and all the html samples files from the samples repositories), you can add some parameter:

&gl=on/off          :   Add a canvas inside the webpage             
&validator=on/off   :   Enable the validator, call val_.....js samples 
&profile=on/off     :   Enable the console profile of the browser   
&export=on/off      :   Open a new page with stack_tracer (if enabled)

Samples repositories :

OSX Samples

OCLToys

David Bucciarelli

OpenCL Book Samples

OpenCL Nvidia Samples

License :

webcl-translator is MIT licensed, see LICENSE.

Something went wrong with that request. Please try again.