@@ -227,26 +227,21 @@ quad_binary_op_resolve_descriptors(PyObject *self, PyArray_DTypeMeta *const dtyp
227227 PyArray_Descr *const given_descrs[],
228228 PyArray_Descr *loop_descrs[], npy_intp *NPY_UNUSED (view_offset))
229229{
230- printf (" Descriptor Resolver is called\n " );
231230
232231 QuadPrecDTypeObject *descr_in1 = (QuadPrecDTypeObject *)given_descrs[0 ];
233232 QuadPrecDTypeObject *descr_in2 = (QuadPrecDTypeObject *)given_descrs[1 ];
234233 QuadBackendType target_backend;
235234
236235 const char *s1 = (descr_in1->backend == BACKEND_SLEEF) ? " SLEEF" : " LONGDOUBLE" ;
237236 const char *s2 = (descr_in2->backend == BACKEND_SLEEF) ? " SLEEF" : " LONGDOUBLE" ;
238- printf (" 1: %s %d %s\n " , s1, descr_in1->backend , Py_TYPE (given_descrs[0 ])->tp_name );
239- printf (" 2: %s %d %s\n " , s2, descr_in2->backend , Py_TYPE (given_descrs[1 ])->tp_name );
240237
241238 // Determine target backend and if casting is needed
242239 NPY_CASTING casting = NPY_NO_CASTING;
243240 if (descr_in1->backend != descr_in2->backend ) {
244241 target_backend = BACKEND_LONGDOUBLE;
245242 casting = NPY_SAFE_CASTING;
246- printf (" Different backends detected. Casting to LONGDOUBLE.\n " );
247243 } else {
248244 target_backend = descr_in1->backend ;
249- printf (" Unified backend: %s\n " , (target_backend == BACKEND_SLEEF) ? " SLEEF" : " LONGDOUBLE" );
250245 }
251246
252247 // Set up input descriptors, casting if necessary
@@ -280,8 +275,6 @@ quad_binary_op_resolve_descriptors(PyObject *self, PyArray_DTypeMeta *const dtyp
280275 loop_descrs[2 ] = given_descrs[2 ];
281276 }
282277 }
283-
284- printf (" Casting result: %d\n " , casting);
285278 return casting;
286279}
287280
@@ -291,7 +284,6 @@ quad_generic_binop_strided_loop(PyArrayMethod_Context *context, char *const data
291284 npy_intp const dimensions[], npy_intp const strides[],
292285 NpyAuxData *auxdata)
293286{
294- printf (" Umath: Generic Strided loop is calledn\n " );
295287 npy_intp N = dimensions[0 ];
296288 char *in1_ptr = data[0 ], *in2_ptr = data[1 ];
297289 char *out_ptr = data[2 ];
@@ -326,10 +318,6 @@ static int
326318quad_ufunc_promoter (PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
327319 PyArray_DTypeMeta *signature[], PyArray_DTypeMeta *new_op_dtypes[])
328320{
329- printf (" quad_ufunc_promoter called for ufunc: %s\n " , ufunc->name );
330- printf (" Entering quad_ufunc_promoter\n " );
331- printf (" Ufunc name: %s\n " , ufunc->name );
332- printf (" nin: %d, nargs: %d\n " , ufunc->nin , ufunc->nargs );
333321
334322 int nin = ufunc->nin ;
335323 int nargs = ufunc->nargs ;
@@ -343,52 +331,51 @@ quad_ufunc_promoter(PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
343331 for (int i = 0 ; i < 3 ; i++) {
344332 Py_INCREF (op_dtypes[1 ]);
345333 new_op_dtypes[i] = op_dtypes[1 ];
346- printf ( " new_op_dtypes[%d] set to %s \n " , i, get_dtype_name (new_op_dtypes[i]));
334+
347335 }
348336 return 0 ;
349337 }
350338
351339 // Check if any input or signature is QuadPrecision
352340 for (int i = 0 ; i < nin; i++) {
353- printf ( " iterating on dtype : %s \n " , get_dtype_name (op_dtypes[i]));
341+
354342 if (op_dtypes[i] == &QuadPrecDType) {
355343 has_quad = true ;
356- printf ( " QuadPrecision detected in input %d \n " , i);
344+
357345 }
358346 }
359347
360348 if (has_quad) {
361349 common = &QuadPrecDType;
362- printf ( " Using QuadPrecDType as common type \n " );
350+
363351 }
364352 else {
365353 for (int i = nin; i < nargs; i++) {
366354 if (signature[i] != NULL ) {
367355 if (common == NULL ) {
368356 Py_INCREF (signature[i]);
369357 common = signature[i];
370- printf ( " Common type set to %s from signature \n " , get_dtype_name (common));
358+
371359 }
372360 else if (common != signature[i]) {
373361 Py_CLEAR (common); // Not homogeneous, unset common
374- printf ( " Output signature not homogeneous, cleared common type \n " );
362+
375363 break ;
376364 }
377365 }
378366 }
379367 }
380368 // If no common output dtype, use standard promotion for inputs
381369 if (common == NULL ) {
382- printf (" Using standard promotion for inputs\n " );
383370 common = PyArray_PromoteDTypeSequence (nin, op_dtypes);
384371 if (common == NULL ) {
385372 if (PyErr_ExceptionMatches (PyExc_TypeError)) {
386373 PyErr_Clear (); // Do not propagate normal promotion errors
387374 }
388- printf ( " Exiting quad_ufunc_promoter (promotion failed) \n " );
375+
389376 return -1 ;
390377 }
391- printf ( " Common type after promotion: %s \n " , get_dtype_name (common));
378+
392379 }
393380
394381 // Set all new_op_dtypes to the common dtype
@@ -397,20 +384,16 @@ quad_ufunc_promoter(PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
397384 // If signature is specified for this argument, use it
398385 Py_INCREF (signature[i]);
399386 new_op_dtypes[i] = signature[i];
400- printf (" new_op_dtypes[%d] set to %s (from signature)\n " , i,
401- get_dtype_name (new_op_dtypes[i]));
402387 }
403388 else {
404389 // Otherwise, use the common dtype
405390 Py_INCREF (common);
406391 new_op_dtypes[i] = common;
407- printf (" new_op_dtypes[%d] set to %s (from common)\n " , i,
408- get_dtype_name (new_op_dtypes[i]));
409392 }
410393 }
411394
412395 Py_XDECREF (common);
413- printf ( " Exiting quad_ufunc_promoter \n " );
396+
414397 return 0 ;
415398}
416399
0 commit comments