MCPcopy Create free account
hub / github.com/boostorg/compute / program

Class program

include/boost/compute/program.hpp:73–627  ·  view source on GitHub ↗

\class program \brief A compute program. The program class represents an OpenCL program. Program objects are created with one of the static \c create_with_ functions. For example, to create a program from a source string: \snippet test/test_program.cpp create_with_source And to create a program from a source file: \code boost::compute::program bar_program = boost::compute::program::create_with

Source from the content-addressed store, hash-verified

71///
72/// \see kernel
73class program
74{
75public:
76 /// Creates a null program object.
77 program()
78 : m_program(0)
79 {
80 }
81
82 /// Creates a program object for \p program. If \p retain is \c true,
83 /// the reference count for \p program will be incremented.
84 explicit program(cl_program program, bool retain = true)
85 : m_program(program)
86 {
87 if(m_program && retain){
88 clRetainProgram(m_program);
89 }
90 }
91
92 /// Creates a new program object as a copy of \p other.
93 program(const program &other)
94 : m_program(other.m_program)
95 {
96 if(m_program){
97 clRetainProgram(m_program);
98 }
99 }
100
101 /// Copies the program object from \p other to \c *this.
102 program& operator=(const program &other)
103 {
104 if(this != &other){
105 if(m_program){
106 clReleaseProgram(m_program);
107 }
108
109 m_program = other.m_program;
110
111 if(m_program){
112 clRetainProgram(m_program);
113 }
114 }
115
116 return *this;
117 }
118
119 #ifndef BOOST_COMPUTE_NO_RVALUE_REFERENCES
120 /// Move-constructs a new program object from \p other.
121 program(program&& other) BOOST_NOEXCEPT
122 : m_program(other.m_program)
123 {
124 other.m_program = 0;
125 }
126
127 /// Move-assigns the program from \p other to \c *this.
128 program& operator=(program&& other) BOOST_NOEXCEPT
129 {
130 if(m_program){

Callers 6

BOOST_AUTO_TEST_CASEFunction · 0.85
get_programMethod · 0.85
linkMethod · 0.85
create_with_sourceMethod · 0.85
create_with_binaryMethod · 0.85

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68