Skip to content

Commit 308f136

Browse files
committed
will cont tomorrow from here
1 parent ae9986b commit 308f136

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

quaddtype/numpy_quaddtype/src/casts.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ quad_to_quad_resolve_descriptors(PyObject *NPY_UNUSED(self),
6666
return NPY_NO_CASTING;
6767
}
6868

69+
static inline int
70+
quad_to_quad_same_value_check(const quad_value *in_val, QuadBackendType backend_in,
71+
const quad_value *out_val, QuadBackendType backend_out)
72+
{
73+
// convert output back to input backend for comparison
74+
return 1;
75+
}
76+
6977
template <bool Aligned>
7078
static int
7179
quad_to_quad_strided_loop(PyArrayMethod_Context *context, char *const data[],
@@ -111,6 +119,15 @@ quad_to_quad_strided_loop(PyArrayMethod_Context *context, char *const data[],
111119
std::memcpy(&out_val.sleef_value, &temp, sizeof(Sleef_quad));
112120
}
113121
}
122+
123+
if(same_value_casting)
124+
{
125+
int ret = quad_to_quad_same_value_check(&in_val, backend_in, &out_val, backend_out);
126+
if (ret < 0) {
127+
return -1;
128+
}
129+
}
130+
114131
store_quad<Aligned>(out_ptr, &out_val, backend_out);
115132
in_ptr += in_stride;
116133
out_ptr += out_stride;

0 commit comments

Comments
 (0)