1010
1111#pragma once
1212
13+ #include " logger/ur_logger.hpp"
1314#include " ur/ur.hpp"
1415
1516constexpr size_t MaxMessageSize = 256 ;
@@ -18,29 +19,24 @@ extern thread_local ur_result_t ErrorMessageCode;
1819extern thread_local char ErrorMessage[MaxMessageSize];
1920
2021#define DIE_NO_IMPLEMENTATION \
21- if (PrintTrace) { \
22- std::cerr << " Not Implemented : " << __FUNCTION__ \
23- << " - File : " << __FILE__; \
24- std::cerr << " / Line : " << __LINE__ << std::endl; \
25- } \
26- return UR_RESULT_ERROR_UNSUPPORTED_FEATURE ;
22+ do { \
23+ logger::error ( " Not Implemented : {} - File : {} / Line : {} " , \
24+ __FUNCTION__, __FILE__, __LINE__); \
25+ \
26+ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \
27+ } while ( false ) ;
2728
2829#define CONTINUE_NO_IMPLEMENTATION \
29- if (PrintTrace) { \
30- std::cerr << " Warning : Not Implemented : " << __FUNCTION__ \
31- << " - File : " << __FILE__; \
32- std::cerr << " / Line : " << __LINE__ << std::endl; \
33- } \
34- return UR_RESULT_SUCCESS;
30+ do { \
31+ logger::warning (" Not Implemented : {} - File : {} / Line : {}" , \
32+ __FUNCTION__, __FILE__, __LINE__); \
33+ return UR_RESULT_SUCCESS; \
34+ } while (false );
3535
3636#define CASE_UR_UNSUPPORTED (not_supported ) \
3737 case not_supported: \
38- if (PrintTrace) { \
39- std::cerr << std::endl \
40- << " Unsupported UR case : " << #not_supported << " in " \
41- << __FUNCTION__ << " :" << __LINE__ << " (" << __FILE__ << " )" \
42- << std::endl; \
43- } \
38+ logger::error (" Unsupported UR case : {} in {}:{}({})" , #not_supported, \
39+ __FUNCTION__, __LINE__, __FILE__); \
4440 return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
4541
4642// / ------ Error handling, matching OpenCL plugin semantics.
0 commit comments