Skip to content

Commit d2d455e

Browse files
authored
Merge pull request #648 from haahh/small_fixes
Misc fixes
2 parents 8cbe8b3 + 2bd90c6 commit d2d455e

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

include/boost/compute/algorithm/gather.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class gather_kernel : public meta_kernel
3636
OutputIterator result)
3737
{
3838
m_count = iterator_range_size(first, last);
39-
m_offset = first.get_index();
4039

4140
*this <<
4241
"const uint i = get_global_id(0);\n" <<
@@ -50,12 +49,11 @@ class gather_kernel : public meta_kernel
5049
return event();
5150
}
5251

53-
return exec_1d(queue, m_offset, m_count);
52+
return exec_1d(queue, 0, m_count);
5453
}
5554

5655
private:
5756
size_t m_count;
58-
size_t m_offset;
5957
};
6058

6159
} // end detail namespace

include/boost/compute/context.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class context
204204
typename detail::get_object_info_type<context, Enum>::type
205205
get_info() const;
206206

207-
/// Returns \c true if the context is the same at \p other.
207+
/// Returns \c true if the context is the same as \p other.
208208
bool operator==(const context &other) const
209209
{
210210
return m_context == other.m_context;

include/boost/compute/kernel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class kernel
267267
void set_arg_svm_ptr(size_t index, void* ptr)
268268
{
269269
#ifdef CL_VERSION_2_0
270-
cl_int ret = clSetKernelArgSVMPointer(m_kernel, index, ptr);
270+
cl_int ret = clSetKernelArgSVMPointer(m_kernel, static_cast<cl_uint>(index), ptr);
271271
if(ret != CL_SUCCESS){
272272
BOOST_THROW_EXCEPTION(opencl_error(ret));
273273
}

include/boost/compute/utility/wait_list.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ template<class T> class future;
3333
/// specify dependencies for OpenCL operations or to wait on the host until
3434
/// all of the events have completed.
3535
///
36-
/// This class also provides convenience fnuctions for interacting with
36+
/// This class also provides convenience functions for interacting with
3737
/// OpenCL APIs which typically accept event dependencies as a \c cl_event*
3838
/// pointer and a \c cl_uint size. For example:
3939
/// \code

test/test_gather.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ BOOST_AUTO_TEST_CASE(gather_int)
3434
indices.begin(), indices.end(), input.begin(), output.begin(), queue
3535
);
3636
CHECK_RANGE_EQUAL(int, 5, output, (1, 5, 2, 4, 3));
37+
38+
compute::gather(
39+
indices.begin() + 1, indices.end(), input.begin(), output.begin(), queue
40+
);
41+
CHECK_RANGE_EQUAL(int, 5, output, (5, 2, 4, 3, 3));
3742
}
3843

3944
BOOST_AUTO_TEST_CASE(copy_index_then_gather)

0 commit comments

Comments
 (0)