Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

gpgpu

gpu

opencl

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

like image 474
sandeep.ganage Avatar asked Oct 20 '12 13:10

sandeep.ganage


People also ask

What is the difference between context and platform in OpenCL?

1 Answer 1. 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.

What is the difference between a platform and a context?

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.

What is OpenCL and how does it work?

They consist for example of CPUs GPUs DSPs and FPGAs. OpenCL specifies a programming language (based on C99) for programming these devices and application programming interfaces (APIs) to control the platform and execute programs on the compute devices.

Is there an OpenCL implementation for the AMD Radeon GPU?

An implementation of OpenCL (actual 1.1 incomplete, mostly done AMD Radeon GCN) for a number of platforms is maintained as part of the Gallium Compute Project, [77] which builds on the work of the Mesa project to support multiple platforms.


1 Answers

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.

like image 187
Erik Smistad Avatar answered Nov 03 '22 01:11

Erik Smistad