-
Notifications
You must be signed in to change notification settings - Fork 761
Stream operator<< for device_reference #654
Conversation
|
Thanks Cris. I think adding this functionality is OK, but a couple questions:
|
I guess it's nice for symmetry with I'll make these changes tomorrow. |
|
Thanks. If |
|
Stream output operators for |
thrust/complex.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't eliminate the newlines at the end of these files -- on some platforms, it causes a warning if the last line is not empty.
|
Thanks Cris, I added some notes inline on your commit. |
|
Clean diff. |
|
Thanks Cris, it looks good to me! I will test & merge your fixes tomorrow. |
|
The tests pass, so I can merge this change. However, these fixes need to go into branch 1.8.2. Unfortunately, I can't change the target of this pull request -- can you target thrust:1.8.2 instead of thrust:master? |
Implicit conversions are not considered during template argument deduction. Currently, stream output of a
device_reference<A>whereAis non-template (e.g.int,float,double,mystruct) functions as expected, but fails whenAis a template (e.g.thrust::complex<float>,mytemplate<int>).Example:
This patch simply uses
static_castto force the conversion and mirrorsoperator<<defined fordevice_ptr<T>.