Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
node-webcl
Advanced tools
This is an implementation of Khronos WebCL specification using NodeJS. This implementation solely relies on OpenCL 1.1 C headers.
While we are close to the WebCL specification, some features in this code may or may not be available in the final specification. As such, this implementation should be considered for
This implementation is not secure nor robust, we will update as the standard progresses in these areas. So beware that hacking your GPU may crash your computer; don't blame us!
node-webcl is distributed under BSD license
Copyright (c) 2011-2012, Motorola Mobility, Inc. All rights reserved.
See LICENSES in this distribution for all licenses used in samples from other companies.
NAN must be installed first to support all versions of v8
node-webgl. This module is used for samples using WebGL interoperability with WebCL. In turns, node-webgl relies on node-glfw that relies on GLFW, GLEW, AntTweakBar, and FreeImage. See node-webgl and node-glfw for instructions on how to install these modules.
OpenCL 1.1 must be installed on your machine. Typically, this means your machine has a not too old graphic card (maybe not more than 3 years old) and its latest graphic drivers installed.
On Mac, we recommend using OSX 10.7 "Lion" since OSX 10.6 "Snow Leopard" only supports OpenCL 1.0 and is buggy.
On Windows, use Windows 7. Note that if your machine is 64-bit, you should use node.js 64-bit distribution, not the 32-bit default to avoid mismatch between node libraries and these native dependencies when node-gyp build the modules.
On Linux, make sure you use the latest AMD or NVidia drivers. This module has been tested with Ubuntu 10.10, 11.04 and 11.10 64-bit.
Pre-built binaries are available in submodule deps. Don't forget to do:
git submodule init
git submodule udpate
if you need these binaries.
Since OpenCL is a compute specification, rendering is not the main purpose but if you want to use graphic acceleration, you should first install node-glfw and then node-webgl and make sure some of node-webgl samples are working. See node-webgl for instructions.
Note that installing the usual way:
npm install node-webcl
will also install node-webgl and node-glfw.
If you want to use the latest code, simply do
node-gyp rebuild
in node-webcl, node-webgl, and node-glfw.
WebCL is a JavaScript representation of OpenCL 1.1. It is not a straight mapping of OpenCL C methods but rather an object-oriented representation of OpenCL object model. Knowledge of OpenCL is OpenCL is therefore mandatory to be able to develop WebCL programs. See the Books section and/or jump directly into Specifications references at the end of this page.
There are few steps in creating a WebCL program:
cl.getPlatform()
, cl.getDevices()
)context = cl.createContext()
)queue = context.createCommandQueue()
)program = context.createProgram()
, program.build()
)kernel = program.createKernel()
, kernel.setArg()
)queue.enqueueXXX()
)kernel.setArg()
)queue.enqueueXXX()
)queue.enqueueTask()
or queue.enqueueNDRange()
)When used with WebGL, WebGL context must be created first because WebCL context is created with sharing the WebGL context. Remember that WebCL allows computations on WebGL buffers. WebCL doesn't do any rendering. By using WebCL and WebGL together, data remains in the device and this avoids expensive data transfer to/from CPU memory.
So the sequence becomes:
context = cl.createContext({ sharedObject: gl })
)queue.enqueueAcquireGLObjects()
)queue.enqueueNDRange()
)queue.enqueueReleaseGLObjects()
)Specifications
Books
OpenCL SDKs (use latest!)
FAQs
A WebCL implementation for desktops with NodeJS
We found that node-webcl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.