@@ -104,6 +104,8 @@ class Program : public RuntimeObject {
104104 // ! The context this program is part of.
105105 SharedReference<Context> context_;
106106
107+ std::vector<std::string> headerNames_;
108+ std::vector<std::string> headers_;
107109 std::string sourceCode_; // !< Strings that make up the source code
108110 Language language_; // !< Input source language
109111 devicebinary_t binary_; // !< The binary image, provided by the app
@@ -128,12 +130,17 @@ class Program : public RuntimeObject {
128130
129131 public:
130132 // ! Construct a new program to be compiled from the given source code.
131- Program (Context& context, const std::string& sourceCode, Language language)
133+ Program (Context& context, const std::string& sourceCode, Language language,
134+ int numHeaders = 0 , const char ** headers = nullptr , const char ** headerNames= nullptr )
132135 : context_(context),
133136 sourceCode_ (sourceCode),
134137 language_(language),
135138 symbolTable_(NULL ),
136139 programLog_() {
140+ for (auto i = 0 ; i != numHeaders; ++i) {
141+ headers_.emplace_back (headers[i]);
142+ headerNames_.emplace_back (headerNames[i]);
143+ }
137144 }
138145
139146 // ! Construct a new program associated with a context.
@@ -159,6 +166,12 @@ class Program : public RuntimeObject {
159166 // ! Return the program source code.
160167 const std::string& sourceCode () const { return sourceCode_; }
161168
169+ // ! Return the program headers.
170+ const std::vector<std::string>& headers () const { return headers_; }
171+
172+ // ! Return the program header include names.
173+ const std::vector<std::string>& headerNames () const { return headerNames_; }
174+
162175 // ! Return the program language.
163176 const Language language () const { return language_; }
164177
0 commit comments