Dateien
rocm-systems/rocclr/runtime/utils/debug.cpp
T
foreman 7f24b9ffbb P4 to Git Change 1184767 by lmoriche@lmoriche_opencl_dev on 2015/08/26 13:54:18
ECR #304775 - Remove the complib oclutils

Affected files ...

... //depot/stg/opencl/drivers/opencl/Makefile#52 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/Makefile#36 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/build/Makefile.complib#92 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/complibdefs#43 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/Makefile#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/build/Makefile#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/build/Makefile.oclutils#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/alloc.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/alloc.hpp#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/os.cpp#6 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/os.hpp#7 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/os_posix.cpp#11 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/os_win32.cpp#6 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/setjmp.S#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/os/setjmp.asm#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/atomic.hpp#5 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/monitor.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/monitor.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/semaphore.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/semaphore.hpp#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/thread.cpp#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/thread/thread.hpp#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/top.hpp#6 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/utils/debug.cpp#2 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/utils/debug.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/utils/macros.hpp#4 delete
... //depot/stg/opencl/drivers/opencl/compiler/lib/promotions/oclutils/utils/util.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/Makefile#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/debug.cpp#4 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/debug.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#238 edit
2015-08-26 14:07:03 -04:00

93 Zeilen
1.9 KiB
C++

//
// Copyright (c) 2008 Advanced Micro Devices, Inc. All rights reserved.
//
#include "top.hpp"
#include "utils/debug.hpp"
#include "os/os.hpp"
#if !defined(LOG_LEVEL)
# include "utils/flags.hpp"
#endif
#include <cstdlib>
#include <cstdio>
#include <cstdarg>
#ifdef _WIN32
#include <windows.h>
#endif // _WIN32
namespace amd {
//! \cond ignore
extern "C" void
breakpoint(void)
{
#ifdef _MSC_VER
DebugBreak();
#endif // _MSC_VER
}
//! \endcond
void
report_fatal(const char* file, int line, const char* message)
{
// FIXME_lmoriche: Obfuscate the message string
fprintf(stderr, "%s:%d: %s\n", file, line, message);
::abort();
}
void
report_warning(const char* message)
{
fprintf(stderr, "Warning: %s\n", message);
}
void
log_entry(LogLevel level, const char* file, int line, const char* message)
{
if (level == LOG_NONE) {
return;
}
fprintf(stderr, ":%d:%s:%d: %s\n", level, file, line, message);
}
void
log_timestamped(LogLevel level, const char* file, int line, const char* message)
{
static bool gotstart = false; // not thread-safe, but not scary if fails
static uint64_t start;
if (!gotstart) {
start = Os::timeNanos();
gotstart = true;
}
uint64_t time = Os::timeNanos() - start;
if (level == LOG_NONE) {
return;
}
#if 0
fprintf(stderr, ":%d:%s:%d: (%010lld) %s\n", level, file, line, time, message);
#else // if you prefer fixed-width fields
fprintf(stderr, ":% 2d:%15s:% 5d: (%010lld) %s\n",
level, file, line, time/100ULL, message); // timestamp is 100ns units
#endif
}
void
log_printf(LogLevel level, const char* file, int line, const char* format, ...)
{
va_list ap;
va_start(ap, format);
char message[1024];
vsprintf(message, format, ap);
va_end(ap);
fprintf(stderr, ":%d:%s:%d: %s\n", level, file, line, message);
}
} // namespace amd