Skip to content

Commit 4d395a3

Browse files
authored
Merge pull request #1285 from kswiecicki/spec-queue-fix
[SPEC] Fix queue handle class
2 parents cd97e17 + 381718a commit 4d395a3

File tree

5 files changed

+441
-441
lines changed

5 files changed

+441
-441
lines changed

include/ur_api.h

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -9376,6 +9376,83 @@ typedef struct ur_kernel_suggest_max_cooperative_group_count_exp_params_t {
93769376
uint32_t **ppGroupCountRet;
93779377
} ur_kernel_suggest_max_cooperative_group_count_exp_params_t;
93789378

9379+
///////////////////////////////////////////////////////////////////////////////
9380+
/// @brief Function parameters for urQueueGetInfo
9381+
/// @details Each entry is a pointer to the parameter passed to the function;
9382+
/// allowing the callback the ability to modify the parameter's value
9383+
typedef struct ur_queue_get_info_params_t {
9384+
ur_queue_handle_t *phQueue;
9385+
ur_queue_info_t *ppropName;
9386+
size_t *ppropSize;
9387+
void **ppPropValue;
9388+
size_t **ppPropSizeRet;
9389+
} ur_queue_get_info_params_t;
9390+
9391+
///////////////////////////////////////////////////////////////////////////////
9392+
/// @brief Function parameters for urQueueCreate
9393+
/// @details Each entry is a pointer to the parameter passed to the function;
9394+
/// allowing the callback the ability to modify the parameter's value
9395+
typedef struct ur_queue_create_params_t {
9396+
ur_context_handle_t *phContext;
9397+
ur_device_handle_t *phDevice;
9398+
const ur_queue_properties_t **ppProperties;
9399+
ur_queue_handle_t **pphQueue;
9400+
} ur_queue_create_params_t;
9401+
9402+
///////////////////////////////////////////////////////////////////////////////
9403+
/// @brief Function parameters for urQueueRetain
9404+
/// @details Each entry is a pointer to the parameter passed to the function;
9405+
/// allowing the callback the ability to modify the parameter's value
9406+
typedef struct ur_queue_retain_params_t {
9407+
ur_queue_handle_t *phQueue;
9408+
} ur_queue_retain_params_t;
9409+
9410+
///////////////////////////////////////////////////////////////////////////////
9411+
/// @brief Function parameters for urQueueRelease
9412+
/// @details Each entry is a pointer to the parameter passed to the function;
9413+
/// allowing the callback the ability to modify the parameter's value
9414+
typedef struct ur_queue_release_params_t {
9415+
ur_queue_handle_t *phQueue;
9416+
} ur_queue_release_params_t;
9417+
9418+
///////////////////////////////////////////////////////////////////////////////
9419+
/// @brief Function parameters for urQueueGetNativeHandle
9420+
/// @details Each entry is a pointer to the parameter passed to the function;
9421+
/// allowing the callback the ability to modify the parameter's value
9422+
typedef struct ur_queue_get_native_handle_params_t {
9423+
ur_queue_handle_t *phQueue;
9424+
ur_queue_native_desc_t **ppDesc;
9425+
ur_native_handle_t **pphNativeQueue;
9426+
} ur_queue_get_native_handle_params_t;
9427+
9428+
///////////////////////////////////////////////////////////////////////////////
9429+
/// @brief Function parameters for urQueueCreateWithNativeHandle
9430+
/// @details Each entry is a pointer to the parameter passed to the function;
9431+
/// allowing the callback the ability to modify the parameter's value
9432+
typedef struct ur_queue_create_with_native_handle_params_t {
9433+
ur_native_handle_t *phNativeQueue;
9434+
ur_context_handle_t *phContext;
9435+
ur_device_handle_t *phDevice;
9436+
const ur_queue_native_properties_t **ppProperties;
9437+
ur_queue_handle_t **pphQueue;
9438+
} ur_queue_create_with_native_handle_params_t;
9439+
9440+
///////////////////////////////////////////////////////////////////////////////
9441+
/// @brief Function parameters for urQueueFinish
9442+
/// @details Each entry is a pointer to the parameter passed to the function;
9443+
/// allowing the callback the ability to modify the parameter's value
9444+
typedef struct ur_queue_finish_params_t {
9445+
ur_queue_handle_t *phQueue;
9446+
} ur_queue_finish_params_t;
9447+
9448+
///////////////////////////////////////////////////////////////////////////////
9449+
/// @brief Function parameters for urQueueFlush
9450+
/// @details Each entry is a pointer to the parameter passed to the function;
9451+
/// allowing the callback the ability to modify the parameter's value
9452+
typedef struct ur_queue_flush_params_t {
9453+
ur_queue_handle_t *phQueue;
9454+
} ur_queue_flush_params_t;
9455+
93799456
///////////////////////////////////////////////////////////////////////////////
93809457
/// @brief Function parameters for urSamplerCreate
93819458
/// @details Each entry is a pointer to the parameter passed to the function;
@@ -10040,83 +10117,6 @@ typedef struct ur_enqueue_cooperative_kernel_launch_exp_params_t {
1004010117
ur_event_handle_t **pphEvent;
1004110118
} ur_enqueue_cooperative_kernel_launch_exp_params_t;
1004210119

