Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 9b0f694

Browse files
agodavarAnusha Godavarthy Surya
authored andcommitted
SWDEV-254185 : hiprtc headers - handle empty headerIncludeNames
Change-Id: Ie06278c18b62cef1bdfbb8ac82728ed5667b2047
1 parent 20ffce7 commit 9b0f694

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

device/devprogram.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,14 +1617,20 @@ int32_t Program::build(const std::string& sourceCode, const char* origOptions,
16171617
headerIncludeNames.push_back(tmpHeaderNames[i].c_str());
16181618
}
16191619
// Compile the source code if any
1620-
if ((buildStatus_ == CL_BUILD_IN_PROGRESS) && !sourceCode.empty() &&
1621-
!compileImpl(sourceCode, headers, &headerIncludeNames[0], options)) {
1620+
bool compileStatus = true;
1621+
if ((buildStatus_ == CL_BUILD_IN_PROGRESS) && !sourceCode.empty()) {
1622+
if (!headerIncludeNames.empty()) {
1623+
compileStatus = compileImpl(sourceCode, headers, &headerIncludeNames[0], options);
1624+
} else {
1625+
compileStatus = compileImpl(sourceCode, headers, nullptr, options);
1626+
}
1627+
}
1628+
if (!compileStatus) {
16221629
buildStatus_ = CL_BUILD_ERROR;
16231630
if (buildLog_.empty()) {
16241631
buildLog_ = "Internal error: Compilation failed.";
16251632
}
16261633
}
1627-
16281634
if ((buildStatus_ == CL_BUILD_IN_PROGRESS) && !linkImpl(options)) {
16291635
buildStatus_ = CL_BUILD_ERROR;
16301636
if (buildLog_.empty()) {

0 commit comments

Comments
 (0)