@@ -196,6 +196,11 @@ typedef enum ur_function_t {
196
196
UR_FUNCTION_COMMAND_BUFFER_APPEND_MEMBUFFER_READ_EXP = 169, ///< Enumerator for ::urCommandBufferAppendMembufferReadExp
197
197
UR_FUNCTION_COMMAND_BUFFER_APPEND_MEMBUFFER_WRITE_RECT_EXP = 170, ///< Enumerator for ::urCommandBufferAppendMembufferWriteRectExp
198
198
UR_FUNCTION_COMMAND_BUFFER_APPEND_MEMBUFFER_READ_RECT_EXP = 171, ///< Enumerator for ::urCommandBufferAppendMembufferReadRectExp
199
+ UR_FUNCTION_LOADER_CONFIG_CREATE = 172, ///< Enumerator for ::urLoaderConfigCreate
200
+ UR_FUNCTION_LOADER_CONFIG_RELEASE = 173, ///< Enumerator for ::urLoaderConfigRelease
201
+ UR_FUNCTION_LOADER_CONFIG_RETAIN = 174, ///< Enumerator for ::urLoaderConfigRetain
202
+ UR_FUNCTION_LOADER_CONFIG_GET_INFO = 175, ///< Enumerator for ::urLoaderConfigGetInfo
203
+ UR_FUNCTION_LOADER_CONFIG_ENABLE_LAYER = 176, ///< Enumerator for ::urLoaderConfigEnableLayer
199
204
/// @cond
200
205
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
201
206
/// @endcond
@@ -318,6 +323,10 @@ typedef enum ur_structure_type_t {
318
323
/// @brief compiler-independent type
319
324
typedef uint8_t ur_bool_t;
320
325
326
+ ///////////////////////////////////////////////////////////////////////////////
327
+ /// @brief Handle of a loader config object
328
+ typedef struct ur_loader_config_handle_t_ *ur_loader_config_handle_t;
329
+
321
330
///////////////////////////////////////////////////////////////////////////////
322
331
/// @brief Handle of a platform instance
323
332
typedef struct ur_platform_handle_t_ *ur_platform_handle_t;
@@ -450,6 +459,7 @@ typedef enum ur_result_t {
450
459
UR_RESULT_ERROR_OBJECT_ALLOCATION_FAILURE = 66, ///< Objection allocation failure
451
460
UR_RESULT_ERROR_ADAPTER_SPECIFIC = 67, ///< An adapter specific warning/error has been reported and can be
452
461
///< retrieved via the urPlatformGetLastError entry point.
462
+ UR_RESULT_ERROR_LAYER_NOT_PRESENT = 68, ///< A requested layer was not found by the loader.
453
463
UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP = 0x1000, ///< Invalid Command-Buffer
454
464
UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP = 0x1001, ///< Sync point is not valid for the command-buffer
455
465
UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP = 0x1002, ///< Sync point wait list is invalid
@@ -518,6 +528,137 @@ typedef enum ur_device_init_flag_t {
518
528
/// @brief Bit Mask for validating ur_device_init_flags_t
519
529
#define UR_DEVICE_INIT_FLAGS_MASK 0xffffffe0
520
530
531
+ ///////////////////////////////////////////////////////////////////////////////
532
+ /// @brief Create a loader config object.
533
+ ///
534
+ /// @returns
535
+ /// - ::UR_RESULT_SUCCESS
536
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
537
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
538
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
539
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
540
+ /// + `NULL == phLoaderConfig`
541
+ UR_APIEXPORT ur_result_t UR_APICALL
542
+ urLoaderConfigCreate(
543
+ ur_loader_config_handle_t *phLoaderConfig ///< [out] Pointer to handle of loader config object created.
544
+ );
545
+
546
+ ///////////////////////////////////////////////////////////////////////////////
547
+ /// @brief Get a reference to the loader config object.
548
+ ///
549
+ /// @details
550
+ /// - Get a reference to the loader config handle. Increment its reference
551
+ /// count
552
+ /// - The application may call this function from simultaneous threads.
553
+ /// - The implementation of this function should be lock-free.
554
+ ///
555
+ /// @returns
556
+ /// - ::UR_RESULT_SUCCESS
557
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
558
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
559
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
560
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
561
+ /// + `NULL == hLoaderConfig`
562
+ UR_APIEXPORT ur_result_t UR_APICALL
563
+ urLoaderConfigRetain(
564
+ ur_loader_config_handle_t hLoaderConfig ///< [in] loader config handle to retain
565
+ );
566
+
567
+ ///////////////////////////////////////////////////////////////////////////////
568
+ /// @brief Release config handle.
569
+ ///
570
+ /// @details
571
+ /// - Decrement reference count and destroy the config handle if reference
572
+ /// count becomes zero.
573
+ /// - The application may call this function from simultaneous threads.
574
+ /// - The implementation of this function should be lock-free.
575
+ ///
576
+ /// @returns
577
+ /// - ::UR_RESULT_SUCCESS
578
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
579
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
580
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
581
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
582
+ /// + `NULL == hLoaderConfig`
583
+ UR_APIEXPORT ur_result_t UR_APICALL
584
+ urLoaderConfigRelease(
585
+ ur_loader_config_handle_t hLoaderConfig ///< [in] config handle to release
586
+ );
587
+
588
+ ///////////////////////////////////////////////////////////////////////////////
589
+ /// @brief Supported loader info
590
+ typedef enum ur_loader_config_info_t {
591
+ UR_LOADER_CONFIG_INFO_AVAILABLE_LAYERS = 0, ///< [char[]] Null-terminated, semi-colon separated list of available
592
+ ///< layers.
593
+ UR_LOADER_CONFIG_INFO_REFERENCE_COUNT = 1, ///< [uint32_t] Reference count of the loader config object.
594
+ /// @cond
595
+ UR_LOADER_CONFIG_INFO_FORCE_UINT32 = 0x7fffffff
596
+ /// @endcond
597
+
598
+ } ur_loader_config_info_t;
599
+
600
+ ///////////////////////////////////////////////////////////////////////////////
601
+ /// @brief Retrieves various information about the loader.
602
+ ///
603
+ /// @details
604
+ /// - The application may call this function from simultaneous threads.
605
+ /// - The implementation of this function should be lock-free.
606
+ ///
607
+ /// @returns
608
+ /// - ::UR_RESULT_SUCCESS
609
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
610
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
611
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
612
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
613
+ /// + `NULL == hLoaderConfig`
614
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
615
+ /// + `::UR_LOADER_CONFIG_INFO_REFERENCE_COUNT < propName`
616
+ /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION
617
+ /// + If `propName` is not supported by the loader.
618
+ /// - ::UR_RESULT_ERROR_INVALID_SIZE
619
+ /// + `propSize == 0 && pPropValue != NULL`
620
+ /// + If `propSize` is less than the real number of bytes needed to return the info.
621
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
622
+ /// + `propSize != 0 && pPropValue == NULL`
623
+ /// + `pPropValue == NULL && pPropSizeRet == NULL`
624
+ /// - ::UR_RESULT_ERROR_INVALID_DEVICE
625
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
626
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
627
+ UR_APIEXPORT ur_result_t UR_APICALL
628
+ urLoaderConfigGetInfo(
629
+ ur_loader_config_handle_t hLoaderConfig, ///< [in] handle of the loader config object
630
+ ur_loader_config_info_t propName, ///< [in] type of the info to retrieve
631
+ size_t propSize, ///< [in] the number of bytes pointed to by pPropValue.
632
+ void *pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding
633
+ ///< the info.
634
+ ///< If propSize is not equal to or greater than the real number of bytes
635
+ ///< needed to return the info
636
+ ///< then the ::UR_RESULT_ERROR_INVALID_SIZE error is returned and
637
+ ///< pPropValue is not used.
638
+ size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName.
639
+ );
640
+
641
+ ///////////////////////////////////////////////////////////////////////////////
642
+ /// @brief Enable a layer for the specified loader config.
643
+ ///
644
+ /// @returns
645
+ /// - ::UR_RESULT_SUCCESS
646
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
647
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
648
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
649
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
650
+ /// + `NULL == hLoaderConfig`
651
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
652
+ /// + `NULL == pLayerName`
653
+ /// - ::UR_RESULT_ERROR_LAYER_NOT_PRESENT
654
+ /// + If layer specified with `pLayerName` can't be found by the loader.
655
+ UR_APIEXPORT ur_result_t UR_APICALL
656
+ urLoaderConfigEnableLayer(
657
+ ur_loader_config_handle_t hLoaderConfig, ///< [in] Handle to config object the layer will be enabled for.
658
+ const char *pLayerName ///< [in] Null terminated string containing the name of the layer to
659
+ ///< enable.
660
+ );
661
+
521
662
///////////////////////////////////////////////////////////////////////////////
522
663
/// @brief Initialize the 'oneAPI' adapter(s)
523
664
///
@@ -545,8 +686,9 @@ typedef enum ur_device_init_flag_t {
545
686
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
546
687
UR_APIEXPORT ur_result_t UR_APICALL
547
688
urInit(
548
- ur_device_init_flags_t device_flags ///< [in] device initialization flags.
549
- ///< must be 0 (default) or a combination of ::ur_device_init_flag_t.
689
+ ur_device_init_flags_t device_flags, ///< [in] device initialization flags.
690
+ ///< must be 0 (default) or a combination of ::ur_device_init_flag_t.
691
+ ur_loader_config_handle_t hLoaderConfig ///< [in][optional] Handle of loader config handle.
550
692
);
551
693
552
694
///////////////////////////////////////////////////////////////////////////////
@@ -7901,6 +8043,51 @@ urUsmP2PPeerAccessGetInfoExp(
7901
8043
#if !defined(__GNUC__)
7902
8044
#pragma region callbacks
7903
8045
#endif
8046
+ ///////////////////////////////////////////////////////////////////////////////
8047
+ /// @brief Function parameters for urLoaderConfigCreate
8048
+ /// @details Each entry is a pointer to the parameter passed to the function;
8049
+ /// allowing the callback the ability to modify the parameter's value
8050
+ typedef struct ur_loader_config_create_params_t {
8051
+ ur_loader_config_handle_t **pphLoaderConfig;
8052
+ } ur_loader_config_create_params_t;
8053
+
8054
+ ///////////////////////////////////////////////////////////////////////////////
8055
+ /// @brief Function parameters for urLoaderConfigRetain
8056
+ /// @details Each entry is a pointer to the parameter passed to the function;
8057
+ /// allowing the callback the ability to modify the parameter's value
8058
+ typedef struct ur_loader_config_retain_params_t {
8059
+ ur_loader_config_handle_t *phLoaderConfig;
8060
+ } ur_loader_config_retain_params_t;
8061
+
8062
+ ///////////////////////////////////////////////////////////////////////////////
8063
+ /// @brief Function parameters for urLoaderConfigRelease
8064
+ /// @details Each entry is a pointer to the parameter passed to the function;
8065
+ /// allowing the callback the ability to modify the parameter's value
8066
+ typedef struct ur_loader_config_release_params_t {
8067
+ ur_loader_config_handle_t *phLoaderConfig;
8068
+ } ur_loader_config_release_params_t;
8069
+
8070
+ ///////////////////////////////////////////////////////////////////////////////
8071
+ /// @brief Function parameters for urLoaderConfigGetInfo
8072
+ /// @details Each entry is a pointer to the parameter passed to the function;
8073
+ /// allowing the callback the ability to modify the parameter's value
8074
+ typedef struct ur_loader_config_get_info_params_t {
8075
+ ur_loader_config_handle_t *phLoaderConfig;
8076
+ ur_loader_config_info_t *ppropName;
8077
+ size_t *ppropSize;
8078
+ void **ppPropValue;
8079
+ size_t **ppPropSizeRet;
8080
+ } ur_loader_config_get_info_params_t;
8081
+
8082
+ ///////////////////////////////////////////////////////////////////////////////
8083
+ /// @brief Function parameters for urLoaderConfigEnableLayer
8084
+ /// @details Each entry is a pointer to the parameter passed to the function;
8085
+ /// allowing the callback the ability to modify the parameter's value
8086
+ typedef struct ur_loader_config_enable_layer_params_t {
8087
+ ur_loader_config_handle_t *phLoaderConfig;
8088
+ const char **ppLayerName;
8089
+ } ur_loader_config_enable_layer_params_t;
8090
+
7904
8091
///////////////////////////////////////////////////////////////////////////////
7905
8092
/// @brief Function parameters for urPlatformGet
7906
8093
/// @details Each entry is a pointer to the parameter passed to the function;
@@ -9656,6 +9843,7 @@ typedef struct ur_usm_p2p_peer_access_get_info_exp_params_t {
9656
9843
/// allowing the callback the ability to modify the parameter's value
9657
9844
typedef struct ur_init_params_t {
9658
9845
ur_device_init_flags_t *pdevice_flags;
9846
+ ur_loader_config_handle_t *phLoaderConfig;
9659
9847
} ur_init_params_t;
9660
9848
9661
9849
///////////////////////////////////////////////////////////////////////////////
0 commit comments