O'Reilly logo

OpenCL Parallel Programming Development Cookbook by Raymond Tay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Querying OpenCL devices on your platform

We'll now query OpenCL devices that are installed on your platforms.

Getting ready

The code listing discussed in the How to do it… section presents an abbreviated portion of the code in Ch1/device_details/device_details.c. This code demonstrates how you can obtain the types of devices installed on your platform via clGetDeviceIDs. You'll use that information to retrieve detailed data about the device by passing it to clGetDeviceInfo.

How to do it…

For this recipe, you need to completely reference the appropriate chapter code. Pay attention to the included comments, as they would help you understand each individual function. We've included the main part of this recipe with highlighted commentary:

/* C-function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required