@@ -31,6 +31,10 @@ namespace validation_layer
3131 const char ** ppString // /< [in,out] pointer to a null-terminated array of characters describing
3232 // /< cause of error.
3333) {
34+ // Only log success results if verbose logging is enabled
35+ if (result == ZE_RESULT_SUCCESS && !context.verboseLogging ) {
36+ return result;
37+ }
3438 std::string status = (result == ZE_RESULT_SUCCESS) ? " SUCCESS" : " ERROR" ;
3539 std::ostringstream oss;
3640 oss << status << " (" << loader::to_string (result) << " ) in zerGetLastErrorDescription(" ;
@@ -46,6 +50,10 @@ namespace validation_layer
4650 ze_result_t result,
4751 ze_device_handle_t hDevice // /< [in] handle of the device
4852) {
53+ // Only log success results if verbose logging is enabled
54+ if (result == ZE_RESULT_SUCCESS && !context.verboseLogging ) {
55+ return result;
56+ }
4957 std::string status = (result == ZE_RESULT_SUCCESS) ? " SUCCESS" : " ERROR" ;
5058 std::ostringstream oss;
5159 oss << status << " (" << loader::to_string (result) << " ) in zerTranslateDeviceHandleToIdentifier(" ;
@@ -61,6 +69,10 @@ namespace validation_layer
6169 ze_result_t result,
6270 uint32_t identifier // /< [in] integer identifier of the device
6371) {
72+ // Only log success results if verbose logging is enabled
73+ if (result == ZE_RESULT_SUCCESS && !context.verboseLogging ) {
74+ return result;
75+ }
6476 std::string status = (result == ZE_RESULT_SUCCESS) ? " SUCCESS" : " ERROR" ;
6577 std::ostringstream oss;
6678 oss << status << " (" << loader::to_string (result) << " ) in zerTranslateIdentifierToDeviceHandle(" ;
@@ -74,6 +86,10 @@ namespace validation_layer
7486 }
7587 VALIDATION_MAYBE_UNUSED static ze_result_t logAndPropagateResult_zerGetDefaultContext (
7688 ze_result_t result) {
89+ // Only log success results if verbose logging is enabled
90+ if (result == ZE_RESULT_SUCCESS && !context.verboseLogging ) {
91+ return result;
92+ }
7793 std::string status = (result == ZE_RESULT_SUCCESS) ? " SUCCESS" : " ERROR" ;
7894 context.logger ->log_trace (status + " (" + loader::to_string (result) + " ) in zerGetDefaultContext()" );
7995 return result;
0 commit comments