Skip to content

Commit 0f8dead

Browse files
committed
Set mock adapter default info overrides as "before" callbacks.
This way any override for these entry points from an application will take precedence over our defaults.
1 parent 42f61ac commit 0f8dead

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/adapters/mock/ur_mock.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ ur_result_t mock_urDeviceGetInfo(void *pParams) {
8989
context_t::context_t() {
9090
mock::getCallbacks().set_replace_callback("urPlatformGetApiVersion",
9191
&mock_urPlatformGetApiVersion);
92-
mock::getCallbacks().set_replace_callback("urPlatformGetInfo",
93-
&mock_urPlatformGetInfo);
94-
mock::getCallbacks().set_replace_callback("urDeviceGetInfo",
95-
&mock_urDeviceGetInfo);
92+
// Set the default info stuff as before overrides, this way any application
93+
// passing in an override for them in any slot will take precedence.
94+
mock::getCallbacks().set_before_callback("urPlatformGetInfo",
95+
&mock_urPlatformGetInfo);
96+
mock::getCallbacks().set_before_callback("urDeviceGetInfo",
97+
&mock_urDeviceGetInfo);
9698
}
9799
} // namespace driver

0 commit comments

Comments
 (0)