From ff1f4e39fa8d0ee643dfeadedb9d0f7a1b30730a Mon Sep 17 00:00:00 2001 From: Jefferson Le Quellec Date: Wed, 21 Feb 2024 16:49:07 +0100 Subject: [PATCH 1/6] Apply clang-format on inline code --- .../sycl_ext_oneapi_complex.asciidoc | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc index e4eb444f1ed60..1ee93140c011f 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc @@ -257,10 +257,10 @@ public: friend marray &operator %=(value_type &lhs, const marray &rhs) = delete; friend marray operator ++(marray &lhs, int) = delete; - friend marray &operator ++(marray & rhs) = delete; + friend marray &operator ++(marray &lhs) = delete; friend marray operator --(marray &lhs, int) = delete; - friend marray &operator --(marray & rhs) = delete; + friend marray &operator --(marray &lhs) = delete; friend marray operator &(const marray &lhs, const marray &rhs) = delete; friend marray operator &(const marray &lhs, const value_type &rhs) = delete; @@ -271,51 +271,51 @@ public: friend marray operator ^(const marray &lhs, const marray &rhs) = delete; friend marray operator ^(const marray &lhs, const value_type &rhs) = delete; - friend marray &operator &=(marray & lhs, const marray & rhs) = delete; - friend marray &operator &=(marray & lhs, const value_type & rhs) = delete; - friend marray &operator &=(value_type & lhs, const marray & rhs) = delete; + friend marray &operator &=(marray &lhs, const marray &rhs) = delete; + friend marray &operator &=(marray &lhs, const value_type &rhs) = delete; + friend marray &operator &=(value_type &lhs, const marray &rhs) = delete; - friend marray &operator |=(marray & lhs, const marray & rhs) = delete; - friend marray &operator |=(marray & lhs, const value_type & rhs) = delete; - friend marray &operator |=(value_type & lhs, const marray & rhs) = delete; + friend marray &operator |=(marray &lhs, const marray &rhs) = delete; + friend marray &operator |=(marray &lhs, const value_type &rhs) = delete; + friend marray &operator |=(value_type &lhs, const marray &rhs) = delete; - friend marray &operator ^=(marray & lhs, const marray & rhs) = delete; - friend marray &operator ^=(marray & lhs, const value_type & rhs) = delete; - friend marray &operator ^=(value_type & lhs, const marray & rhs) = delete; + friend marray &operator ^=(marray &lhs, const marray &rhs) = delete; + friend marray &operator ^=(marray &lhs, const value_type &rhs) = delete; + friend marray &operator ^=(value_type &lhs, const marray &rhs) = delete; - friend marray operator <<(const marray & lhs, const marray & rhs) = delete; - friend marray operator <<(const marray & lhs, const value_type & rhs) = delete; - friend marray operator <<(const value_type & lhs, const marray & rhs) = delete; + friend marray operator <<(const marray &lhs, const marray &rhs) = delete; + friend marray operator <<(const marray &lhs, const value_type &rhs) = delete; + friend marray operator <<(const value_type &lhs, const marray &rhs) = delete; - friend marray operator >>(const marray & lhs, const marray & rhs) = delete; - friend marray operator >>(const marray & lhs, const value_type & rhs) = delete; - friend marray operator >>(const value_type & lhs, const marray & rhs) = delete; + friend marray operator >>(const marray &lhs, const marray &rhs) = delete; + friend marray operator >>(const marray &lhs, const value_type &rhs) = delete; + friend marray operator >>(const value_type &lhs, const marray &rhs) = delete; - friend marray &operator <<=(marray & lhs, const marray & rhs) = delete; - friend marray &operator <<=(marray & lhs, const value_type & rhs) = delete; + friend marray &operator <<=(marray &lhs, const marray &rhs) = delete; + friend marray &operator <<=(marray &lhs, const value_type &rhs) = delete; - friend marray &operator >>=(marray & lhs, const marray & rhs) = delete; - friend marray &operator >>=(marray & lhs, const value_type & rhs) = delete; + friend marray &operator >>=(marray &lhs, const marray &rhs) = delete; + friend marray &operator >>=(marray &lhs, const value_type &rhs) = delete; - friend marray operator <(const marray & lhs, const marray & rhs) = delete; - friend marray operator <(const marray & lhs, const value_type & rhs) = delete; - friend marray operator <(const value_type & lhs, const marray & rhs) = delete; + friend marray operator <(const marray &lhs, const marray &rhs) = delete; + friend marray operator <(const marray &lhs, const value_type &rhs) = delete; + friend marray operator <(const value_type &lhs, const marray &rhs) = delete; - friend marray operator >(const marray & lhs, const marray & rhs) = delete; - friend marray operator >(const marray & lhs, const value_type & rhs) = delete; - friend marray operator >(const value_type & lhs, const marray & rhs) = delete; + friend marray operator >(const marray &lhs, const marray &rhs) = delete; + friend marray operator >(const marray &lhs, const value_type &rhs) = delete; + friend marray operator >(const value_type &lhs, const marray &rhs) = delete; - friend marray operator <=(const marray & lhs, const marray & rhs) = delete; - friend marray operator <=(const marray & lhs, const value_type & rhs) = delete; - friend marray operator <=(const value_type & lhs, const marray & rhs) = delete; + friend marray operator <=(const marray &lhs, const marray &rhs) = delete; + friend marray operator <=(const marray &lhs, const value_type &rhs) = delete; + friend marray operator <=(const value_type &lhs, const marray &rhs) = delete; - friend marray operator >=(const marray & lhs, const marray & rhs) = delete; - friend marray operator >=(const marray & lhs, const value_type & rhs) = delete; - friend marray operator >=(const value_type & lhs, const marray & rhs) = delete; + friend marray operator >=(const marray &lhs, const marray &rhs) = delete; + friend marray operator >=(const marray &lhs, const value_type &rhs) = delete; + friend marray operator >=(const value_type &lhs, const marray &rhs) = delete; - friend marray operator ~(const marray &v) = delete; + friend marray operator ~(const marray &lhs) = delete; - friend marray operator !(const marray &v) = delete; + friend marray operator !(const marray &lhs) = delete; }; } // namespace sycl From 300a22eea94237b956c93b4dcbff7827d4a8b287 Mon Sep 17 00:00:00 2001 From: Jefferson Le Quellec Date: Wed, 21 Feb 2024 17:17:19 +0100 Subject: [PATCH 2/6] Include notes and declarations for operators requiring implementation --- .../sycl_ext_oneapi_complex.asciidoc | 76 ++++++++++++++++++- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc index 1ee93140c011f..942a9c33bcbf9 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc @@ -228,15 +228,16 @@ public: This proposal also introduces the specialization of the `sycl::marray` class to support SYCL `complex`. The `marray` class undergoes slight modification for this specialization, primarily involving the removal of operators that are -inapplicable. No new functions or operators are introduced to the `marray` -class. +inapplicable and implementing the operators that are *only* supported by +`complex`. +No new functions or operators are introduced to the `marray` class. The `complex`'s `marray` specialization maintains the principles of trivial copyability (as seen in the <>), with the `is_device_copyable` type trait resolving to `std::true_type`. The `marray` specialization for `complex` deletes any operator that is not -supported by `complex`. +supported by `complex` and implements the ones supported. ```C++ namespace sycl { @@ -248,6 +249,75 @@ public: /* ... */ + /// Adds and assigns marray rhs to marray lhs. + friend marray &operator +=(marray &lhs, const marray &rhs); + /// Adds and assigns complex number rhs to marray lhs. + friend marray &operator +=(marray &lhs, const value_type &rhs); + + /// Subtracts and assigns marray rhs to marray lhs. + friend marray &operator -=(marray &lhs, const marray &rhs); + /// Subtracts and assigns complex number rhs to marray lhs. + friend marray &operator -=(marray &lhs, const value_type &rhs); + + /// Multiplies and assigns marray rhs to marray lhs. + friend marray &operator *=(marray &lhs, const marray &rhs); + /// Multiplies and assigns complex number rhs to marray lhs. + friend marray &operator *=(marray &lhs, const value_type &rhs); + + /// Divides and assigns marray rhs to marray lhs. + friend marray &operator /=(marray &lhs, const marray &rhs); + /// Divides and assigns complex number rhs to marray lhs. + friend marray &operator /=(marray &lhs, const value_type &rhs); + + /// Returns a copy of the input marray. + friend marray operator +(const marray &lhs); + /// Negates each element of the input marray. + friend marray operator -(const marray &lhs); + + /// Adds marray rhs and marray lhs and returns the result. + friend marray operator +(const marray &lhs, const marray &rhs); + /// Adds complex number rhs and marray lhs and returns the result. + friend marray operator +(const marray &lhs, const value_type &rhs); + /// Adds marray rhs and complex number lhs and returns the result. + friend marray operator +(const value_type &lhs, const marray &rhs); + + /// Subtracts marray rhs and marray lhs and returns the result. + friend marray operator -(const marray &lhs, const marray &rhs); + /// Subtracts complex number rhs and marray lhs and returns the result. + friend marray operator -(const marray &lhs, const value_type &rhs); + /// Subtracts marray rhs and complex number lhs and returns the result. + friend marray operator -(const value_type &lhs, const marray &rhs); + + /// Mulitplies marray rhs and marray lhs and returns the result. + friend marray operator *(const marray &lhs, const marray &rhs); + /// Multiplies complex number rhs and marray lhs and returns the result. + friend marray operator *(const marray &lhs, const value_type &rhs); + /// Multiplies marray rhs and complex number lhs and returns the result. + friend marray operator *(const value_type &lhs, const marray &rhs); + + /// Divides marray rhs and marray lhs and returns the result. + friend marray operator /(const marray &lhs, const marray &rhs); + /// Divides complex number rhs and marray lhs and returns the result. + friend marray operator /(const marray &lhs, const value_type &rhs); + /// Divides marray rhs and complex number lhs and returns the result. + friend marray operator /(const value_type &lhs, const marray &rhs); + + /// Compares marray rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. + friend marray operator ==(const marray &lhs, const marray &rhs); + /// Compares complex number rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. + friend marray operator ==(const marray &lhs, const value_type &rhs); + /// Compares marray rhs and complex number lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. + friend marray operator ==(const value_type &lhs, const marray &rhs); + + /// Compares marray rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. + friend marray operator !=(const marray &lhs, const marray &rhs); + /// Compares complex number rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. + friend marray operator !=(const marray &lhs, const value_type &rhs); + /// Compares marray rhs and complex number lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs dffers, otherwise false. + friend marray operator !=(const value_type &lhs, const marray &rhs); + + /* ... */ + friend marray operator %(const marray &lhs, const marray &rhs) = delete; friend marray operator %(const marray &lhs, const value_type &rhs) = delete; friend marray operator %(const value_type &lhs, const marray &rhs) = delete; From 3b3570487b59b331d0b6256f8a2e9bb1e8d96c68 Mon Sep 17 00:00:00 2001 From: Jefferson Le Quellec Date: Wed, 21 Feb 2024 17:25:30 +0100 Subject: [PATCH 3/6] Add missing deleted operators and remove unnecessary addition of operators --- .../sycl_ext_oneapi_complex.asciidoc | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc index 942a9c33bcbf9..470dfbf835c64 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc @@ -324,7 +324,6 @@ public: friend marray &operator %=(marray &lhs, const marray &rhs) = delete; friend marray &operator %=(marray &lhs, const value_type &rhs) = delete; - friend marray &operator %=(value_type &lhs, const marray &rhs) = delete; friend marray operator ++(marray &lhs, int) = delete; friend marray &operator ++(marray &lhs) = delete; @@ -332,26 +331,32 @@ public: friend marray operator --(marray &lhs, int) = delete; friend marray &operator --(marray &lhs) = delete; + friend marray &operator +=(marray &lhs) = delete; + friend marray operator +=(marray &lhs, int) = delete; + + friend marray &operator -=(marray &lhs) = delete; + friend marray operator -=(marray &lhs, int) = delete; + friend marray operator &(const marray &lhs, const marray &rhs) = delete; friend marray operator &(const marray &lhs, const value_type &rhs) = delete; + friend marray operator &(const value_type &lhs, const marray &rhs) = delete; friend marray operator |(const marray &lhs, const marray &rhs) = delete; friend marray operator |(const marray &lhs, const value_type &rhs) = delete; + friend marray operator |(const value_type &lhs, const marray &rhs) = delete; friend marray operator ^(const marray &lhs, const marray &rhs) = delete; friend marray operator ^(const marray &lhs, const value_type &rhs) = delete; + friend marray operator ^(const value_type &lhs, const marray &rhs) = delete; friend marray &operator &=(marray &lhs, const marray &rhs) = delete; friend marray &operator &=(marray &lhs, const value_type &rhs) = delete; - friend marray &operator &=(value_type &lhs, const marray &rhs) = delete; friend marray &operator |=(marray &lhs, const marray &rhs) = delete; friend marray &operator |=(marray &lhs, const value_type &rhs) = delete; - friend marray &operator |=(value_type &lhs, const marray &rhs) = delete; friend marray &operator ^=(marray &lhs, const marray &rhs) = delete; friend marray &operator ^=(marray &lhs, const value_type &rhs) = delete; - friend marray &operator ^=(value_type &lhs, const marray &rhs) = delete; friend marray operator <<(const marray &lhs, const marray &rhs) = delete; friend marray operator <<(const marray &lhs, const value_type &rhs) = delete; @@ -383,6 +388,14 @@ public: friend marray operator >=(const marray &lhs, const value_type &rhs) = delete; friend marray operator >=(const value_type &lhs, const marray &rhs) = delete; + friend marray operator &&(const marray &lhs, const marray &hhs) = delete; + friend marray operator &&(const marray &lhs, const value_type &rhs) = delete; + friend marray operator &&(const value_type &lhs, const marray &rhs) = delete; + + friend marray operator ||(const marray &lhs, const marray &rhs) = delete; + friend marray operator ||(const marray &lhs, const value_type &rhs) = delete; + friend marray operator ||(const value_type &lhs, const marray &rhs) = delete; + friend marray operator ~(const marray &lhs) = delete; friend marray operator !(const marray &lhs) = delete; From 7147da46423c5548129e8702fe6544bdf401de1b Mon Sep 17 00:00:00 2001 From: Jefferson Le Quellec Date: Wed, 21 Feb 2024 17:34:10 +0100 Subject: [PATCH 4/6] Reorder required implementation to follow the complex order and reorder the deleted operators to follow the C++ order --- .../sycl_ext_oneapi_complex.asciidoc | 71 +++++++++---------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc index 470dfbf835c64..3558ca8fe112a 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc @@ -269,17 +269,14 @@ public: /// Divides and assigns complex number rhs to marray lhs. friend marray &operator /=(marray &lhs, const value_type &rhs); - /// Returns a copy of the input marray. - friend marray operator +(const marray &lhs); - /// Negates each element of the input marray. - friend marray operator -(const marray &lhs); - /// Adds marray rhs and marray lhs and returns the result. friend marray operator +(const marray &lhs, const marray &rhs); /// Adds complex number rhs and marray lhs and returns the result. friend marray operator +(const marray &lhs, const value_type &rhs); /// Adds marray rhs and complex number lhs and returns the result. friend marray operator +(const value_type &lhs, const marray &rhs); + /// Returns a copy of the input marray. + friend marray operator +(const marray &lhs); /// Subtracts marray rhs and marray lhs and returns the result. friend marray operator -(const marray &lhs, const marray &rhs); @@ -287,6 +284,8 @@ public: friend marray operator -(const marray &lhs, const value_type &rhs); /// Subtracts marray rhs and complex number lhs and returns the result. friend marray operator -(const value_type &lhs, const marray &rhs); + /// Negates each element of the input marray. + friend marray operator -(const marray &lhs); /// Mulitplies marray rhs and marray lhs and returns the result. friend marray operator *(const marray &lhs, const marray &rhs); @@ -318,18 +317,29 @@ public: /* ... */ - friend marray operator %(const marray &lhs, const marray &rhs) = delete; - friend marray operator %(const marray &lhs, const value_type &rhs) = delete; - friend marray operator %(const value_type &lhs, const marray &rhs) = delete; - friend marray &operator %=(marray &lhs, const marray &rhs) = delete; friend marray &operator %=(marray &lhs, const value_type &rhs) = delete; - friend marray operator ++(marray &lhs, int) = delete; + friend marray &operator &=(marray &lhs, const marray &rhs) = delete; + friend marray &operator &=(marray &lhs, const value_type &rhs) = delete; + + friend marray &operator |=(marray &lhs, const marray &rhs) = delete; + friend marray &operator |=(marray &lhs, const value_type &rhs) = delete; + + friend marray &operator ^=(marray &lhs, const marray &rhs) = delete; + friend marray &operator ^=(marray &lhs, const value_type &rhs) = delete; + + friend marray &operator <<=(marray &lhs, const marray &rhs) = delete; + friend marray &operator <<=(marray &lhs, const value_type &rhs) = delete; + + friend marray &operator >>=(marray &lhs, const marray &rhs) = delete; + friend marray &operator >>=(marray &lhs, const value_type &rhs) = delete; + friend marray &operator ++(marray &lhs) = delete; + friend marray operator ++(marray &lhs, int) = delete; - friend marray operator --(marray &lhs, int) = delete; friend marray &operator --(marray &lhs) = delete; + friend marray operator --(marray &lhs, int) = delete; friend marray &operator +=(marray &lhs) = delete; friend marray operator +=(marray &lhs, int) = delete; @@ -337,6 +347,12 @@ public: friend marray &operator -=(marray &lhs) = delete; friend marray operator -=(marray &lhs, int) = delete; + friend marray operator %(const marray &lhs, const marray &rhs) = delete; + friend marray operator %(const marray &lhs, const value_type &rhs) = delete; + friend marray operator %(const value_type &lhs, const marray &rhs) = delete; + + friend marray operator ~(const marray &lhs) = delete; + friend marray operator &(const marray &lhs, const marray &rhs) = delete; friend marray operator &(const marray &lhs, const value_type &rhs) = delete; friend marray operator &(const value_type &lhs, const marray &rhs) = delete; @@ -349,15 +365,6 @@ public: friend marray operator ^(const marray &lhs, const value_type &rhs) = delete; friend marray operator ^(const value_type &lhs, const marray &rhs) = delete; - friend marray &operator &=(marray &lhs, const marray &rhs) = delete; - friend marray &operator &=(marray &lhs, const value_type &rhs) = delete; - - friend marray &operator |=(marray &lhs, const marray &rhs) = delete; - friend marray &operator |=(marray &lhs, const value_type &rhs) = delete; - - friend marray &operator ^=(marray &lhs, const marray &rhs) = delete; - friend marray &operator ^=(marray &lhs, const value_type &rhs) = delete; - friend marray operator <<(const marray &lhs, const marray &rhs) = delete; friend marray operator <<(const marray &lhs, const value_type &rhs) = delete; friend marray operator <<(const value_type &lhs, const marray &rhs) = delete; @@ -366,11 +373,15 @@ public: friend marray operator >>(const marray &lhs, const value_type &rhs) = delete; friend marray operator >>(const value_type &lhs, const marray &rhs) = delete; - friend marray &operator <<=(marray &lhs, const marray &rhs) = delete; - friend marray &operator <<=(marray &lhs, const value_type &rhs) = delete; + friend marray operator !(const marray &lhs) = delete; - friend marray &operator >>=(marray &lhs, const marray &rhs) = delete; - friend marray &operator >>=(marray &lhs, const value_type &rhs) = delete; + friend marray operator &&(const marray &lhs, const marray &hhs) = delete; + friend marray operator &&(const marray &lhs, const value_type &rhs) = delete; + friend marray operator &&(const value_type &lhs, const marray &rhs) = delete; + + friend marray operator ||(const marray &lhs, const marray &rhs) = delete; + friend marray operator ||(const marray &lhs, const value_type &rhs) = delete; + friend marray operator ||(const value_type &lhs, const marray &rhs) = delete; friend marray operator <(const marray &lhs, const marray &rhs) = delete; friend marray operator <(const marray &lhs, const value_type &rhs) = delete; @@ -387,18 +398,6 @@ public: friend marray operator >=(const marray &lhs, const marray &rhs) = delete; friend marray operator >=(const marray &lhs, const value_type &rhs) = delete; friend marray operator >=(const value_type &lhs, const marray &rhs) = delete; - - friend marray operator &&(const marray &lhs, const marray &hhs) = delete; - friend marray operator &&(const marray &lhs, const value_type &rhs) = delete; - friend marray operator &&(const value_type &lhs, const marray &rhs) = delete; - - friend marray operator ||(const marray &lhs, const marray &rhs) = delete; - friend marray operator ||(const marray &lhs, const value_type &rhs) = delete; - friend marray operator ||(const value_type &lhs, const marray &rhs) = delete; - - friend marray operator ~(const marray &lhs) = delete; - - friend marray operator !(const marray &lhs) = delete; }; } // namespace sycl From 04583dd1dfc1244714da061af85b8c14fbcd40e2 Mon Sep 17 00:00:00 2001 From: Jefferson Le Quellec Date: Tue, 19 Mar 2024 16:29:47 +0100 Subject: [PATCH 5/6] Clarify the comments to be more specific --- .../sycl_ext_oneapi_complex.asciidoc | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc index 3558ca8fe112a..b48749085196b 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc @@ -249,70 +249,70 @@ public: /* ... */ - /// Adds and assigns marray rhs to marray lhs. + /// Adds marray rhs to marray lhs and assigns the result to lhs. friend marray &operator +=(marray &lhs, const marray &rhs); - /// Adds and assigns complex number rhs to marray lhs. + /// Adds complex number rhs to marray lhs and assigns the result to lhs. friend marray &operator +=(marray &lhs, const value_type &rhs); - /// Subtracts and assigns marray rhs to marray lhs. + /// Subtracts marray rhs from marray lhs and assigns the result to lhs. friend marray &operator -=(marray &lhs, const marray &rhs); - /// Subtracts and assigns complex number rhs to marray lhs. + /// Subtracts complex number rhs from marray lhs and assigns the result to lhs. friend marray &operator -=(marray &lhs, const value_type &rhs); - /// Multiplies and assigns marray rhs to marray lhs. + /// Multiplies marray rhs to marray lhs and assigns the result to lhs. friend marray &operator *=(marray &lhs, const marray &rhs); - /// Multiplies and assigns complex number rhs to marray lhs. + /// Multiplies complex number rhs to marray lhs and assigns the result to lhs. friend marray &operator *=(marray &lhs, const value_type &rhs); - /// Divides and assigns marray rhs to marray lhs. + /// Divides marray lhs by marray rhs and assigns the result to lhs. friend marray &operator /=(marray &lhs, const marray &rhs); - /// Divides and assigns complex number rhs to marray lhs. + /// Divides marray lhs by complex number rhs and assigns the result to lhs. friend marray &operator /=(marray &lhs, const value_type &rhs); - /// Adds marray rhs and marray lhs and returns the result. + /// Adds marray rhs to marray lhs and returns the result. friend marray operator +(const marray &lhs, const marray &rhs); - /// Adds complex number rhs and marray lhs and returns the result. + /// Adds complex number rhs to marray lhs and returns the result. friend marray operator +(const marray &lhs, const value_type &rhs); - /// Adds marray rhs and complex number lhs and returns the result. + /// Adds marray rhs to complex number lhs and returns the result. friend marray operator +(const value_type &lhs, const marray &rhs); - /// Returns a copy of the input marray. + /// Returns a copy of marray lhs. friend marray operator +(const marray &lhs); - /// Subtracts marray rhs and marray lhs and returns the result. + /// Subtracts marray rhs from marray lhs and returns the result. friend marray operator -(const marray &lhs, const marray &rhs); - /// Subtracts complex number rhs and marray lhs and returns the result. + /// Subtracts complex number rhs from marray lhs and returns the result. friend marray operator -(const marray &lhs, const value_type &rhs); - /// Subtracts marray rhs and complex number lhs and returns the result. + /// Subtracts marray rhs from complex number lhs and returns the result. friend marray operator -(const value_type &lhs, const marray &rhs); - /// Negates each element of the input marray. + /// Negates each element of marray lhs. friend marray operator -(const marray &lhs); - /// Mulitplies marray rhs and marray lhs and returns the result. + /// Multiplies marray rhs to marray lhs and returns the result. friend marray operator *(const marray &lhs, const marray &rhs); - /// Multiplies complex number rhs and marray lhs and returns the result. + /// Multiplies complex number rhs to marray lhs and returns the result. friend marray operator *(const marray &lhs, const value_type &rhs); - /// Multiplies marray rhs and complex number lhs and returns the result. + /// Multiplies marray rhs to complex number lhs and returns the result. friend marray operator *(const value_type &lhs, const marray &rhs); - /// Divides marray rhs and marray lhs and returns the result. + /// Divides marray lhs by marray rhs and returns the result. friend marray operator /(const marray &lhs, const marray &rhs); - /// Divides complex number rhs and marray lhs and returns the result. + /// Divides marray lhs by complex number rhs and returns the result. friend marray operator /(const marray &lhs, const value_type &rhs); - /// Divides marray rhs and complex number lhs and returns the result. + /// Divides complex number lhs by marray rhs and returns the result. friend marray operator /(const value_type &lhs, const marray &rhs); - /// Compares marray rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. + /// Compares marray rhs to marray lhs and returns an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. friend marray operator ==(const marray &lhs, const marray &rhs); - /// Compares complex number rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. + /// Compares complex number rhs to marray lhs and returns an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. friend marray operator ==(const marray &lhs, const value_type &rhs); - /// Compares marray rhs and complex number lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. + /// Compares marray rhs to complex number lhs and returns an marray of booleans where each element is true if the corresponding elements in lhs and rhs are the same, otherwise false. friend marray operator ==(const value_type &lhs, const marray &rhs); - /// Compares marray rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. + /// Compares marray rhs to marray lhs and returns an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. friend marray operator !=(const marray &lhs, const marray &rhs); - /// Compares complex number rhs and marray lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. + /// Compares complex number rhs to marray lhs and returns an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. friend marray operator !=(const marray &lhs, const value_type &rhs); - /// Compares marray rhs and complex number lhs, returning an marray of booleans where each element is true if the corresponding elements in lhs and rhs dffers, otherwise false. + /// Compares marray rhs to complex number lhs and returns an marray of booleans where each element is true if the corresponding elements in lhs and rhs differs, otherwise false. friend marray operator !=(const value_type &lhs, const marray &rhs); /* ... */ From 277b17f8dbec31de00d2451f3636d91dc5c600a3 Mon Sep 17 00:00:00 2001 From: Jefferson Le Quellec Date: Tue, 19 Mar 2024 16:31:30 +0100 Subject: [PATCH 6/6] Add missing space to comment --- .../extensions/experimental/sycl_ext_oneapi_complex.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc index b48749085196b..f99898f7f5ad3 100644 --- a/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc +++ b/sycl/doc/extensions/experimental/sycl_ext_oneapi_complex.asciidoc @@ -205,7 +205,7 @@ public: /// Compares complex numbers z and w and returns true if they are different, otherwise false. friend constexpr bool operator!=(const complex &z, const complex &w); - ///Compares complex number z and real y and returns true if they are different, otherwise false. + /// Compares complex number z and real y and returns true if they are different, otherwise false. friend constexpr bool operator!=(const complex &z, value_type y); /// Compares real x and complex number w and returns true if they are different, otherwise false. friend constexpr bool operator!=(value_type x, const complex &w);