sandeep.ganage
sandeep.ganage

Reputation: 1467

In OpenCL, what is the difference between platform, context, and device?

I am new to OpenCL programming. What is the difference between device, context, and platform?

Upvotes: 18

Views: 9459

Answers (1)

Erik Smistad
Erik Smistad

Reputation: 1019

A platform is a specific OpenCL implementation, for instance AMD APP, NVIDIA or Intel OpenCL. A context is a platform with a set of available devices for that platform. And the devices are the actual processors (CPU, GPU etc.) that perform calculations.

So if you use the Intel platform, a valid context with this platform would include a CPU device. While if you use the NVIDIA platform, a valid context would include an NVIDIA GPU device.

Upvotes: 32

Related Questions