2
0
mirror of https://github.com/boostorg/compute.git synced 2026-01-26 06:22:37 +00:00

Refactor the system::default_device() method

This refactors the system::default_device() method. Now, the
default compute device for the system is only found once and
stored in a static variable. This eliminates many redundant
calls to clGetPlatformIDs() and clGetDeviceIDs().

Also, the default_cpu_device() and default_gpu_device() methods
have been removed and their usages replaced with default_device().
This commit is contained in:
Kyle Lutz
2013-05-10 22:49:05 -04:00
parent d40eddc56b
commit 178676df4f
8 changed files with 61 additions and 118 deletions

View File

@@ -15,9 +15,9 @@
// setup and run a simple vector addition kernel on the GPU
int main()
{
// get the default GPU device
// get the default device
boost::compute::device gpu =
boost::compute::system::default_gpu_device();
boost::compute::system::default_device();
// create a context for the device
boost::compute::context context(gpu);