Devices, Platforms, and Contexts

>> Tuesday, August 30, 2011

I've been discussing the possibility of writing an article for Intel's Visual Computing site. The proposed article involves accelerating ray-triangle intersection on GPUs with OpenCL. This computation is necessary to convert 2-D mouse clicks into 3-D object selection.

The Intel reviewer seems happy with my outline, but wants me to emphasize balancing the computational load between CPUs and GPUs. This makes sense for Intel, which doesn't make OpenCL-compliant GPUs. But there's a problem. OpenCL devices can only share buffer data, such as vertex colors and coordinates, if they belong to the same context. For an overview of devices and contexts, I recommend this article.

The OpenCL spec doesn't mention this explicitly, but OpenCL devices can only be placed in the same context if they belong to the same platform. Platforms correspond to device vendors, so if you have an Intel CPU and an AMD GPU, the devices belong to different platforms. Therefore, they can't be placed in the same context, which means they can't share buffer data. Intel doesn't make GPUs and Nvidia doesn't make CPUs, so the only way I know to place a CPU and GPU in a context is if both devices were made by AMD. When I demonstrate DynLab at SC11, that's the setup I'm going to use.

For more information, I recommend this thread on the Khronos forum. If I was on the OpenCL Working Group, my first priority for OpenCL 2.0 would involve making sure developers can create contexts with devices in different platforms.

0 comments:

Post a Comment

  © Blogger template Werd by Ourblogtemplates.com 2009

Back to TOP