Skip to content

Commit b0f5bfc

Browse files
authored
Merge pull request #776 from 9prady9/gcc8_fix
Fix compilation errors with GCC 8
2 parents 520f9b3 + 450a109 commit b0f5bfc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

include/boost/compute/memory/svm_ptr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class svm_ptr
126126
return m_ptr - other.m_ptr;
127127
}
128128

129-
context& get_context() const
129+
const context& get_context() const
130130
{
131131
return m_context;
132132
}

test/test_device.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ BOOST_AUTO_TEST_CASE(get_info_specializations)
236236
#ifdef BOOST_COMPUTE_CL_VERSION_2_1
237237
BOOST_AUTO_TEST_CASE(get_host_timer)
238238
{
239+
boost::compute::device device = boost::compute::system::default_device();
240+
239241
REQUIRES_OPENCL_VERSION(2, 1);
240242

241-
boost::compute::device device = boost::compute::system::default_device();
242243
BOOST_CHECK(device.get_host_timer() != 0);
243244

244245
#ifndef BOOST_COMPUTE_NO_HDR_CHRONO
@@ -254,9 +255,10 @@ BOOST_AUTO_TEST_CASE(get_host_timer)
254255

255256
BOOST_AUTO_TEST_CASE(get_device_and_host_timer)
256257
{
258+
boost::compute::device device = boost::compute::system::default_device();
259+
257260
REQUIRES_OPENCL_VERSION(2, 1);
258261

259-
boost::compute::device device = boost::compute::system::default_device();
260262
typedef std::pair<boost::compute::ulong_, boost::compute::ulong_> dah_timer;
261263
dah_timer timer;
262264
BOOST_CHECK_NO_THROW(timer = device.get_device_and_host_timer());
@@ -278,10 +280,10 @@ BOOST_AUTO_TEST_CASE(get_device_and_host_timer)
278280

279281
BOOST_AUTO_TEST_CASE(get_info_opencl21_queries)
280282
{
281-
REQUIRES_OPENCL_VERSION(2, 1);
282-
283283
boost::compute::device device = boost::compute::system::default_device();
284284

285+
REQUIRES_OPENCL_VERSION(2, 1);
286+
285287
BOOST_CHECK(!device.get_info<CL_DEVICE_IL_VERSION>().empty());
286288
BOOST_CHECK(device.get_info<CL_DEVICE_MAX_NUM_SUB_GROUPS>() > 0);
287289
BOOST_CHECK_NO_THROW(

0 commit comments

Comments
 (0)