10043-
///////////////////////////////////////////////////////////////////////////////
10044-
/// @brief Function parameters for urQueueGetInfo
10045-
/// @details Each entry is a pointer to the parameter passed to the function;
10046-
/// allowing the callback the ability to modify the parameter's value
10047-
typedef struct ur_queue_get_info_params_t {
10048-
ur_queue_handle_t *phQueue;
10049-
ur_queue_info_t *ppropName;
10050-
size_t *ppropSize;
10051-
void **ppPropValue;
10052-
size_t **ppPropSizeRet;
10053-
} ur_queue_get_info_params_t;
10054-
10055-
///////////////////////////////////////////////////////////////////////////////
10056-
/// @brief Function parameters for urQueueCreate
10057-
/// @details Each entry is a pointer to the parameter passed to the function;
10058-
/// allowing the callback the ability to modify the parameter's value
10059-
typedef struct ur_queue_create_params_t {
10060-
ur_context_handle_t *phContext;
10061-
ur_device_handle_t *phDevice;
10062-
const ur_queue_properties_t **ppProperties;
10063-
ur_queue_handle_t **pphQueue;
10064-
} ur_queue_create_params_t;
10065-
10066-
///////////////////////////////////////////////////////////////////////////////
10067-
/// @brief Function parameters for urQueueRetain
10068-
/// @details Each entry is a pointer to the parameter passed to the function;
10069-
/// allowing the callback the ability to modify the parameter's value
10070-
typedef struct ur_queue_retain_params_t {
10071-
ur_queue_handle_t *phQueue;
10072-
} ur_queue_retain_params_t;
10073-
10074-
///////////////////////////////////////////////////////////////////////////////
10075-
/// @brief Function parameters for urQueueRelease
10076-
/// @details Each entry is a pointer to the parameter passed to the function;
10077-
/// allowing the callback the ability to modify the parameter's value
10078-
typedef struct ur_queue_release_params_t {
10079-
ur_queue_handle_t *phQueue;
10080-
} ur_queue_release_params_t;
10081-
10082-
///////////////////////////////////////////////////////////////////////////////
10083-
/// @brief Function parameters for urQueueGetNativeHandle
10084-
/// @details Each entry is a pointer to the parameter passed to the function;
10085-
/// allowing the callback the ability to modify the parameter's value
10086-
typedef struct ur_queue_get_native_handle_params_t {
10087-
ur_queue_handle_t *phQueue;
10088-
ur_queue_native_desc_t **ppDesc;
10089-
ur_native_handle_t **pphNativeQueue;
10090-
} ur_queue_get_native_handle_params_t;
10091-
10092-
///////////////////////////////////////////////////////////////////////////////
10093-
/// @brief Function parameters for urQueueCreateWithNativeHandle
10094-
/// @details Each entry is a pointer to the parameter passed to the function;
10095-
/// allowing the callback the ability to modify the parameter's value
10096-
typedef struct ur_queue_create_with_native_handle_params_t {
10097-
ur_native_handle_t *phNativeQueue;
10098-
ur_context_handle_t *phContext;
10099-
ur_device_handle_t *phDevice;
10100-
const ur_queue_native_properties_t **ppProperties;
10101-
ur_queue_handle_t **pphQueue;
10102-
} ur_queue_create_with_native_handle_params_t;
10103-
10104-
///////////////////////////////////////////////////////////////////////////////
10105-
/// @brief Function parameters for urQueueFinish
10106-
/// @details Each entry is a pointer to the parameter passed to the function;
10107-
/// allowing the callback the ability to modify the parameter's value
10108-
typedef struct ur_queue_finish_params_t {
10109-
ur_queue_handle_t *phQueue;
10110-
} ur_queue_finish_params_t;
10111-
10112-
///////////////////////////////////////////////////////////////////////////////
10113-
/// @brief Function parameters for urQueueFlush
10114-
/// @details Each entry is a pointer to the parameter passed to the function;
10115-
/// allowing the callback the ability to modify the parameter's value
10116-
typedef struct ur_queue_flush_params_t {
10117-
ur_queue_handle_t *phQueue;
10118-
} ur_queue_flush_params_t;
10119-
1012010120
///////////////////////////////////////////////////////////////////////////////
1012110121
/// @brief Function parameters for urBindlessImagesUnsampledImageHandleDestroyExp
1012210122
/// @details Each entry is a pointer to the parameter passed to the function;

