mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Related-To: NEO-3677 Change-Id: I2c98595190fadfa8ffd9e378e774c0d4485cbf9e Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
35 lines
873 B
C++
35 lines
873 B
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "core/helpers/abort.h"
|
|
|
|
#define UNRECOVERABLE_IF(expression) \
|
|
\
|
|
if (expression) { \
|
|
NEO::abortUnrecoverable(__LINE__, __FILE__); \
|
|
}
|
|
|
|
#define UNREACHABLE(...) std::abort()
|
|
|
|
#ifndef DEBUG_BREAK_IF
|
|
#ifdef _DEBUG
|
|
#define DEBUG_BREAK_IF(expression) \
|
|
\
|
|
if (expression) { \
|
|
NEO::debugBreak(__LINE__, __FILE__); \
|
|
}
|
|
#else
|
|
#define DEBUG_BREAK_IF(expression) (void)0
|
|
#endif // _DEBUG
|
|
#endif // !DEBUG_BREAK_IF
|
|
|
|
namespace NEO {
|
|
void debugBreak(int line, const char *file);
|
|
[[noreturn]] void abortUnrecoverable(int line, const char *file);
|
|
} // namespace NEO
|