From 75daaf67d1506ae5b9ab4d59599a89c34d85de24 Mon Sep 17 00:00:00 2001 From: Kyle Lutz Date: Sat, 30 Jul 2016 18:14:53 -0700 Subject: [PATCH 1/4] Remove const from return type of context_error::get_private_info_size() This removes the const specifier from the return type of the context_error::get_private_info_size() method. This fixes the "type qualifiers ignored on function return type" compiler warning. --- include/boost/compute/exception/context_error.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/compute/exception/context_error.hpp b/include/boost/compute/exception/context_error.hpp index eeb387d8..ec8dc7c3 100644 --- a/include/boost/compute/exception/context_error.hpp +++ b/include/boost/compute/exception/context_error.hpp @@ -70,7 +70,7 @@ public: } /// Returns the size of the private info memory block. - const size_t get_private_info_size() const throw() + size_t get_private_info_size() const throw() { return m_private_info_size; } From c4b3793be10a24f4bbd1b6db5a89ea20bee98b95 Mon Sep 17 00:00:00 2001 From: Kyle Lutz Date: Sat, 30 Jul 2016 18:19:21 -0700 Subject: [PATCH 2/4] Ignore unused arguments in kernel::set_arg_svm_ptr() This ignores unused arguments in the kernel::set_arg_svm_ptr() when compiled without OpenCL 2.0 support. This fixes the "unused parameter" compiler warning. --- include/boost/compute/kernel.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/compute/kernel.hpp b/include/boost/compute/kernel.hpp index 27244c2e..9e6e0953 100644 --- a/include/boost/compute/kernel.hpp +++ b/include/boost/compute/kernel.hpp @@ -270,6 +270,8 @@ public: BOOST_THROW_EXCEPTION(opencl_error(ret)); } #else + (void) index; + (void) ptr; BOOST_THROW_EXCEPTION(opencl_error(CL_INVALID_ARG_VALUE)); #endif } From 6688e92f070c49f624e31649f0dc4b7c241a9924 Mon Sep 17 00:00:00 2001 From: Kyle Lutz Date: Sat, 30 Jul 2016 18:28:31 -0700 Subject: [PATCH 3/4] Change size_t argument to uint_ in opengl_enqueue_*_gl_objects() functions This changes the opengl_enqueue_*_gl_objects() functions to take their 'num_objects' argument as 'uint_' instead of 'size_t'. This fixes the "conversion from 'size_t' to 'cl_uint', possible loss of data" compiler warnings from MSVC. --- include/boost/compute/interop/opengl/acquire.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/compute/interop/opengl/acquire.hpp b/include/boost/compute/interop/opengl/acquire.hpp index 10af4338..b9259e0d 100644 --- a/include/boost/compute/interop/opengl/acquire.hpp +++ b/include/boost/compute/interop/opengl/acquire.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace boost { @@ -22,7 +23,7 @@ namespace compute { /// Enqueues a command to acquire the specified OpenGL memory objects. /// /// \see_opencl_ref{clEnqueueAcquireGLObjects} -inline event opengl_enqueue_acquire_gl_objects(size_t num_objects, +inline event opengl_enqueue_acquire_gl_objects(const uint_ num_objects, const cl_mem *mem_objects, command_queue &queue, const wait_list &events = wait_list()) @@ -47,7 +48,7 @@ inline event opengl_enqueue_acquire_gl_objects(size_t num_objects, /// Enqueues a command to release the specified OpenGL memory objects. /// /// \see_opencl_ref{clEnqueueReleaseGLObjects} -inline event opengl_enqueue_release_gl_objects(size_t num_objects, +inline event opengl_enqueue_release_gl_objects(const uint_ num_objects, const cl_mem *mem_objects, command_queue &queue, const wait_list &events = wait_list()) From 05ab43ed58bfb18c2ac97589c5a1efda7fbbd9b5 Mon Sep 17 00:00:00 2001 From: Kyle Lutz Date: Wed, 3 Aug 2016 20:16:16 -0700 Subject: [PATCH 4/4] Cast index argument to cl_uint in kernel::get_arg_info() This casts the 'index' argument in kernel::get_arg_info() to cl_uint in order to match the signature for clGetKernelArgInfo(). This fixes the "conversion from 'size_t' to 'cl_uint', possible loss of data" compiler warning. --- include/boost/compute/kernel.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/compute/kernel.hpp b/include/boost/compute/kernel.hpp index 9e6e0953..caa1e79b 100644 --- a/include/boost/compute/kernel.hpp +++ b/include/boost/compute/kernel.hpp @@ -188,7 +188,9 @@ public: template T get_arg_info(size_t index, cl_kernel_arg_info info) const { - return detail::get_object_info(clGetKernelArgInfo, m_kernel, info, index); + return detail::get_object_info( + clGetKernelArgInfo, m_kernel, info, static_cast(index) + ); } /// \overload