.. index:: pair: group; USM Interface .. _doxid-df/d6e/group___u_s_m_interface: USM Interface ============= .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block // global functions :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` :ref:`DPCTLaligned_alloc_device`( size_t alignment, size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` :ref:`DPCTLaligned_alloc_host`( size_t alignment, size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` :ref:`DPCTLaligned_alloc_shared`( size_t alignment, size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` void :ref:`DPCTLfree_with_context`( :ref:`__dpctl_take` :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` CRef ); :ref:`DPCTL_API` void :ref:`DPCTLfree_with_queue`( :ref:`__dpctl_take` :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` :ref:`DPCTLmalloc_device`( size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` :ref:`DPCTLmalloc_host`( size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` :ref:`DPCTLmalloc_shared`( size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ); :ref:`DPCTL_API` :ref:`DPCTLSyclDeviceRef` :ref:`DPCTLUSM_GetPointerDevice`( :ref:`__dpctl_keep` const :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` CRef ); :ref:`DPCTL_API` :ref:`DPCTLSyclUSMType` :ref:`DPCTLUSM_GetPointerType`( :ref:`__dpctl_keep` const :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` CRef ); .. _details-df/d6e/group___u_s_m_interface: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; DPCTLaligned_alloc_device .. _doxid-df/d6e/group___u_s_m_interface_1ga40c3e68d157d775bbe6daa188b84b3e3: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` DPCTLaligned_alloc_device( size_t alignment, size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Create USM device memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - alignment - Allocation's byte alignment * - size - Number of bytes to allocate * - QRef - Sycl queue reference to use in allocation .. rubric:: Returns: The pointer to USM device memory with requested alignment. On failure, returns nullptr. .. index:: pair: function; DPCTLaligned_alloc_host .. _doxid-df/d6e/group___u_s_m_interface_1ga327bba1e6a5a1f6922e74ab6914e58ff: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` DPCTLaligned_alloc_host( size_t alignment, size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Create USM host memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - alignment - Allocation's byte alignment * - size - Number of bytes to allocate * - QRef - Sycl queue reference to use in allocation .. rubric:: Returns: The pointer to USM host memory with the requested alignment. On failure, returns nullptr. .. index:: pair: function; DPCTLaligned_alloc_shared .. _doxid-df/d6e/group___u_s_m_interface_1ga7c3e58848a979723dc350d2a8016edd8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` DPCTLaligned_alloc_shared( size_t alignment, size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Create USM shared memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - alignment - Allocation's byte alignment * - size - Number of bytes to allocate * - QRef - Sycl queue reference to use in allocation .. rubric:: Returns: The pointer to USM shared memory with the requested alignment. On failure, returns nullptr. .. index:: pair: function; DPCTLfree_with_context .. _doxid-df/d6e/group___u_s_m_interface_1gad1da9c1cb7fca0b3c1bc0edc9467c0a9: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` void DPCTLfree_with_context( :ref:`__dpctl_take` :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` CRef ) Free USM memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - MRef - USM pointer to free * - CRef - Sycl context reference to use. .. index:: pair: function; DPCTLfree_with_queue .. _doxid-df/d6e/group___u_s_m_interface_1ga0d8486b09ea0a677a3fb6cbe677f8633: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` void DPCTLfree_with_queue( :ref:`__dpctl_take` :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Free USM memory. USM pointer must have been allocated using the same context as the one used to construct the queue. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - MRef - USM pointer to free * - QRef - Sycl queue reference to use. .. index:: pair: function; DPCTLmalloc_device .. _doxid-df/d6e/group___u_s_m_interface_1gac1927ffcb3ca7ef43366a8b64e211ef2: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` DPCTLmalloc_device( size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Create USM device memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - size - Number of bytes to allocate * - QRef - Sycl queue reference to use in allocation .. rubric:: Returns: The pointer to USM device memory. On failure, returns nullptr. .. index:: pair: function; DPCTLmalloc_host .. _doxid-df/d6e/group___u_s_m_interface_1ga699b56970ac78f3b3ca87a2ad6ff4615: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` DPCTLmalloc_host( size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Create USM host memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - size - Number of bytes to allocate * - QRef - Sycl queue reference to use in allocation .. rubric:: Returns: The pointer to USM host memory. On failure, returns nullptr. .. index:: pair: function; DPCTLmalloc_shared .. _doxid-df/d6e/group___u_s_m_interface_1ga7c9316842db74f4730fab04a4e4f4eb5: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`__dpctl_give` :ref:`DPCTLSyclUSMRef` DPCTLmalloc_shared( size_t size, :ref:`__dpctl_keep` const :ref:`DPCTLSyclQueueRef` QRef ) Create USM shared memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - size - Number of bytes to allocate * - QRef - Sycl queue reference to use in allocation .. rubric:: Returns: The pointer to USM shared memory. On failure, returns nullptr. .. index:: pair: function; DPCTLUSM_GetPointerDevice .. _doxid-df/d6e/group___u_s_m_interface_1ga7ebb5012408e40e3e78b4da551da8412: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`DPCTLSyclDeviceRef` DPCTLUSM_GetPointerDevice( :ref:`__dpctl_keep` const :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` CRef ) Get the device associated with USM pointer. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - MRef - USM pointer * - CRef - Sycl context reference associated with the pointer .. rubric:: Returns: A DPCTLSyclDeviceRef pointer to the sycl device. .. index:: pair: function; DPCTLUSM_GetPointerType .. _doxid-df/d6e/group___u_s_m_interface_1ga8cdbaff72515ca1f9caa745cf342f5cc: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DPCTL_API` :ref:`DPCTLSyclUSMType` DPCTLUSM_GetPointerType( :ref:`__dpctl_keep` const :ref:`DPCTLSyclUSMRef` MRef, :ref:`__dpctl_keep` const :ref:`DPCTLSyclContextRef` CRef ) Returns the USM allocator type for a pointer. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - MRef - USM allocated pointer * - CRef - Sycl context reference associated with the pointer .. rubric:: Returns: DPCTLSyclUSMType enum value indicating if the pointer is of USM type "shared", "host", or "device".