Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/ur.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
64 changes: 34 additions & 30 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions include/ur_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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**
);

Expand Down
26 changes: 0 additions & 26 deletions scripts/core/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
31 changes: 30 additions & 1 deletion scripts/core/platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,33 @@ params:
- type: "$x_platform_handle_t*"
name: phPlatform
desc: |
[out] pointer to the handle of the platform object created.
[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."
71 changes: 37 additions & 34 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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.
///
Expand Down