include/ur_ddi.h

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,93 @@ typedef ur_result_t(UR_APICALL *ur_pfnGetKernelExpProcAddrTable_t)(
656656
ur_api_version_t,
657657
ur_kernel_exp_dditable_t *);
658658

659+
///////////////////////////////////////////////////////////////////////////////
660+
/// @brief Function-pointer for urQueueGetInfo
661+
typedef ur_result_t(UR_APICALL *ur_pfnQueueGetInfo_t)(
662+
ur_queue_handle_t,
663+
ur_queue_info_t,
664+
size_t,
665+
void *,
666+
size_t *);
667+
668+
///////////////////////////////////////////////////////////////////////////////
669+
/// @brief Function-pointer for urQueueCreate
670+
typedef ur_result_t(UR_APICALL *ur_pfnQueueCreate_t)(
671+
ur_context_handle_t,
672+
ur_device_handle_t,
673+
const ur_queue_properties_t *,
674+
ur_queue_handle_t *);
675+
676+
///////////////////////////////////////////////////////////////////////////////
677+
/// @brief Function-pointer for urQueueRetain
678+
typedef ur_result_t(UR_APICALL *ur_pfnQueueRetain_t)(
679+
ur_queue_handle_t);
680+
681+
///////////////////////////////////////////////////////////////////////////////
682+
/// @brief Function-pointer for urQueueRelease
683+
typedef ur_result_t(UR_APICALL *ur_pfnQueueRelease_t)(
684+
ur_queue_handle_t);
685+
686+
///////////////////////////////////////////////////////////////////////////////
687+
/// @brief Function-pointer for urQueueGetNativeHandle
688+
typedef ur_result_t(UR_APICALL *ur_pfnQueueGetNativeHandle_t)(
689+
ur_queue_handle_t,
690+
ur_queue_native_desc_t *,
691+
ur_native_handle_t *);
692+
693+
///////////////////////////////////////////////////////////////////////////////
694+
/// @brief Function-pointer for urQueueCreateWithNativeHandle
695+
typedef ur_result_t(UR_APICALL *ur_pfnQueueCreateWithNativeHandle_t)(
696+
ur_native_handle_t,
697+
ur_context_handle_t,
698+
ur_device_handle_t,
699+
const ur_queue_native_properties_t *,
700+
ur_queue_handle_t *);
701+
702+
///////////////////////////////////////////////////////////////////////////////
703+
/// @brief Function-pointer for urQueueFinish
704+
typedef ur_result_t(UR_APICALL *ur_pfnQueueFinish_t)(
705+
ur_queue_handle_t);
706+
707+
///////////////////////////////////////////////////////////////////////////////
708+
/// @brief Function-pointer for urQueueFlush
709+
typedef ur_result_t(UR_APICALL *ur_pfnQueueFlush_t)(
710+
ur_queue_handle_t);
711+
712+
///////////////////////////////////////////////////////////////////////////////
713+
/// @brief Table of Queue functions pointers
714+
typedef struct ur_queue_dditable_t {
715+
ur_pfnQueueGetInfo_t pfnGetInfo;
716+
ur_pfnQueueCreate_t pfnCreate;
717+
ur_pfnQueueRetain_t pfnRetain;
718+
ur_pfnQueueRelease_t pfnRelease;
719+
ur_pfnQueueGetNativeHandle_t pfnGetNativeHandle;
720+
ur_pfnQueueCreateWithNativeHandle_t pfnCreateWithNativeHandle;
721+
ur_pfnQueueFinish_t pfnFinish;
722+
ur_pfnQueueFlush_t pfnFlush;
723+
} ur_queue_dditable_t;
724+
725+
///////////////////////////////////////////////////////////////////////////////
726+
/// @brief Exported function for filling application's Queue table
727+
/// with current process' addresses
728+
///
729+
/// @returns
730+
/// - ::UR_RESULT_SUCCESS
731+
/// - ::UR_RESULT_ERROR_UNINITIALIZED
732+
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
733+
/// - ::UR_RESULT_ERROR_UNSUPPORTED_VERSION
734+
UR_DLLEXPORT ur_result_t UR_APICALL
735+
urGetQueueProcAddrTable(
736+
ur_api_version_t version, ///< [in] API version requested
737+
ur_queue_dditable_t *pDdiTable ///< [in,out] pointer to table of DDI function pointers
738+
);
739+
740+
///////////////////////////////////////////////////////////////////////////////
741+
/// @brief Function-pointer for urGetQueueProcAddrTable
742+
typedef ur_result_t(UR_APICALL *ur_pfnGetQueueProcAddrTable_t)(
743+
ur_api_version_t,
744+
ur_queue_dditable_t *);
745+
659746
///////////////////////////////////////////////////////////////////////////////
660747
/// @brief Function-pointer for urSamplerCreate
661748
typedef ur_result_t(UR_APICALL *ur_pfnSamplerCreate_t)(
@@ -1376,93 +1463,6 @@ typedef ur_result_t(UR_APICALL *ur_pfnGetEnqueueExpProcAddrTable_t)(
13761463
ur_api_version_t,
13771464
ur_enqueue_exp_dditable_t *);
13781465

1379-
///////////////////////////////////////////////////////////////////////////////
1380-
/// @brief Function-pointer for urQueueGetInfo
1381-
typedef ur_result_t(UR_APICALL *ur_pfnQueueGetInfo_t)(
1382-
ur_queue_handle_t,
1383-
ur_queue_info_t,
1384-
size_t,
1385-
void *,
1386-
size_t *);
1387-
1388-
///////////////////////////////////////////////////////////////////////////////
1389-
/// @brief Function-pointer for urQueueCreate
1390-
typedef ur_result_t(UR_APICALL *ur_pfnQueueCreate_t)(
1391-
ur_context_handle_t,
1392-
ur_device_handle_t,
1393-
const ur_queue_properties_t *,
1394-
ur_queue_handle_t *);
1395-
1396-
///////////////////////////////////////////////////////////////////////////////
1397-
/// @brief Function-pointer for urQueueRetain
1398-
typedef ur_result_t(UR_APICALL *ur_pfnQueueRetain_t)(
1399-
ur_queue_handle_t);
1400-
1401-
///////////////////////////////////////////////////////////////////////////////
1402-
/// @brief Function-pointer for urQueueRelease
1403-
typedef ur_result_t(UR_APICALL *ur_pfnQueueRelease_t)(
1404-
ur_queue_handle_t);
1405-
1406-
///////////////////////////////////////////////////////////////////////////////
1407-
/// @brief Function-pointer for urQueueGetNativeHandle
1408-
typedef ur_result_t(UR_APICALL *ur_pfnQueueGetNativeHandle_t)(
1409-
ur_queue_handle_t,
1410-
ur_queue_native_desc_t *,
1411-
ur_native_handle_t *);
1412-
1413-
///////////////////////////////////////////////////////////////////////////////
1414-
/// @brief Function-pointer for urQueueCreateWithNativeHandle
1415-
typedef ur_result_t(UR_APICALL *ur_pfnQueueCreateWithNativeHandle_t)(
1416-
ur_native_handle_t,
1417-
ur_context_handle_t,
1418-
ur_device_handle_t,
1419-
const ur_queue_native_properties_t *,
1420-
ur_queue_handle_t *);
1421-
1422-
///////////////////////////////////////////////////////////////////////////////
1423-
/// @brief Function-pointer for urQueueFinish
1424-
typedef ur_result_t(UR_APICALL *ur_pfnQueueFinish_t)(
1425-
ur_queue_handle_t);
1426-
1427-
///////////////////////////////////////////////////////////////////////////////
1428-
/// @brief Function-pointer for urQueueFlush
1429-
typedef ur_result_t(UR_APICALL *ur_pfnQueueFlush_t)(
1430-
ur_queue_handle_t);
1431-
1432-
///////////////////////////////////////////////////////////////////////////////
1433-
/// @brief Table of Queue functions pointers
1434-
typedef struct ur_queue_dditable_t {
1435-
ur_pfnQueueGetInfo_t pfnGetInfo;
1436-
ur_pfnQueueCreate_t pfnCreate;
1437-
ur_pfnQueueRetain_t pfnRetain;
1438-
ur_pfnQueueRelease_t pfnRelease;
1439-
ur_pfnQueueGetNativeHandle_t pfnGetNativeHandle;
1440-
ur_pfnQueueCreateWithNativeHandle_t pfnCreateWithNativeHandle;
1441-
ur_pfnQueueFinish_t pfnFinish;
1442-
ur_pfnQueueFlush_t pfnFlush;
1443-
} ur_queue_dditable_t;
1444-
1445-
///////////////////////////////////////////////////////////////////////////////
1446-
/// @brief Exported function for filling application's Queue table
1447-
/// with current process' addresses
1448-
///
1449-
/// @returns
1450-
/// - ::UR_RESULT_SUCCESS
1451-
/// - ::UR_RESULT_ERROR_UNINITIALIZED
1452-
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
1453-
/// - ::UR_RESULT_ERROR_UNSUPPORTED_VERSION
1454-
UR_DLLEXPORT ur_result_t UR_APICALL
1455-
urGetQueueProcAddrTable(
1456-
ur_api_version_t version, ///< [in] API version requested
1457-
ur_queue_dditable_t *pDdiTable ///< [in,out] pointer to table of DDI function pointers
1458-
);
1459-
1460-
///////////////////////////////////////////////////////////////////////////////
1461-
/// @brief Function-pointer for urGetQueueProcAddrTable
1462-
typedef ur_result_t(UR_APICALL *ur_pfnGetQueueProcAddrTable_t)(
1463-
ur_api_version_t,
1464-
ur_queue_dditable_t *);
1465-
14661466
///////////////////////////////////////////////////////////////////////////////
14671467
/// @brief Function-pointer for urBindlessImagesUnsampledImageHandleDestroyExp
14681468
typedef ur_result_t(UR_APICALL *ur_pfnBindlessImagesUnsampledImageHandleDestroyExp_t)(
@@ -2310,13 +2310,13 @@ typedef struct ur_dditable_t {
23102310
ur_program_exp_dditable_t ProgramExp;
23112311
ur_kernel_dditable_t Kernel;
23122312
ur_kernel_exp_dditable_t KernelExp;
2313+
ur_queue_dditable_t Queue;
23132314
ur_sampler_dditable_t Sampler;
23142315
ur_mem_dditable_t Mem;
23152316
ur_physical_mem_dditable_t PhysicalMem;
23162317
ur_global_dditable_t Global;
23172318
ur_enqueue_dditable_t Enqueue;
23182319
ur_enqueue_exp_dditable_t EnqueueExp;
2319-
ur_queue_dditable_t Queue;
23202320
ur_bindless_images_exp_dditable_t BindlessImagesExp;
23212321
ur_usm_dditable_t USM;
23222322
ur_usm_exp_dditable_t USMExp;

0 commit comments

Comments
 (0)