SWDEV-254185 - Added support to pass include headers to hipRTC

Change-Id: Ic7f2957b04e518c57e2fd3fc9d839de07232405e


[ROCm/clr commit: ac72e50adc]
This commit is contained in:
agodavar authored and Anusha Godavarthy Surya committed 2020-10-12 03:46:04 -04:00
1 parent 4c8d5a2d97
commit 6dddb8ffac
2 files changed
+24 -4

No files matched your search

+14 -1
View File
@@ -104,6 +104,8 @@ class Program : public RuntimeObject {
//! The context this program is part of.
SharedReference<Context> context_;
std::vector<std::string> headerNames_;
std::vector<std::string> headers_;
std::string sourceCode_; //!< Strings that make up the source code
Language language_; //!< Input source language
devicebinary_t binary_; //!< The binary image, provided by the app
@@ -128,12 +130,17 @@ class Program : public RuntimeObject {
public:
//! Construct a new program to be compiled from the given source code.
Program(Context& context, const std::string& sourceCode, Language language)
Program(Context& context, const std::string& sourceCode, Language language,
int numHeaders = 0, const char** headers = nullptr, const char** headerNames= nullptr)
: context_(context),
sourceCode_(sourceCode),
language_(language),
symbolTable_(NULL),
programLog_() {
for (auto i = 0; i != numHeaders; ++i) {
headers_.emplace_back(headers[i]);
headerNames_.emplace_back(headerNames[i]);
}
}
//! Construct a new program associated with a context.
@@ -159,6 +166,12 @@ class Program : public RuntimeObject {
//! Return the program source code.
const std::string& sourceCode() const { return sourceCode_; }
//! Return the program headers.
const std::vector<std::string>& headers() const { return headers_; }
//! Return the program header include names.
const std::vector<std::string>& headerNames() const { return headerNames_; }
//! Return the program language.
const Language language() const { return language_; }