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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user