Results 1 to 4 of 4

Thread: cl.hpp: Kernel::getWorkGroupInfo bugs

  1. #1

    cl.hpp: Kernel::getWorkGroupInfo bugs

    Hi all,

    I recently started using the cl.hpp C++ bindings under Mac OS X 10.6, but I experience some problems with the Kernel::getWorkGroupInfo methods.

    First, the utility method

    Code :
    template <cl_int name> typename
        detail::param_traits<detail::cl_kernel_work_group_info, name>::param_type
        getWorkGroupInfo(cl_int* err = NULL) const

    should include also a const Device& parameter in order to meaningfully pass information to the full getWorkGroupInfo method.

    Second, this latter method

    Code :
    cl_int getWorkGroupInfo(
            const Device& device, cl_kernel_work_group_info name, T* param) const

    does not compile under Mac OS X, raising the following errors:

    Code :
    /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:787:0 /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:787:   instantiated from 'static cl_int cl::detail::GetInfoHelper<Functor, T>::get(Functor, cl_uint, T*) [with Functor = cl::detail::GetInfoFunctor1<cl_int (*)(_cl_kernel*, _cl_device_id*, cl_kernel_work_group_info, size_t, void*, size_t*), _cl_device_id*, _cl_kernel*>, T = long unsigned int]'
    /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:1015:0 /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:1015:   instantiated from 'cl_int cl::detail::getInfo(Func, const Arg0&, const Arg1&, cl_uint, T*) [with Func = cl_int (*)(_cl_kernel*, _cl_device_id*, cl_kernel_work_group_info, size_t, void*, size_t*), Arg0 = _cl_device_id*, Arg1 = _cl_kernel*, T = size_t]'
    /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:3146:0 /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:3146:   instantiated from 'cl_int cl::Kernel::getWorkGroupInfo(const cl::Device&, cl_kernel_work_group_info, T*) const [with T = size_t]'
    /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:997:0 /Users/digasper/Documents/Development/GraphColoringOpenCL/cl.hpp:997: error: cannot convert '_cl_device_id* const' to '_cl_kernel*' in argument passing

    Since they are some errors due to functors and other meta-programming stuff, I am not so confortable in understanding them.

  2. #2
    Junior Member
    Join Date
    Oct 2009
    Posts
    1

    Re: cl.hpp: Kernel::getWorkGroupInfo bugs

    It is a bug. the sequence of arguments does NOT match clGetKernelWorkGroupInfo.
    so here is a patch to fix it.

    Code :
    @@ -3142,7 +3142,7 @@
         {
             return detail::errHandler(
                 detail::getInfo(
    -                &::clGetKernelWorkGroupInfo, device(), object_, name, param),
    +			    &::clGetKernelWorkGroupInfo, object_, device(), name, param),
                     __GET_KERNEL_WORK_GROUP_INFO_ERR);
         }
     
    @@ -3166,11 +3166,11 @@
          */
         template <cl_int name> typename
         detail::param_traits<detail::cl_kernel_work_group_info, name>::param_type
    -    getWorkGroupInfo(cl_int* err = NULL) const
    +    getWorkGroupInfo(const Device& dev, cl_int* err = NULL) const
         {
             typename detail::param_traits<
                 detail::cl_kernel_work_group_info, name>::param_type param;
    -        cl_int result = getWorkGroupInfo(name, &param);
    +        cl_int result = getWorkGroupInfo(dev, name, &param);
             if (err != NULL) {
                 *err = result;
             }

  3. #3
    Junior Member
    Join Date
    Oct 2009
    Posts
    5

    Re: cl.hpp: Kernel::getWorkGroupInfo bugs

    Please bring this to Ben's attention at viewtopic.php?f=28&t=1415

  4. #4
    Junior Member
    Join Date
    Apr 2009
    Posts
    27

    Re: cl.hpp: Kernel::getWorkGroupInfo bugs

    I have updated the C++ bindings to fix this and other issue, and have requested that they be uploaded.

Similar Threads

  1. OpenCL 1.2 cl.hpp
    By Meteorhead in forum OpenCL
    Replies: 16
    Last Post: 05-10-2013, 06:54 PM
  2. More bugs on NV compiler
    By ffelagund in forum OpenCL
    Replies: 2
    Last Post: 04-02-2012, 07:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •