Coder Social home page Coder Social logo

Comments (6)

noma avatar noma commented on July 17, 2024

For some entries here there are missing entries here.

Please try workaround I wrote you on stackoverflow.

    size_t result[3];
    kernel.getWorkGroupInfo<decltype(result)>(device, CL_KERNEL_GLOBAL_WORK_SIZE, result);

This seems to be a bug in cl.hpp and cl2.hpp.

from opencl-clhpp.

LeMoussel avatar LeMoussel commented on July 17, 2024

With your code, I got

error: no matching function for call to 'cl::Kernel::getWorkGroupInfo<size_t [3]>(cl::Device&, int, size_t [3])'
     miner_kernel_v3.getWorkGroupInfo<decltype(result)>(device, CL_KERNEL_GLOBAL_WORK_SIZE, result);
                                                                                                  ^
In file included from opencl2_error.hpp:7:0,
                 from CLclient.cpp:25:
cl2.hpp:5771:12: note: candidate: template<class T> cl_int cl::Kernel::getWorkGroupInfo(const cl::Device&, cl_kernel_work_group_info, T*) const
     cl_int getWorkGroupInfo(
            ^~~~~~~~~~~~~~~~
cl2.hpp:5771:12: note:   template argument deduction/substitution failed:
CLclient.cpp:412:98: note:   cannot convert 'result' (type 'size_t [3] {aka long long unsigned int [3]}') to type 'long long unsigned int (*)[3]'
     my_kernel.getWorkGroupInfo<decltype(result)>(my_device, CL_KERNEL_GLOBAL_WORK_SIZE, result);

I do this

cl::array<size_t, 3> kernel_global_work_size;
my_kernel.getWorkGroupInfo<cl::array<size_t, 3>>(my_device, CL_KERNEL_GLOBAL_WORK_SIZE, &kernel_global_work_size);

But I got OpenCL error -30 (Invalid Value)

from opencl-clhpp.

LeMoussel avatar LeMoussel commented on July 17, 2024

In cl2.hpp, I add this :
F(cl_kernel_work_group_info, CL_KERNEL_GLOBAL_WORK_SIZE, cl::detail::size_t_array) \
an do this
cl::array<size_t, 3> kernel_global_work_size = my_kernel.getWorkGroupInfo<CL_KERNEL_GLOBAL_WORK_SIZE>(my_device);

No compilation error but OpenCL error -30 (Invalid Value)

from opencl-clhpp.

noma avatar noma commented on July 17, 2024

Ok, so the workaround, using the other variant call (with cl::array of course...) basically works, and the header can be easily fixed.

Now with the Invalid value we are back at the specification, which is not a bug, but requires carefully reading the specification. I though this was the original problem, as you initially didn't post any compilation errors.

Please carefully read the second part of my stack overflow answer, I guess you are using a normal kernel on normal device, in which case the specification basically tells you, that CL_INVALID_VALUE is all you will get from that call.

from opencl-clhpp.

LeMoussel avatar LeMoussel commented on July 17, 2024

Yep I use a normal kernel on normal device and as indicated then it is normal to have CL_INVALID_VALUE

If device is not a custom device or kernel is not a built-in kernel, clGetKernelArgInfo returns the error CL_INVALID_VALUE.

from opencl-clhpp.

noma avatar noma commented on July 17, 2024

So problem solved?

from opencl-clhpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.