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

Make matxHalf trivially copyable #513

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
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
22 changes: 7 additions & 15 deletions include/matx/core/half.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,17 @@ template <typename T> struct alignas(sizeof(T)) matxHalf {
using value_type = T; ///< Type of half

/**
* @brief Initialize to zero
* @brief Default constructor
*
*/
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf() : x(0.0f) {}
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf() = default;

/**
* @brief Copy constructor
* @brief Default copy constructor
*
* @param x_ Parameter to copy
*/
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf(const matxHalf<T> &x_) noexcept
: x(x_.x)
{
}
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf(const matxHalf<T> &x_) noexcept = default;

/**
* @brief Copy constructor from arbitrary type
Expand All @@ -79,7 +76,7 @@ template <typename T> struct alignas(sizeof(T)) matxHalf {
}

/**
* @brief Default desctructor
* @brief Default destructor
*
*/
__MATX_INLINE__ ~matxHalf() = default;
Expand Down Expand Up @@ -115,16 +112,11 @@ template <typename T> struct alignas(sizeof(T)) matxHalf {
}

/**
* @brief Copy assignment operator
* @brief Default copy assignment operator
*
* @param rhs Value to copy
*/
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf<T> &
operator=(const matxHalf<T> &rhs)
{
x = rhs.x;
return *this;
}
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalf<T> &operator=(const matxHalf<T> &rhs) = default;

/**
* @brief Copy assignment operator
Expand Down
4 changes: 2 additions & 2 deletions include/matx/core/half_complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ template <typename T> struct alignas(sizeof(T) * 2) matxHalfComplex {
using value_type = T; ///< Type trait to get type

/**
* @brief Constructor a half complex object with defaults of zero
* @brief Default constructor
*
*/
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalfComplex() : x(0.0f), y(0.0f) {}
__MATX_HOST__ __MATX_DEVICE__ __MATX_INLINE__ matxHalfComplex() = default;

/**
* @brief Copy constructor from a complex float
Expand Down