Skip to content

Commit

Permalink
Add ability to set real and imaginary components of complex numbers s…
Browse files Browse the repository at this point in the history
…eparately
  • Loading branch information
mbrubake committed Aug 26, 2015
1 parent 440936b commit a84c2fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pycuda/cuda/pycuda-complex.hpp
Expand Up @@ -87,6 +87,10 @@ struct complex {
value_type real() const { return _M_re; }
__device__
value_type imag() const { return _M_im; }
__device__
value_type &real() { return _M_re; }
__device__
value_type &imag() { return _M_im; }

// Arithmetic op= operations involving one real argument.

Expand Down Expand Up @@ -223,6 +227,8 @@ struct _STLP_CLASS_DECLSPEC complex<float> {
// Element access.
value_type __device__ real() const { return _M_re; }
value_type __device__ imag() const { return _M_im; }
value_type & __device__ real() { return _M_re; }
value_type & __device__ imag() { return _M_im; }

// Arithmetic op= operations involving one real argument.

Expand Down Expand Up @@ -393,6 +399,10 @@ struct _STLP_CLASS_DECLSPEC complex<double> {
value_type real() const { return _M_re; }
__device__
value_type imag() const { return _M_im; }
__device__
value_type &real() { return _M_re; }
__device__
value_type &imag() { return _M_im; }

// Arithmetic op= operations involving one real argument.

Expand Down

0 comments on commit a84c2fe

Please sign in to comment.