@@ -225,6 +225,7 @@ typedef enum ur_function_t {
225
225
UR_FUNCTION_ENQUEUE_TIMESTAMP_RECORDING_EXP = 223, ///< Enumerator for ::urEnqueueTimestampRecordingExp
226
226
UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH_CUSTOM_EXP = 224, ///< Enumerator for ::urEnqueueKernelLaunchCustomExp
227
227
UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE = 225, ///< Enumerator for ::urKernelGetSuggestedLocalWorkSize
228
+ UR_FUNCTION_LOADER_CONFIG_SET_MOCKING_ENABLED = 231, ///< Enumerator for ::urLoaderConfigSetMockingEnabled
228
229
/// @cond
229
230
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
230
231
/// @endcond
@@ -598,7 +599,7 @@ urLoaderConfigCreate(
598
599
/// + `NULL == hLoaderConfig`
599
600
UR_APIEXPORT ur_result_t UR_APICALL
600
601
urLoaderConfigRetain(
601
- ur_loader_config_handle_t hLoaderConfig ///< [in] loader config handle to retain
602
+ ur_loader_config_handle_t hLoaderConfig ///< [in][retain] loader config handle to retain
602
603
);
603
604
604
605
///////////////////////////////////////////////////////////////////////////////
@@ -619,7 +620,7 @@ urLoaderConfigRetain(
619
620
/// + `NULL == hLoaderConfig`
620
621
UR_APIEXPORT ur_result_t UR_APICALL
621
622
urLoaderConfigRelease(
622
- ur_loader_config_handle_t hLoaderConfig ///< [in] config handle to release
623
+ ur_loader_config_handle_t hLoaderConfig ///< [in][release] config handle to release
623
624
);
624
625
625
626
///////////////////////////////////////////////////////////////////////////////
@@ -739,6 +740,35 @@ urLoaderConfigSetCodeLocationCallback(
739
740
void *pUserData ///< [in][out][optional] pointer to data to be passed to callback.
740
741
);
741
742
743
+ ///////////////////////////////////////////////////////////////////////////////
744
+ /// @brief Callback to replace or instrument generic mock functionality in the
745
+ /// mock adapter.
746
+ typedef ur_result_t (*ur_mock_callback_t)(
747
+ void *pParams ///< [in][out] Pointer to the appropriate param struct for the function
748
+ );
749
+
750
+ ///////////////////////////////////////////////////////////////////////////////
751
+ /// @brief The only adapter reported with mock enabled will be the mock adapter.
752
+ ///
753
+ /// @details
754
+ /// - The mock adapter will default to returning ::UR_RESULT_SUCCESS for all
755
+ /// entry points. It will also create and correctly reference count dummy
756
+ /// handles where appropriate. Its behaviour can be modified by linking
757
+ /// the ::ur_mock_headers library and using the callbacks object.
758
+ ///
759
+ /// @returns
760
+ /// - ::UR_RESULT_SUCCESS
761
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
762
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
763
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
764
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
765
+ /// + `NULL == hLoaderConfig`
766
+ UR_APIEXPORT ur_result_t UR_APICALL
767
+ urLoaderConfigSetMockingEnabled(
768
+ ur_loader_config_handle_t hLoaderConfig, ///< [in] Handle to config object mocking will be enabled for.
769
+ ur_bool_t enable ///< [in] Handle to config object the layer will be enabled for.
770
+ );
771
+
742
772
///////////////////////////////////////////////////////////////////////////////
743
773
/// @brief Initialize the 'oneAPI' loader
744
774
///
@@ -842,7 +872,7 @@ urAdapterGet(
842
872
/// + `NULL == hAdapter`
843
873
UR_APIEXPORT ur_result_t UR_APICALL
844
874
urAdapterRelease(
845
- ur_adapter_handle_t hAdapter ///< [in] Adapter handle to release
875
+ ur_adapter_handle_t hAdapter ///< [in][release] Adapter handle to release
846
876
);
847
877
848
878
///////////////////////////////////////////////////////////////////////////////
@@ -860,7 +890,7 @@ urAdapterRelease(
860
890
/// + `NULL == hAdapter`
861
891
UR_APIEXPORT ur_result_t UR_APICALL
862
892
urAdapterRetain(
863
- ur_adapter_handle_t hAdapter ///< [in] Adapter handle to retain
893
+ ur_adapter_handle_t hAdapter ///< [in][retain] Adapter handle to retain
864
894
);
865
895
866
896
///////////////////////////////////////////////////////////////////////////////
@@ -1727,7 +1757,7 @@ urDeviceGetInfo(
1727
1757
/// + `NULL == hDevice`
1728
1758
UR_APIEXPORT ur_result_t UR_APICALL
1729
1759
urDeviceRetain(
1730
- ur_device_handle_t hDevice ///< [in] handle of the device to get a reference of.
1760
+ ur_device_handle_t hDevice ///< [in][retain] handle of the device to get a reference of.
1731
1761
);
1732
1762
1733
1763
///////////////////////////////////////////////////////////////////////////////
@@ -1755,7 +1785,7 @@ urDeviceRetain(
1755
1785
/// + `NULL == hDevice`
1756
1786
UR_APIEXPORT ur_result_t UR_APICALL
1757
1787
urDeviceRelease(
1758
- ur_device_handle_t hDevice ///< [in] handle of the device to release.
1788
+ ur_device_handle_t hDevice ///< [in][release] handle of the device to release.
1759
1789
);
1760
1790
1761
1791
///////////////////////////////////////////////////////////////////////////////
@@ -2208,7 +2238,7 @@ urContextCreate(
2208
2238
/// + `NULL == hContext`
2209
2239
UR_APIEXPORT ur_result_t UR_APICALL
2210
2240
urContextRetain(
2211
- ur_context_handle_t hContext ///< [in] handle of the context to get a reference of.
2241
+ ur_context_handle_t hContext ///< [in][retain] handle of the context to get a reference of.
2212
2242
);
2213
2243
2214
2244
///////////////////////////////////////////////////////////////////////////////
@@ -2262,7 +2292,7 @@ typedef enum ur_context_info_t {
2262
2292
/// + `NULL == hContext`
2263
2293
UR_APIEXPORT ur_result_t UR_APICALL
2264
2294
urContextRelease(
2265
- ur_context_handle_t hContext ///< [in] handle of the context to release.
2295
+ ur_context_handle_t hContext ///< [in][release] handle of the context to release.
2266
2296
);
2267
2297
2268
2298
///////////////////////////////////////////////////////////////////////////////
@@ -2726,7 +2756,7 @@ urMemBufferCreate(
2726
2756
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
2727
2757
UR_APIEXPORT ur_result_t UR_APICALL
2728
2758
urMemRetain(
2729
- ur_mem_handle_t hMem ///< [in] handle of the memory object to get access
2759
+ ur_mem_handle_t hMem ///< [in][retain] handle of the memory object to get access
2730
2760
);
2731
2761
2732
2762
///////////////////////////////////////////////////////////////////////////////
@@ -2748,7 +2778,7 @@ urMemRetain(
2748
2778
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
2749
2779
UR_APIEXPORT ur_result_t UR_APICALL
2750
2780
urMemRelease(
2751
- ur_mem_handle_t hMem ///< [in] handle of the memory object to release
2781
+ ur_mem_handle_t hMem ///< [in][release] handle of the memory object to release
2752
2782
);
2753
2783
2754
2784
///////////////////////////////////////////////////////////////////////////////
@@ -3114,7 +3144,7 @@ urSamplerCreate(
3114
3144
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
3115
3145
UR_APIEXPORT ur_result_t UR_APICALL
3116
3146
urSamplerRetain(
3117
- ur_sampler_handle_t hSampler ///< [in] handle of the sampler object to get access
3147
+ ur_sampler_handle_t hSampler ///< [in][retain] handle of the sampler object to get access
3118
3148
);
3119
3149
3120
3150
///////////////////////////////////////////////////////////////////////////////
@@ -3137,7 +3167,7 @@ urSamplerRetain(
3137
3167
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
3138
3168
UR_APIEXPORT ur_result_t UR_APICALL
3139
3169
urSamplerRelease(
3140
- ur_sampler_handle_t hSampler ///< [in] handle of the sampler object to release
3170
+ ur_sampler_handle_t hSampler ///< [in][release] handle of the sampler object to release
3141
3171
);
3142
3172
3143
3173
///////////////////////////////////////////////////////////////////////////////
@@ -3674,7 +3704,7 @@ urUSMPoolCreate(
3674
3704
/// + `NULL == pPool`
3675
3705
UR_APIEXPORT ur_result_t UR_APICALL
3676
3706
urUSMPoolRetain(
3677
- ur_usm_pool_handle_t pPool ///< [in] pointer to USM memory pool
3707
+ ur_usm_pool_handle_t pPool ///< [in][retain] pointer to USM memory pool
3678
3708
);
3679
3709
3680
3710
///////////////////////////////////////////////////////////////////////////////
@@ -3696,7 +3726,7 @@ urUSMPoolRetain(
3696
3726
/// + `NULL == pPool`
3697
3727
UR_APIEXPORT ur_result_t UR_APICALL
3698
3728
urUSMPoolRelease(
3699
- ur_usm_pool_handle_t pPool ///< [in] pointer to USM memory pool
3729
+ ur_usm_pool_handle_t pPool ///< [in][release] pointer to USM memory pool
3700
3730
);
3701
3731
3702
3732
///////////////////////////////////////////////////////////////////////////////
@@ -4030,7 +4060,7 @@ urPhysicalMemCreate(
4030
4060
/// + `NULL == hPhysicalMem`
4031
4061
UR_APIEXPORT ur_result_t UR_APICALL
4032
4062
urPhysicalMemRetain(
4033
- ur_physical_mem_handle_t hPhysicalMem ///< [in] handle of the physical memory object to retain.
4063
+ ur_physical_mem_handle_t hPhysicalMem ///< [in][retain] handle of the physical memory object to retain.
4034
4064
);
4035
4065
4036
4066
///////////////////////////////////////////////////////////////////////////////
@@ -4045,7 +4075,7 @@ urPhysicalMemRetain(
4045
4075
/// + `NULL == hPhysicalMem`
4046
4076
UR_APIEXPORT ur_result_t UR_APICALL
4047
4077
urPhysicalMemRelease(
4048
- ur_physical_mem_handle_t hPhysicalMem ///< [in] handle of the physical memory object to release.
4078
+ ur_physical_mem_handle_t hPhysicalMem ///< [in][release] handle of the physical memory object to release.
4049
4079
);
4050
4080
4051
4081
#if !defined(__GNUC__)
@@ -4313,7 +4343,7 @@ urProgramLink(
4313
4343
/// + `NULL == hProgram`
4314
4344
UR_APIEXPORT ur_result_t UR_APICALL
4315
4345
urProgramRetain(
4316
- ur_program_handle_t hProgram ///< [in] handle for the Program to retain
4346
+ ur_program_handle_t hProgram ///< [in][retain] handle for the Program to retain
4317
4347
);
4318
4348
4319
4349
///////////////////////////////////////////////////////////////////////////////
@@ -4338,7 +4368,7 @@ urProgramRetain(
4338
4368
/// + `NULL == hProgram`
4339
4369
UR_APIEXPORT ur_result_t UR_APICALL
4340
4370
urProgramRelease(
4341
- ur_program_handle_t hProgram ///< [in] handle for the Program to release
4371
+ ur_program_handle_t hProgram ///< [in][release] handle for the Program to release
4342
4372
);
4343
4373
4344
4374
///////////////////////////////////////////////////////////////////////////////
@@ -4960,7 +4990,7 @@ urKernelGetSubGroupInfo(
4960
4990
/// + `NULL == hKernel`
4961
4991
UR_APIEXPORT ur_result_t UR_APICALL
4962
4992
urKernelRetain(
4963
- ur_kernel_handle_t hKernel ///< [in] handle for the Kernel to retain
4993
+ ur_kernel_handle_t hKernel ///< [in][retain] handle for the Kernel to retain
4964
4994
);
4965
4995
4966
4996
///////////////////////////////////////////////////////////////////////////////
@@ -4985,7 +5015,7 @@ urKernelRetain(
4985
5015
/// + `NULL == hKernel`
4986
5016
UR_APIEXPORT ur_result_t UR_APICALL
4987
5017
urKernelRelease(
4988
- ur_kernel_handle_t hKernel ///< [in] handle for the Kernel to release
5018
+ ur_kernel_handle_t hKernel ///< [in][release] handle for the Kernel to release
4989
5019
);
4990
5020
4991
5021
///////////////////////////////////////////////////////////////////////////////
@@ -5467,7 +5497,7 @@ urQueueCreate(
5467
5497
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
5468
5498
UR_APIEXPORT ur_result_t UR_APICALL
5469
5499
urQueueRetain(
5470
- ur_queue_handle_t hQueue ///< [in] handle of the queue object to get access
5500
+ ur_queue_handle_t hQueue ///< [in][retain] handle of the queue object to get access
5471
5501
);
5472
5502
5473
5503
///////////////////////////////////////////////////////////////////////////////
@@ -5496,7 +5526,7 @@ urQueueRetain(
5496
5526
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
5497
5527
UR_APIEXPORT ur_result_t UR_APICALL
5498
5528
urQueueRelease(
5499
- ur_queue_handle_t hQueue ///< [in] handle of the queue object to release
5529
+ ur_queue_handle_t hQueue ///< [in][release] handle of the queue object to release
5500
5530
);
5501
5531
5502
5532
///////////////////////////////////////////////////////////////////////////////
@@ -5861,7 +5891,7 @@ urEventWait(
5861
5891
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
5862
5892
UR_APIEXPORT ur_result_t UR_APICALL
5863
5893
urEventRetain(
5864
- ur_event_handle_t hEvent ///< [in] handle of the event object
5894
+ ur_event_handle_t hEvent ///< [in][retain] handle of the event object
5865
5895
);
5866
5896
5867
5897
///////////////////////////////////////////////////////////////////////////////
@@ -5884,7 +5914,7 @@ urEventRetain(
5884
5914
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
5885
5915
UR_APIEXPORT ur_result_t UR_APICALL
5886
5916
urEventRelease(
5887
- ur_event_handle_t hEvent ///< [in] handle of the event object
5917
+ ur_event_handle_t hEvent ///< [in][release] handle of the event object
5888
5918
);
5889
5919
5890
5920
///////////////////////////////////////////////////////////////////////////////
@@ -7893,7 +7923,7 @@ UR_APIEXPORT ur_result_t UR_APICALL
7893
7923
urBindlessImagesReleaseInteropExp(
7894
7924
ur_context_handle_t hContext, ///< [in] handle of the context object
7895
7925
ur_device_handle_t hDevice, ///< [in] handle of the device object
7896
- ur_exp_interop_mem_handle_t hInteropMem ///< [in] handle of interop memory to be freed
7926
+ ur_exp_interop_mem_handle_t hInteropMem ///< [in][release] handle of interop memory to be freed
7897
7927
);
7898
7928
7899
7929
///////////////////////////////////////////////////////////////////////////////
@@ -8191,7 +8221,7 @@ urCommandBufferCreateExp(
8191
8221
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
8192
8222
UR_APIEXPORT ur_result_t UR_APICALL
8193
8223
urCommandBufferRetainExp(
8194
- ur_exp_command_buffer_handle_t hCommandBuffer ///< [in] Handle of the command-buffer object.
8224
+ ur_exp_command_buffer_handle_t hCommandBuffer ///< [in][retain] Handle of the command-buffer object.
8195
8225
);
8196
8226
8197
8227
///////////////////////////////////////////////////////////////////////////////
@@ -8210,7 +8240,7 @@ urCommandBufferRetainExp(
8210
8240
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
8211
8241
UR_APIEXPORT ur_result_t UR_APICALL
8212
8242
urCommandBufferReleaseExp(
8213
- ur_exp_command_buffer_handle_t hCommandBuffer ///< [in] Handle of the command-buffer object.
8243
+ ur_exp_command_buffer_handle_t hCommandBuffer ///< [in][release] Handle of the command-buffer object.
8214
8244
);
8215
8245
8216
8246
///////////////////////////////////////////////////////////////////////////////
@@ -8758,7 +8788,7 @@ urCommandBufferRetainCommandExp(
8758
8788
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
8759
8789
UR_APIEXPORT ur_result_t UR_APICALL
8760
8790
urCommandBufferReleaseCommandExp(
8761
- ur_exp_command_buffer_command_handle_t hCommand ///< [in] Handle of the command-buffer command.
8791
+ ur_exp_command_buffer_command_handle_t hCommand ///< [in][release] Handle of the command-buffer command.
8762
8792
);
8763
8793
8764
8794
///////////////////////////////////////////////////////////////////////////////
@@ -9519,6 +9549,15 @@ typedef struct ur_loader_config_set_code_location_callback_params_t {
9519
9549
void **ppUserData;
9520
9550
} ur_loader_config_set_code_location_callback_params_t;
9521
9551
9552
+ ///////////////////////////////////////////////////////////////////////////////
9553
+ /// @brief Function parameters for urLoaderConfigSetMockingEnabled
9554
+ /// @details Each entry is a pointer to the parameter passed to the function;
9555
+ /// allowing the callback the ability to modify the parameter's value
9556
+ typedef struct ur_loader_config_set_mocking_enabled_params_t {
9557
+ ur_loader_config_handle_t *phLoaderConfig;
9558
+ ur_bool_t *penable;
9559
+ } ur_loader_config_set_mocking_enabled_params_t;
9560
+
9522
9561
///////////////////////////////////////////////////////////////////////////////
9523
9562
/// @brief Function parameters for urPlatformGet
9524
9563
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments