From 67c2cbe7fb91d11e6b575fe4b4b7a4f590f035b2 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 17 Dec 2018 14:02:16 -0500
Subject: [PATCH] P4 to Git Change 1721185 by wchau@wchau_OCL_boltzmann on
2018/12/17 13:43:56
SWDEV-162389 - OpenCL Support for COMgr
- fixing bug of using incorrect included header file name
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#23 edit
[ROCm/clr commit: e40b93484f260ee67525cf780f08507f1ca19130]
---
projects/clr/rocclr/runtime/device/devprogram.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/projects/clr/rocclr/runtime/device/devprogram.cpp b/projects/clr/rocclr/runtime/device/devprogram.cpp
index f9cdb9f43d..10c311b9d1 100644
--- a/projects/clr/rocclr/runtime/device/devprogram.cpp
+++ b/projects/clr/rocclr/runtime/device/devprogram.cpp
@@ -605,9 +605,15 @@ bool Program::compileImplLC(const std::string& sourceCode,
if (!headers.empty()) {
for (size_t i = 0; i < headers.size(); ++i) {
- std::string headerName="Header" + std::to_string(i);
+ std::string headerIncludeName(headerIncludeNames[i]);
+ // replace / in path with current os's file separator
+ if (amd::Os::fileSeparator() != '/') {
+ for (auto& it : headerIncludeName) {
+ if (it == '/') it = amd::Os::fileSeparator();
+ }
+ }
if (addCodeObjData(headers[i]->c_str(), headers[i]->length(), AMD_COMGR_DATA_KIND_INCLUDE,
- headerName.c_str(), &inputs) != AMD_COMGR_STATUS_SUCCESS) {
+ headerIncludeName.c_str(), &inputs) != AMD_COMGR_STATUS_SUCCESS) {
buildLog_ += "Error: COMGR fails to add headers into inputs.\n";
amd::Comgr::destroy_data_set(inputs);
return false;