Skip to content
Snippets Groups Projects
Commit cebe5ba8 authored by Alexander Harvey Nitz's avatar Alexander Harvey Nitz Committed by Andreas Klöckner
Browse files

Copy kernel handles mixed complex precision

parent ec6b253b
No related branches found
No related tags found
No related merge requests found
...@@ -440,6 +440,9 @@ def get_copy_kernel(context, dtype_dest, dtype_src): ...@@ -440,6 +440,9 @@ def get_copy_kernel(context, dtype_dest, dtype_src):
if dtype_dest.kind == "c" != dtype_src.kind: if dtype_dest.kind == "c" != dtype_src.kind:
src = "%s_fromreal(%s)" % (complex_dtype_to_name(dtype_dest), src) src = "%s_fromreal(%s)" % (complex_dtype_to_name(dtype_dest), src)
if dtype_dest.kind == "c" and dtype_src != dtype_dest:
src = "%s_cast(%s)" % (complex_dtype_to_name(dtype_dest), src),
return get_elwise_kernel(context, return get_elwise_kernel(context,
"%(tp_dest)s *dest, %(tp_src)s *src" % { "%(tp_dest)s *dest, %(tp_src)s *src" % {
"tp_dest": dtype_to_ctype(dtype_dest), "tp_dest": dtype_to_ctype(dtype_dest),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment