diff --git a/include/ur.py b/include/ur.py index 028ce1bf96..b3c43bb1c5 100644 --- a/include/ur.py +++ b/include/ur.py @@ -1727,9 +1727,9 @@ class ur_usm_dditable_t(Structure): ############################################################################### ## @brief Function-pointer for urGetLastResult if __use_win_types: - _urGetLastResult_t = WINFUNCTYPE( ur_result_t, POINTER(c_char_p) ) + _urGetLastResult_t = WINFUNCTYPE( ur_result_t, ur_platform_handle_t, POINTER(c_char_p) ) else: - _urGetLastResult_t = CFUNCTYPE( ur_result_t, POINTER(c_char_p) ) + _urGetLastResult_t = CFUNCTYPE( ur_result_t, ur_platform_handle_t, POINTER(c_char_p) ) ############################################################################### ## @brief Function-pointer for urInit diff --git a/include/ur_api.h b/include/ur_api.h index b30e52b67b..50d47a55bd 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -2016,36 +2016,6 @@ urTearDown( void* pParams ///< [in] pointer to tear down parameters ); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve string representation of the underlying adapter specific -/// result reported by the the last API that returned -/// UR_RESULT_ADAPTER_SPECIFIC. Allows for an adapter independent way to -/// return an adapter specific result. -/// -/// @details -/// - The string returned via the ppMessage is a NULL terminated C style -/// string. -/// - The string returned via the ppMessage is thread local. -/// - The entry point will return UR_RESULT_SUCCESS if the result being -/// reported is to be considered a warning. Any other result code returned -/// indicates that the adapter specific result is an error. -/// - The memory in the string returned via the ppMessage is owned by the -/// adapter. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @returns -/// - ::UR_RESULT_SUCCESS -/// - ::UR_RESULT_ERROR_UNINITIALIZED -/// - ::UR_RESULT_ERROR_DEVICE_LOST -/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER -/// + `NULL == ppMessage` -UR_APIEXPORT ur_result_t UR_APICALL -urGetLastResult( - const char** ppMessage ///< [out] pointer to a string containing adapter specific result in string - ///< representation. - ); - #if !defined(__GNUC__) #pragma endregion #endif @@ -3824,6 +3794,39 @@ urPlatformCreateWithNativeHandle( ur_platform_handle_t* phPlatform ///< [out] pointer to the handle of the platform object created. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieve string representation of the underlying adapter specific +/// result reported by the the last API that returned +/// UR_RESULT_ADAPTER_SPECIFIC. Allows for an adapter independent way to +/// return an adapter specific result. +/// +/// @details +/// - The string returned via the ppMessage is a NULL terminated C style +/// string. +/// - The string returned via the ppMessage is thread local. +/// - The entry point will return UR_RESULT_SUCCESS if the result being +/// reported is to be considered a warning. Any other result code returned +/// indicates that the adapter specific result is an error. +/// - The memory in the string returned via the ppMessage is owned by the +/// adapter. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPlatform` +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +/// + `NULL == ppMessage` +UR_APIEXPORT ur_result_t UR_APICALL +urGetLastResult( + ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + const char** ppMessage ///< [out] pointer to a string containing adapter specific result in string + ///< representation. + ); + #if !defined(__GNUC__) #pragma endregion #endif @@ -6588,6 +6591,7 @@ typedef void (UR_APICALL *ur_pfnTearDownCb_t)( /// allowing the callback the ability to modify the parameter's value typedef struct ur_get_last_result_params_t { + ur_platform_handle_t* phPlatform; const char*** pppMessage; } ur_get_last_result_params_t; diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 3b761dde59..5aff8e1dc2 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -1206,6 +1206,7 @@ typedef ur_result_t (UR_APICALL *ur_pfnTearDown_t)( /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urGetLastResult typedef ur_result_t (UR_APICALL *ur_pfnGetLastResult_t)( + ur_platform_handle_t, const char** ); diff --git a/scripts/core/misc.yml b/scripts/core/misc.yml index 7b8d2113d3..110dd309d5 100644 --- a/scripts/core/misc.yml +++ b/scripts/core/misc.yml @@ -22,29 +22,3 @@ params: desc: "[in] pointer to tear down parameters" returns: - $X_RESULT_OUT_OF_HOST_MEMORY ---- #-------------------------------------------------------------------------- -type: function -desc: "Retrieve string representation of the underlying adapter specific result - reported by the the last API that returned UR_RESULT_ADAPTER_SPECIFIC. - Allows for an adapter independent way to return an adapter - specific result." -class: $x -name: GetLastResult -decl: static -ordinal: "0" -details: - - "The string returned via the ppMessage is a NULL terminated C style string." - - "The string returned via the ppMessage is thread local." - - "The entry point will return UR_RESULT_SUCCESS if the result being - reported is to be considered a warning. Any other result code returned - indicates that the adapter specific result is an error." - - "The memory in the string returned via the ppMessage is owned by the - adapter." - - "The application may call this function from simultaneous - threads." - - "The implementation of this function should be lock-free." -params: - - type: const char** - name: ppMessage - desc: "[out] pointer to a string containing adapter specific result - in string representation." diff --git a/scripts/core/platform.yml b/scripts/core/platform.yml index 846dce0176..0a4c74d3e4 100644 --- a/scripts/core/platform.yml +++ b/scripts/core/platform.yml @@ -161,4 +161,33 @@ params: - type: "$x_platform_handle_t*" name: phPlatform desc: | - [out] pointer to the handle of the platform object created. \ No newline at end of file + [out] pointer to the handle of the platform object created. +--- #-------------------------------------------------------------------------- +type: function +desc: "Retrieve string representation of the underlying adapter specific result + reported by the the last API that returned UR_RESULT_ADAPTER_SPECIFIC. + Allows for an adapter independent way to return an adapter + specific result." +class: $x +name: GetLastResult +decl: static +ordinal: "0" +details: + - "The string returned via the ppMessage is a NULL terminated C style string." + - "The string returned via the ppMessage is thread local." + - "The entry point will return UR_RESULT_SUCCESS if the result being + reported is to be considered a warning. Any other result code returned + indicates that the adapter specific result is an error." + - "The memory in the string returned via the ppMessage is owned by the + adapter." + - "The application may call this function from simultaneous + threads." + - "The implementation of this function should be lock-free." +params: + - type: $x_platform_handle_t + name: hPlatform + desc: "[in] handle of the platform instance" + - type: const char** + name: ppMessage + desc: "[out] pointer to a string containing adapter specific result + in string representation." diff --git a/source/ur_api.cpp b/source/ur_api.cpp index c22585df67..ad554261e8 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -1669,40 +1669,6 @@ urTearDown( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Retrieve string representation of the underlying adapter specific -/// result reported by the the last API that returned -/// UR_RESULT_ADAPTER_SPECIFIC. Allows for an adapter independent way to -/// return an adapter specific result. -/// -/// @details -/// - The string returned via the ppMessage is a NULL terminated C style -/// string. -/// - The string returned via the ppMessage is thread local. -/// - The entry point will return UR_RESULT_SUCCESS if the result being -/// reported is to be considered a warning. Any other result code returned -/// indicates that the adapter specific result is an error. -/// - The memory in the string returned via the ppMessage is owned by the -/// adapter. -/// - The application may call this function from simultaneous threads. -/// - The implementation of this function should be lock-free. -/// -/// @returns -/// - ::UR_RESULT_SUCCESS -/// - ::UR_RESULT_ERROR_UNINITIALIZED -/// - ::UR_RESULT_ERROR_DEVICE_LOST -/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER -/// + `NULL == ppMessage` -ur_result_t UR_APICALL -urGetLastResult( - const char** ppMessage ///< [out] pointer to a string containing adapter specific result in string - ///< representation. - ) -{ - ur_result_t result = UR_RESULT_SUCCESS; - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Query information about a command queue /// @@ -3244,6 +3210,43 @@ urPlatformCreateWithNativeHandle( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Retrieve string representation of the underlying adapter specific +/// result reported by the the last API that returned +/// UR_RESULT_ADAPTER_SPECIFIC. Allows for an adapter independent way to +/// return an adapter specific result. +/// +/// @details +/// - The string returned via the ppMessage is a NULL terminated C style +/// string. +/// - The string returned via the ppMessage is thread local. +/// - The entry point will return UR_RESULT_SUCCESS if the result being +/// reported is to be considered a warning. Any other result code returned +/// indicates that the adapter specific result is an error. +/// - The memory in the string returned via the ppMessage is owned by the +/// adapter. +/// - The application may call this function from simultaneous threads. +/// - The implementation of this function should be lock-free. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPlatform` +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +/// + `NULL == ppMessage` +ur_result_t UR_APICALL +urGetLastResult( + ur_platform_handle_t hPlatform, ///< [in] handle of the platform instance + const char** ppMessage ///< [out] pointer to a string containing adapter specific result in string + ///< representation. + ) +{ + ur_result_t result = UR_RESULT_SUCCESS; + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Create Program from input SPIR-V modules. ///