Skip to content

Commit a8947bd

Browse files
committed
* Added BOOST_COMPUTE_USE_CPP11
* changed enum device_type name
1 parent ef865b0 commit a8947bd

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

include/boost/compute/command_queue.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ class command_queue
10121012
}
10131013

10141014

1015-
#ifdef BOOST_NO_CXX11_LAMBDAS
1015+
#if defined(BOOST_NO_CXX11_LAMBDAS) || !defined(BOOST_COMPUTE_USE_CPP11)
10161016
// Resolve the lambda syntax sugar
10171017
template<class Function>
10181018
struct walk_image
@@ -1122,7 +1122,7 @@ class command_queue
11221122

11231123
size_t element_size = image.get_image_info<size_t>(CL_IMAGE_ELEMENT_SIZE);
11241124

1125-
#ifdef BOOST_NO_CXX11_LAMBDAS
1125+
#if defined(BOOST_NO_CXX11_LAMBDAS) || !defined(BOOST_COMPUTE_USE_CPP11)
11261126
walk_image<Function> func(walk_elemets, pImage3D, origin3.data(), region3.data(), row_pitch, slice_pitch, element_size, user_ev);
11271127
#else
11281128
auto func = [=]()

include/boost/compute/device.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class platform;
4444
class device
4545
{
4646
public:
47-
enum type {
47+
enum device_type {
4848
default_type = CL_DEVICE_TYPE_DEFAULT,
4949
cpu = CL_DEVICE_TYPE_CPU,
5050
gpu = CL_DEVICE_TYPE_GPU,
@@ -161,7 +161,7 @@ class device
161161
}
162162

163163
/// Returns the type of the device.
164-
cl_device_type get_type() const
164+
cl_device_type type() const
165165
{
166166
return get_info<cl_device_type>(CL_DEVICE_TYPE);
167167
}

include/boost/compute/system.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ class system
8888
/// \throws no_device_found if no device with \p name is found.
8989
static device find_device(const std::string &device_name = std::string(),
9090
const std::string &platform_name = std::string(),
91-
device::type device_type = device::all,
91+
device::device_type device_type = device::all,
9292
uint_ min_version = 100)
9393
{
9494
BOOST_FOREACH(const device &device, devices()){
9595
std::string platform_name_ = device.platform().name();
9696
if((platform_name.empty() || platform_name_.find(platform_name.c_str()) != std::string::npos)
9797
&& (device_name.empty() || device.name().find(device_name.c_str()) != std::string::npos)
98-
&& (device.get_type() & device_type)
98+
&& (device.type() & device_type)
9999
&& device.get_version() >= min_version){
100100
return device;
101101
}
@@ -229,11 +229,11 @@ class system
229229
continue;
230230

231231
if (type && matches(std::string("GPU"), type))
232-
if (device.get_type() != device::gpu)
232+
if (device.type() != device::gpu)
233233
continue;
234234

235235
if (type && matches(std::string("CPU"), type))
236-
if (device.get_type() != device::cpu)
236+
if (device.type() != device::cpu)
237237
continue;
238238

239239
if (platform && !matches(device.platform().name(), platform))
@@ -248,14 +248,14 @@ class system
248248

249249
// find the first gpu device
250250
BOOST_FOREACH(const device &device, devices_){
251-
if(device.get_type() == device::gpu){
251+
if(device.type() == device::gpu){
252252
return device;
253253
}
254254
}
255255

256256
// find the first cpu device
257257
BOOST_FOREACH(const device &device, devices_){
258-
if(device.get_type() == device::cpu){
258+
if(device.type() == device::cpu){
259259
return device;
260260
}
261261
}

0 commit comments

Comments
 (0)