Bug 89181

Summary: cl::Program copy constructor bug
Product: Beignet Reporter: Paul Nagele <f7393>
Component: BeignetAssignee: Zhigang Gong <zhigang.gong>
Status: RESOLVED MOVED QA Contact:
Severity: minor    
Priority: low    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Paul Nagele 2015-02-17 08:02:55 UTC
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 );
Comment 1 Manasi 2015-10-22 22:27:47 UTC
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);
Comment 2 GitLab Migration User 2018-10-12 21:23:32 UTC
-- 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.