aboutsummaryrefslogtreecommitdiff
path: root/offload/tools/kernelreplay
diff options
context:
space:
mode:
Diffstat (limited to 'offload/tools/kernelreplay')
-rw-r--r--offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp b/offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp
index 47a299f..718e9e7 100644
--- a/offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp
+++ b/offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp
@@ -15,6 +15,7 @@
#include "llvm/Frontend/Offloading/Utility.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -60,11 +61,11 @@ int main(int argc, char **argv) {
MemoryBuffer::getFile(InputFilename, /*isText=*/true,
/*RequiresNullTerminator=*/true);
if (!KernelInfoMB)
- report_fatal_error("Error reading the kernel info json file");
+ reportFatalUsageError("Error reading the kernel info json file");
Expected<json::Value> JsonKernelInfo =
json::parse(KernelInfoMB.get()->getBuffer());
if (auto Err = JsonKernelInfo.takeError())
- report_fatal_error("Cannot parse the kernel info json file");
+ reportFatalUsageError("Cannot parse the kernel info json file");
auto NumTeamsJson =
JsonKernelInfo->getAsObject()->getInteger("NumTeamsClause");
@@ -104,7 +105,7 @@ int main(int argc, char **argv) {
MemoryBuffer::getFile(KernelEntryName + ".image", /*isText=*/false,
/*RequiresNullTerminator=*/false);
if (!ImageMB)
- report_fatal_error("Error reading the kernel image.");
+ reportFatalUsageError("Error reading the kernel image.");
__tgt_device_image DeviceImage;
DeviceImage.ImageStart = const_cast<char *>(ImageMB.get()->getBufferStart());
@@ -145,7 +146,7 @@ int main(int argc, char **argv) {
/*RequiresNullTerminator=*/false);
if (!DeviceMemoryMB)
- report_fatal_error("Error reading the kernel input device memory.");
+ reportFatalUsageError("Error reading the kernel input device memory.");
// On AMD for currently unknown reasons we cannot copy memory mapped data to
// device. This is a work-around.
@@ -178,14 +179,15 @@ int main(int argc, char **argv) {
/*isText=*/false,
/*RequiresNullTerminator=*/false);
if (!OriginalOutputMB)
- report_fatal_error("Error reading the kernel original output file, make "
- "sure LIBOMPTARGET_SAVE_OUTPUT is set when recording");
+ reportFatalUsageError(
+ "Error reading the kernel original output file, make sure "
+ "LIBOMPTARGET_SAVE_OUTPUT is set when recording");
ErrorOr<std::unique_ptr<MemoryBuffer>> ReplayOutputMB =
MemoryBuffer::getFile(KernelEntryName + ".replay.output",
/*isText=*/false,
/*RequiresNullTerminator=*/false);
if (!ReplayOutputMB)
- report_fatal_error("Error reading the kernel replay output file");
+ reportFatalUsageError("Error reading the kernel replay output file");
StringRef OriginalOutput = OriginalOutputMB.get()->getBuffer();
StringRef ReplayOutput = ReplayOutputMB.get()->getBuffer();