Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oneMKL] dft::descriptor copy and move (#487) #490

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion source/elements/oneMKL/source/domains/dft/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ The descriptor class lives in the ``oneapi::mkl::dft`` namespace.

// Syntax for d-dimensional DFT
descriptor(std::vector<std::int64_t> dimensions);


descriptor(const descriptor&);

descriptor(descriptor&&);

descriptor& operator=(const descriptor&);

descriptor& operator=(descriptor&&);

~descriptor();


Expand Down Expand Up @@ -78,6 +86,8 @@ The descriptor class lives in the ``oneapi::mkl::dft`` namespace.
- Description
* - :ref:`constructors<onemkl_dft_descriptor_constructor>`
- Initialize descriptor for 1-dimensional or N-dimensional transformations
* - :ref:`assignment operators<onemkl_dft_descriptor_assignment_operator>`
- Assignment operator.
* - :ref:`onemkl_dft_descriptor_set_value`
- Sets one particular configuration parameter with the specified configuration value.
* - :ref:`onemkl_dft_descriptor_get_value`
Expand All @@ -104,6 +114,8 @@ factors. The function :ref:`onemkl_dft_descriptor_commit` does this work
after use of the function :ref:`onemkl_dft_descriptor_set_value` to set values
of all necessary parameters.

The copy constructor performs a deep copy of the descriptor.

.. rubric:: Syntax (one-dimensional transform)

.. code-block:: cpp
Expand All @@ -127,6 +139,28 @@ of all necessary parameters.

}

.. rubric:: Copy constructor

.. code-block:: cpp

namespace oneapi::mkl::dft {

template <oneapi::mkl::dft::precision prec, oneapi::mkl::dft::domain dom>
descriptor<prec,dom>(const descriptor<prec,dom>& other);

}

.. rubric:: Move constructor

.. code-block:: cpp

namespace oneapi::mkl::dft {

template <oneapi::mkl::dft::precision prec, oneapi::mkl::dft::domain dom>
descriptor<prec,dom>(descriptor<prec,dom>&& other);

}


.. container:: section

Expand All @@ -138,6 +172,9 @@ of all necessary parameters.
dimensions
vector of :math:`d\geq 0` dimensions(lengths) of data for a d-dimensional transform.

other
another descriptor of the same type to copy or move

.. container:: section

.. rubric:: Throws
Expand All @@ -154,6 +191,54 @@ of all necessary parameters.
**Descriptor class member table:** :ref:`onemkl_dft_descriptor_member_table`


.. _onemkl_dft_descriptor_assignment_operator:

Descriptor class assignment operators
+++++++++++++++++++++++++++++++++++++

The copy assignment operator results in a deep copy.

.. rubric:: Copy assignment

.. code-block:: cpp

namespace oneapi::mkl::dft {

template <oneapi::mkl::dft::precision prec, oneapi::mkl::dft::domain dom>
descriptor<prec,dom>& descriptor<prec,dom>::operator=(const descriptor<prec,dom>& other);

}

.. rubric:: Move assignment

.. code-block:: cpp

namespace oneapi::mkl::dft {

template <oneapi::mkl::dft::precision prec, oneapi::mkl::dft::domain dom>
descriptor<prec,dom>& descriptor<prec,dom>::operator=(descriptor<prec,dom>&& other);

}


.. container:: section

.. rubric:: Input Parameters

other
The descriptor to copy or move from.

.. container:: section

.. rubric:: Throws

The assignment opererator shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here:

:ref:`oneapi::mkl::host_bad_alloc()<onemkl_exception_host_bad_alloc>`
If any memory allocations on host have failed, for instance due to insufficient memory.


**Descriptor class member table:** :ref:`onemkl_dft_descriptor_member_table`

.. _onemkl_dft_descriptor_set_value:

Expand Down