File tree Expand file tree Collapse file tree 6 files changed +11
-21
lines changed Expand file tree Collapse file tree 6 files changed +11
-21
lines changed Original file line number Diff line number Diff line change @@ -743,21 +743,14 @@ urLoaderConfigSetCodeLocationCallback(
743
743
void *pUserData ///< [in][out][optional] pointer to data to be passed to callback.
744
744
);
745
745
746
- ///////////////////////////////////////////////////////////////////////////////
747
- /// @brief Callback to replace or instrument generic mock functionality in the
748
- /// mock adapter.
749
- typedef ur_result_t (*ur_mock_callback_t)(
750
- void *pParams ///< [in][out] Pointer to the appropriate param struct for the function
751
- );
752
-
753
746
///////////////////////////////////////////////////////////////////////////////
754
747
/// @brief The only adapter reported with mock enabled will be the mock adapter.
755
748
///
756
749
/// @details
757
750
/// - The mock adapter will default to returning ::UR_RESULT_SUCCESS for all
758
751
/// entry points. It will also create and correctly reference count dummy
759
752
/// handles where appropriate. Its behaviour can be modified by linking
760
- /// the ::ur_mock_headers library and using the callbacks object.
753
+ /// the ::ur_mock_headers library and using the mock:: callbacks object.
761
754
///
762
755
/// @returns
763
756
/// - ::UR_RESULT_SUCCESS
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ given entry point can only have one of each kind of callback associated with
280
280
it, multiple structs with the same function/mode combination will override
281
281
eachother.
282
282
283
- The callback signature defined by ``${x}_mock_callback_t `` takes a single
283
+ The callback signature defined by ``ur_mock_callback_t `` takes a single
284
284
``void * `` parameter. When calling a user callback the layer will pack the
285
285
entry point's parameters into the appropriate ``_params_t `` struct (e.g.
286
286
``ur_adapter_get_params_t ``) and pass a pointer to that struct into the
Original file line number Diff line number Diff line change
1
+ #
1
2
# Copyright (C) 2022-2023 Intel Corporation
2
3
#
3
4
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
@@ -186,19 +187,10 @@ params:
186
187
name : pUserData
187
188
desc : " [in][out][optional] pointer to data to be passed to callback."
188
189
--- # --------------------------------------------------------------------------
189
- type : fptr_typedef
190
- desc : " Callback to replace or instrument generic mock functionality in the mock adapter."
191
- name : $x_mock_callback_t
192
- return : $x_result_t
193
- params :
194
- - type : void*
195
- name : pParams
196
- desc : " [in][out] Pointer to the appropriate param struct for the function"
197
- --- # --------------------------------------------------------------------------
198
190
type : function
199
191
desc : " The only adapter reported with mock enabled will be the mock adapter."
200
192
details :
201
- - " The mock adapter will default to returning $X_RESULT_SUCCESS for all entry points. It will also create and correctly reference count dummy handles where appropriate. Its behaviour can be modified by linking the $x_mock_headers library and using the callbacks object."
193
+ - " The mock adapter will default to returning $X_RESULT_SUCCESS for all entry points. It will also create and correctly reference count dummy handles where appropriate. Its behaviour can be modified by linking the $x_mock_headers library and using the mock:: callbacks object."
202
194
class : $xLoaderConfig
203
195
loader_only : True
204
196
name : " SetMockingEnabled"
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ ur_result_t UR_APICALL urLoaderConfigSetCodeLocationCallback(
199
199
// / - The mock adapter will default to returning ::UR_RESULT_SUCCESS for all
200
200
// / entry points. It will also create and correctly reference count dummy
201
201
// / handles where appropriate. Its behaviour can be modified by linking
202
- // / the ::ur_mock_headers library and using the callbacks object.
202
+ // / the ::ur_mock_headers library and using the mock:: callbacks object.
203
203
// /
204
204
// / @returns
205
205
// / - ::UR_RESULT_SUCCESS
Original file line number Diff line number Diff line change 20
20
#include < unordered_map>
21
21
#include < vector>
22
22
23
+ // This is the callback function we accept to override or instrument
24
+ // entry-points. pParams is expected to be a pointer to the appropriate params_t
25
+ // struct for the given entry point.
26
+ typedef ur_result_t (*ur_mock_callback_t )(void *pParams);
27
+
23
28
namespace mock {
24
29
25
30
struct dummy_handle_t_ {
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ ur_result_t UR_APICALL urLoaderConfigSetCodeLocationCallback(
188
188
// / - The mock adapter will default to returning ::UR_RESULT_SUCCESS for all
189
189
// / entry points. It will also create and correctly reference count dummy
190
190
// / handles where appropriate. Its behaviour can be modified by linking
191
- // / the ::ur_mock_headers library and using the callbacks object.
191
+ // / the ::ur_mock_headers library and using the mock:: callbacks object.
192
192
// /
193
193
// / @returns
194
194
// / - ::UR_RESULT_SUCCESS
You can’t perform that action at this time.
0 commit comments