c++ - OpenCL: cl::getDevices crashes -


i have problems opencl-code, crashes @ marked position, nvidia gpu (opencl 1.1) (the intel platforms (opencl 1.2 , opencl 2.0) behave well).

   cl::platform::get(&allplatforms);      alldevices.resize(allplatforms.size());                 size_t nodevices = 0;     (size_t = 0, end = allplatforms.size(); < end; ++i)     {         allplatforms[i].getdevices(cl_device_type_all, &alldevices[i]); //here crashes         nodevices += alldevices[i].size();     }   cl_int getdevices(     cl_device_type type,     vector_class<device>* devices) const {   ...      devices->assign(&ids[0], &ids[n]); //here crashes     return cl_success; } 

i've no idea why crashes , how fix it.

edit: debugger says ids valid pointer , n=1 (in case of crash)

do have recent version of header? have "isreferencecountable" function in it?

earlier versions of header suffered problem nvidia (incorrectly) releases 1.2 cl.h 1.1 icd. c__ header has no way know link error because cl.h reports 1.2 version flag , calls clretaindevice blindly, segfaults because isn't implemented in icd.

later versions of header worked around performing version check against device version , avoiding calling retain/release. if in situation, downloading more recent version of header should fix it: https://www.khronos.org/registry/cl/api/1.2/cl.hpp

if doesn't work, debugger report crash?


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -