-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add abs2() operator for squared abs() (#568)
* Add abs2() operator for squared abs() Add abs2() operator that is equivalent to abs()*abs() without the extra loads and the unnecessary sqrt operators associated with complex abs() calculations.
- Loading branch information
1 parent
532f699
commit d9b045b
Showing
4 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.. _abs2_func: | ||
|
||
abs2 | ||
==== | ||
|
||
Squared absolute value. For complex numbers, this is the squared | ||
complex magnitude, or real(t)\ :sup:`2` + imag(t)\ :sup:`2`. For real numbers, | ||
this is equivalent to the squared value, or t\ :sup:`2`. | ||
|
||
.. doxygenfunction:: abs2(Op t) | ||
|
||
Examples | ||
~~~~~~~~ | ||
|
||
.. literalinclude:: ../../../../test/00_operators/OperatorTests.cu | ||
:language: cpp | ||
:start-after: example-begin abs2-test-1 | ||
:end-before: example-end abs2-test-1 | ||
:dedent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters