Skip to content

Commit

Permalink
Enable setting of real and imaginary parts using C++11 interface inst…
Browse files Browse the repository at this point in the history
…ead of returning by reference.
  • Loading branch information
mbrubake committed Aug 27, 2015
1 parent a84c2fe commit 4e25f3f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pycuda/cuda/pycuda-complex.hpp
Expand Up @@ -88,9 +88,9 @@ struct complex {
__device__
value_type imag() const { return _M_im; }
__device__
value_type &real() { return _M_re; }
void real(value_type val) { _M_re = val; }
__device__
value_type &imag() { return _M_im; }
void imag(value_type val) { _M_im = val; }

// Arithmetic op= operations involving one real argument.

Expand Down Expand Up @@ -227,8 +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; }
void __device__ real(value_type val) { _M_re = val; }
void __device__ imag(value_type val) { _M_im = val; }

// Arithmetic op= operations involving one real argument.

Expand Down Expand Up @@ -400,9 +400,9 @@ struct _STLP_CLASS_DECLSPEC complex<double> {
__device__
value_type imag() const { return _M_im; }
__device__
value_type &real() { return _M_re; }
void real(value_type val) { _M_re = val; }
__device__
value_type &imag() { return _M_im; }
void imag(value_type val) { _M_im = val; }

// Arithmetic op= operations involving one real argument.

Expand Down

0 comments on commit 4e25f3f

Please sign in to comment.