.. index:: pair: group; Platform class helper functions .. _doxid-d5/dcf/group___platform_manager: Platform class helper functions =============================== .. toctree:: :hidden: Overview ~~~~~~~~ Helper functions for ``sycl::platform`` objects that do not directly map to any ``sycl::platform`` member function. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef struct DPCTLPlatformVector* :target:`DPCTLPlatformVectorRef`; // global functions DPCTL_API const __dpctl_give char* :ref:`DPCTLPlatformMgr_GetInfo`( __dpctl_keep const :ref:`DPCTLSyclPlatformRef` PRef, size_t verbosity ); DPCTL_API void :ref:`DPCTLPlatformMgr_PrintInfo`( __dpctl_keep const :ref:`DPCTLSyclPlatformRef` PRef, size_t verbosity ); DPCTL_API void :ref:`DPCTLPlatformVector_Clear`(__dpctl_keep :ref:`DPCTLPlatformVectorRef` VRef); __dpctl_give :ref:`DPCTLPlatformVectorRef` :ref:`DPCTLPlatformVector_Create`(void); DPCTL_API __dpctl_give :ref:`DPCTLPlatformVectorRef` :ref:`DPCTLPlatformVector_CreateFromArray`( size_t len, __dpctl_keep :ref:`DPCTLSyclPlatformRef`* elems ); DPCTL_API void :ref:`DPCTLPlatformVector_Delete`(__dpctl_take :ref:`DPCTLPlatformVectorRef` VRef); DPCTL_API __dpctl_give :ref:`DPCTLSyclPlatformRef` :ref:`DPCTLPlatformVector_GetAt`( __dpctl_keep :ref:`DPCTLPlatformVectorRef` VRef, size_t index ); DPCTL_API size_t :ref:`DPCTLPlatformVector_Size`(__dpctl_keep :ref:`DPCTLPlatformVectorRef` VRef); .. _details-d5/dcf/group___platform_manager: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Helper functions for ``sycl::platform`` objects that do not directly map to any ``sycl::platform`` member function. Global Functions ---------------- .. index:: pair: function; DPCTLPlatformMgr_GetInfo .. _doxid-d5/dcf/group___platform_manager_1ga90ff5c2df9bd5a56d4f539e073f091f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API const __dpctl_give char* DPCTLPlatformMgr_GetInfo( __dpctl_keep const :ref:`DPCTLSyclPlatformRef` PRef, size_t verbosity ) Returns a set of platform info attributes as a string. The helper function is used to get metadata about a given platform. The amount of information received is controlled by the verbosity level. Verbosity level 0: Returns only the name of the platform. Verbosity level 1: Returns the name, version, vendor, backend, number of devices in the platform. Verbosity level 2: Returns everything in level 1 and also returns the name, version, and filter string for each device in the platform. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - PRef - A :ref:`DPCTLSyclPlatformRef ` opaque pointer. * - verbosity - Verbosilty level to control how much information is printed out. .. rubric:: Returns: A formatted C string capturing the information about the sycl::platform argument. .. index:: pair: function; DPCTLPlatformMgr_PrintInfo .. _doxid-d5/dcf/group___platform_manager_1ga8e44adac75e0ecf8705b089404a8fb86: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API void DPCTLPlatformMgr_PrintInfo( __dpctl_keep const :ref:`DPCTLSyclPlatformRef` PRef, size_t verbosity ) Prints out information about the sycl::platform argument. The helper function is used to print metadata about a given platform. The amount of information printed out is controlled by the verbosity level. Verbosity level 0: Prints only the name of the platform. Verbosity level 1: Prints the name, version, vendor, backend, number of devices in the platform. Verbosity level 2: Prints everything in level 1 and also prints the name, version, and filter string for each device in the platform. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - PRef - A :ref:`DPCTLSyclPlatformRef ` opaque pointer. * - verbosity - Verbosilty level to control how much information is printed out. .. index:: pair: function; DPCTLPlatformVector_Clear .. _doxid-d5/dcf/group___platform_manager_1ga89b9b23802931f2354d8acb91f72ba6c: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API void DPCTLPlatformVector_Clear(__dpctl_keep :ref:`DPCTLPlatformVectorRef` VRef) Delete all the elements of the std::vector. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - VRef - Opaque pointer to a vector. .. index:: pair: function; DPCTLPlatformVector_Create .. _doxid-d5/dcf/group___platform_manager_1ga9d5773827c527bc445bf60ffbf6a6e60: .. ref-code-block:: cpp :class: doxyrest-title-code-block __dpctl_give :ref:`DPCTLPlatformVectorRef` DPCTLPlatformVector_Create(void) Create an opaque pointer to a std::vector of opaque pointers wrapping the SYCL data type. .. rubric:: Returns: Returns a new opaque pointer to a vector. .. index:: pair: function; DPCTLPlatformVector_CreateFromArray .. _doxid-d5/dcf/group___platform_manager_1gac4e4722d083773b839113fb32cca632c: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API __dpctl_give :ref:`DPCTLPlatformVectorRef` DPCTLPlatformVector_CreateFromArray( size_t len, __dpctl_keep :ref:`DPCTLSyclPlatformRef`* elems ) Create an opaque pointer to a std::vector created from the input raw array. The elements of the input array are deep copied before inserting the copies into the vector. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - len - Number of elements in the input array. * - elems - A C array whose elements will be copied into the returned vector. .. rubric:: Returns: Returns a new opaque pointer to a vector. .. index:: pair: function; DPCTLPlatformVector_Delete .. _doxid-d5/dcf/group___platform_manager_1gaef25f3448c038f7a8ac3dd99a3d69249: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API void DPCTLPlatformVector_Delete(__dpctl_take :ref:`DPCTLPlatformVectorRef` VRef) Delete all elements in the vector and then delete the vector. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - VRef - Opaque pointer to a vector to be deleted. .. index:: pair: function; DPCTLPlatformVector_GetAt .. _doxid-d5/dcf/group___platform_manager_1ga131427438ea4f1cbca1fe4c93e11e21a: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API __dpctl_give :ref:`DPCTLSyclPlatformRef` DPCTLPlatformVector_GetAt( __dpctl_keep :ref:`DPCTLPlatformVectorRef` VRef, size_t index ) Returns the element at the specified index. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - VRef - Opaque pointer to a vector. * - index - The index position of the element to be returned. .. rubric:: Returns: The element at the specified position, if the index position is out of bounds then a nullptr is returned. .. index:: pair: function; DPCTLPlatformVector_Size .. _doxid-d5/dcf/group___platform_manager_1ga713c99c0d385de070ae32d4d7657401e: .. ref-code-block:: cpp :class: doxyrest-title-code-block DPCTL_API size_t DPCTLPlatformVector_Size(__dpctl_keep :ref:`DPCTLPlatformVectorRef` VRef) Returns the number of elements in the vector. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - VRef - Opaque pointer to a vector. .. rubric:: Returns: The current size of the vector.