Skip to content

Commit

Permalink
[SPEC] Clarify the behaviour of UR warnning messages
Browse files Browse the repository at this point in the history
* This commits updates the specification to clarify the behaviour
of UR_RESULT_ERROR_ADAPTER_SPECIFIC when returning warning messages.
* This is a temporary change until we add specific error codes
for warnings.
  • Loading branch information
fabiomestre committed Nov 9, 2023
1 parent a1fbbde commit b3680a0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,18 @@ urAdapterRetain(
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Get the last adapter specific error.
/// @brief Get the last adapter specific warning or error.
///
/// @details
/// To be used after another entry-point has returned
/// ::UR_RESULT_ERROR_ADAPTER_SPECIFIC in order to retrieve a message describing
/// the circumstances of the underlying driver error and the error code
/// returned by the failed driver entry-point.
///
/// * If `pError` is ::UR_RESULT_SUCCESS, ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
/// represents a warning instead. This means that the entry-point call did not
/// fail. However it might not have behaved as expected.
///
/// * Implementations *must* store the message and error code in thread-local
/// storage prior to returning ::UR_RESULT_ERROR_ADAPTER_SPECIFIC.
///
Expand Down
6 changes: 5 additions & 1 deletion scripts/core/adapter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ params:
[in] Adapter handle to retain
--- #--------------------------------------------------------------------------
type: function
desc: "Get the last adapter specific error."
desc: "Get the last adapter specific warning or error."
details: |
To be used after another entry-point has returned
$X_RESULT_ERROR_ADAPTER_SPECIFIC in order to retrieve a message describing
the circumstances of the underlying driver error and the error code
returned by the failed driver entry-point.
* If `pError` is $X_RESULT_SUCCESS, $X_RESULT_ERROR_ADAPTER_SPECIFIC
represents a warning instead. This means that the entry-point call did not
fail. However it might not have behaved as expected.
* Implementations *must* store the message and error code in thread-local
storage prior to returning $X_RESULT_ERROR_ADAPTER_SPECIFIC.
Expand Down
6 changes: 5 additions & 1 deletion source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,18 @@ ur_result_t UR_APICALL urAdapterRetain(
}

///////////////////////////////////////////////////////////////////////////////
/// @brief Get the last adapter specific error.
/// @brief Get the last adapter specific warning or error.
///
/// @details
/// To be used after another entry-point has returned
/// ::UR_RESULT_ERROR_ADAPTER_SPECIFIC in order to retrieve a message describing
/// the circumstances of the underlying driver error and the error code
/// returned by the failed driver entry-point.
///
/// * If `pError` is ::UR_RESULT_SUCCESS, ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
/// represents a warning instead. This means that the entry-point call did not
/// fail. However it might not have behaved as expected.
///
/// * Implementations *must* store the message and error code in thread-local
/// storage prior to returning ::UR_RESULT_ERROR_ADAPTER_SPECIFIC.
///
Expand Down
6 changes: 5 additions & 1 deletion source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,18 @@ ur_result_t UR_APICALL urAdapterRetain(
}

///////////////////////////////////////////////////////////////////////////////
/// @brief Get the last adapter specific error.
/// @brief Get the last adapter specific warning or error.
///
/// @details
/// To be used after another entry-point has returned
/// ::UR_RESULT_ERROR_ADAPTER_SPECIFIC in order to retrieve a message describing
/// the circumstances of the underlying driver error and the error code
/// returned by the failed driver entry-point.
///
/// * If `pError` is ::UR_RESULT_SUCCESS, ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
/// represents a warning instead. This means that the entry-point call did not
/// fail. However it might not have behaved as expected.
///
/// * Implementations *must* store the message and error code in thread-local
/// storage prior to returning ::UR_RESULT_ERROR_ADAPTER_SPECIFIC.
///
Expand Down

0 comments on commit b3680a0

Please sign in to comment.