That works: std::vector<cl::Program> program; cl::Program tmp( context, source, &err ); tmp.build( devices, compileFlags ); program.push_back( tmp ); This does not: std::vector<cl::Program> program; cl::Program tmp( context, source, &err ); program.push_back( tmp ); program[0].build( devices, compileFlags );
While creating a vector of class objects, it is a good idea to allocate the object on heap and then push back as a pointer to the object. Eg: std::vector<cl::Program*> program; program.push_back(new cl::Program (context, source, &err)); program[0]->build(devices, compileFlags);
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/beignet/beignet/issues/18.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.