Files
compute-runtime/runtime/helpers/debug_helpers.h
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00

33 lines
857 B
C++

/*
* Copyright (C) 2017-2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/helpers/abort.h"
#define UNRECOVERABLE_IF(expression) \
\
if (expression) { \
OCLRT::abortUnrecoverable(__LINE__, __FILE__); \
}
#ifndef DEBUG_BREAK_IF
#ifdef _DEBUG
#define DEBUG_BREAK_IF(expression) \
\
if (expression) { \
OCLRT::debugBreak(__LINE__, __FILE__); \
}
#else
#define DEBUG_BREAK_IF(expression) (void)0
#endif // _DEBUG
#endif // !DEBUG_BREAK_IF
namespace OCLRT {
void debugBreak(int line, const char *file);
[[noreturn]] void abortUnrecoverable(int line, const char *file);
} // namespace OCLRT