Skip to content

Commit c90c6d0

Browse files
aarongreigkbenzie
authored andcommitted
Add missing retain and fix some null adapter mentions.
1 parent af4ddc7 commit c90c6d0

File tree

12 files changed

+28
-21
lines changed

12 files changed

+28
-21
lines changed

examples/collector/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $ mkdir build
1919
$ cd build
2020
$ cmake .. -DUR_ENABLE_TRACING=ON
2121
$ make
22-
$ UR_ADAPTERS_FORCE_LOAD=./lib/libur_adapter_null.so UR_ENABLE_LAYERS=UR_LAYER_TRACING XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=./lib/libxptifw.so XPTI_SUBSCRIBERS=./lib/libcollector.so ./bin/hello_world
22+
$ UR_ADAPTERS_FORCE_LOAD=./lib/libur_adapter_mock.so UR_ENABLE_LAYERS=UR_LAYER_TRACING XPTI_TRACE_ENABLE=1 XPTI_FRAMEWORK_DISPATCHER=./lib/libxptifw.so XPTI_SUBSCRIBERS=./lib/libcollector.so ./bin/hello_world
2323
```
2424

2525
See [XPTI framework documentation](https://github.com/intel/llvm/blob/sycl/xptifw/doc/XPTI_Framework.md) for more information.

include/ur_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8822,7 +8822,7 @@ urCommandBufferEnqueueExp(
88228822
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
88238823
UR_APIEXPORT ur_result_t UR_APICALL
88248824
urCommandBufferRetainCommandExp(
8825-
ur_exp_command_buffer_command_handle_t hCommand ///< [in] Handle of the command-buffer command.
8825+
ur_exp_command_buffer_command_handle_t hCommand ///< [in][retain] Handle of the command-buffer command.
88268826
);
88278827

88288828
///////////////////////////////////////////////////////////////////////////////

scripts/core/exp-command-buffer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ name: RetainCommandExp
879879
params:
880880
- type: $x_exp_command_buffer_command_handle_t
881881
name: hCommand
882-
desc: "[in] Handle of the command-buffer command."
882+
desc: "[in][retain] Handle of the command-buffer command."
883883
returns:
884884
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_COMMAND_HANDLE_EXP
885885
- $X_RESULT_ERROR_OUT_OF_RESOURCES

source/adapters/mock/ur_mockddi.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (C) 2019-2024 Intel Corporation
3+
* Copyright (C) 2024 Intel Corporation
44
*
55
* Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
66
* See LICENSE.TXT
@@ -9139,7 +9139,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp(
91399139
/// @brief Intercept function for urCommandBufferRetainCommandExp
91409140
__urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
91419141
ur_exp_command_buffer_command_handle_t
9142-
hCommand ///< [in] Handle of the command-buffer command.
9142+
hCommand ///< [in][retain] Handle of the command-buffer command.
91439143
) try {
91449144
ur_result_t result = UR_RESULT_SUCCESS;
91459145

@@ -9161,6 +9161,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
91619161
result = replaceCallback(&params);
91629162
} else {
91639163

9164+
mock::retainDummyHandle(hCommand);
91649165
result = UR_RESULT_SUCCESS;
91659166
}
91669167

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7135,7 +7135,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp(
71357135
/// @brief Intercept function for urCommandBufferRetainCommandExp
71367136
__urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
71377137
ur_exp_command_buffer_command_handle_t
7138-
hCommand ///< [in] Handle of the command-buffer command.
7138+
hCommand ///< [in][retain] Handle of the command-buffer command.
71397139
) {
71407140
auto pfnRetainCommandExp =
71417141
context.urDdiTable.CommandBufferExp.pfnRetainCommandExp;

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8722,7 +8722,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp(
87228722
/// @brief Intercept function for urCommandBufferRetainCommandExp
87238723
__urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
87248724
ur_exp_command_buffer_command_handle_t
8725-
hCommand ///< [in] Handle of the command-buffer command.
8725+
hCommand ///< [in][retain] Handle of the command-buffer command.
87268726
) {
87278727
auto pfnRetainCommandExp =
87288728
context.urDdiTable.CommandBufferExp.pfnRetainCommandExp;

source/loader/ur_ldrddi.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7492,7 +7492,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp(
74927492
/// @brief Intercept function for urCommandBufferRetainCommandExp
74937493
__urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
74947494
ur_exp_command_buffer_command_handle_t
7495-
hCommand ///< [in] Handle of the command-buffer command.
7495+
hCommand ///< [in][retain] Handle of the command-buffer command.
74967496
) {
74977497
ur_result_t result = UR_RESULT_SUCCESS;
74987498

@@ -7514,6 +7514,12 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
75147514
// forward to device-platform
75157515
result = pfnRetainCommandExp(hCommand);
75167516

7517+
if (UR_RESULT_SUCCESS != result) {
7518+
return result;
7519+
}
7520+
7521+
// TODO: do we need to ref count the loader handles?
7522+
75177523
return result;
75187524
}
75197525

source/loader/ur_libapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8173,7 +8173,7 @@ ur_result_t UR_APICALL urCommandBufferEnqueueExp(
81738173
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
81748174
ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
81758175
ur_exp_command_buffer_command_handle_t
8176-
hCommand ///< [in] Handle of the command-buffer command.
8176+
hCommand ///< [in][retain] Handle of the command-buffer command.
81778177
) try {
81788178
auto pfnRetainCommandExp =
81798179
ur_lib::context->urDdiTable.CommandBufferExp.pfnRetainCommandExp;

source/ur_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6928,7 +6928,7 @@ ur_result_t UR_APICALL urCommandBufferEnqueueExp(
69286928
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
69296929
ur_result_t UR_APICALL urCommandBufferRetainCommandExp(
69306930
ur_exp_command_buffer_command_handle_t
6931-
hCommand ///< [in] Handle of the command-buffer command.
6931+
hCommand ///< [in][retain] Handle of the command-buffer command.
69326932
) {
69336933
ur_result_t result = UR_RESULT_SUCCESS;
69346934
return result;

test/conformance/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function(add_conformance_test name)
8787
if(NOT (UR_BUILD_ADAPTER_CUDA OR UR_BUILD_ADAPTER_HIP
8888
OR UR_BUILD_ADAPTER_L0 OR UR_BUILD_ADAPTER_OPENCL
8989
OR UR_BUILD_ADAPTER_NATIVE_CPU OR UR_BUILD_ADAPTER_ALL))
90-
add_test_adapter(${name} adapter_null)
90+
add_test_adapter(${name} adapter_mock)
9191
endif()
9292
endfunction()
9393

0 commit comments

Comments
 (0)