This introduces LipoProteinLipase (lpl), a simple tool for creating fat binaries. It represents a direct replacement of the creaky hccgenco.sh script, which had various issues. The format it uses is that of a code object bundle, generated by the Clang Offload Bundler. The output is always suffixed with the ".adipose" extension. It is shared with HCC. The hipcc script and associated tests are modified to use lpl. Help can be obtained by invoking lpl --help. A more computer-sciency / corporate friendly name is likely to be beneficial, which is a reason for choosing easily searchable/replaceable names such as lpl or adipose.

Цей коміт міститься в:
Alex Voicu
2017-12-08 04:22:57 +00:00
джерело 163b0f7978
коміт b842394957
17 змінених файлів з 3958 додано та 94 видалено
+56
Переглянути файл
@@ -0,0 +1,56 @@
#include "lpl.hpp"
#include <cstdlib>
#include <exception>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
using namespace clara;
using namespace hip_impl;
using namespace std;
int main(int argc, char** argv)
{
try {
if (!hipcc_and_lpl_colocated()) {
throw runtime_error{
"The LPL executable and hipcc must be in the same directory."};
}
bool help = false;
string flags;
string output;
vector<string> sources;
string targets;
auto cmd = cmdline_parser(help, sources, targets, flags, output);
const auto r = cmd.parse(Args{argc, argv});
if (!r) throw runtime_error{r.errorMessage()};
if (help) cout << cmd << endl;
else {
if (sources.empty()) throw runtime_error{"No inputs specified."};
auto tmp = tokenize_targets(targets);
if (tmp.empty()) {
tmp.assign(amdgpu_targets().cbegin(), amdgpu_targets().cend());
}
else validate_targets(tmp);
if (output.empty()) for (auto&& x : tmp) output += x;
generate_fat_binary(sources, tmp, flags, output);
}
}
catch (const exception& ex) {
cerr << ex.what() << endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}