Merge pull request #713 from scchan/master-hcc_early_finalize_support
Support more than one device code blobs in a single .kernel section
[ROCm/hip commit: 7f3e7b5334]
This commit is contained in:
@@ -84,6 +84,9 @@ class Bundled_code_header {
|
|||||||
std::copy_n(f + y.header.offset, y.header.bundle_sz, std::back_inserter(y.blob));
|
std::copy_n(f + y.header.offset, y.header.bundle_sz, std::back_inserter(y.blob));
|
||||||
|
|
||||||
it += y.header.triple_sz;
|
it += y.header.triple_sz;
|
||||||
|
|
||||||
|
x.bundled_code_size = std::max(x.bundled_code_size,
|
||||||
|
y.header.offset + y.header.bundle_sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -123,6 +126,8 @@ class Bundled_code_header {
|
|||||||
// MANIPULATORS
|
// MANIPULATORS
|
||||||
Bundled_code_header& operator=(const Bundled_code_header&) = default;
|
Bundled_code_header& operator=(const Bundled_code_header&) = default;
|
||||||
Bundled_code_header& operator=(Bundled_code_header&&) = default;
|
Bundled_code_header& operator=(Bundled_code_header&&) = default;
|
||||||
|
|
||||||
|
size_t bundled_code_size = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// CREATORS
|
// CREATORS
|
||||||
|
|||||||
@@ -209,10 +209,16 @@ const unordered_map<hsa_isa_t, vector<vector<char>>>& code_object_blobs(bool reb
|
|||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
for (auto&& blob : blobs) {
|
for (auto&& blob : blobs) {
|
||||||
Bundled_code_header tmp{blob};
|
for (auto sub_blob = blob.begin(); sub_blob != blob.end(); ) {
|
||||||
if (valid(tmp)) {
|
Bundled_code_header tmp(sub_blob, blob.end());
|
||||||
for (auto&& bundle : bundles(tmp)) {
|
if (valid(tmp)) {
|
||||||
r[triple_to_hsa_isa(bundle.triple)].push_back(bundle.blob);
|
for (auto&& bundle : bundles(tmp)) {
|
||||||
|
r[triple_to_hsa_isa(bundle.triple)].push_back(bundle.blob);
|
||||||
|
}
|
||||||
|
sub_blob+=tmp.bundled_code_size;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user