@@ -227,26 +227,21 @@ quad_binary_op_resolve_descriptors(PyObject *self, PyArray_DTypeMeta *const dtyp
227
227
PyArray_Descr *const given_descrs[],
228
228
PyArray_Descr *loop_descrs[], npy_intp *NPY_UNUSED (view_offset))
229
229
{
230
- printf (" Descriptor Resolver is called\n " );
231
230
232
231
QuadPrecDTypeObject *descr_in1 = (QuadPrecDTypeObject *)given_descrs[0 ];
233
232
QuadPrecDTypeObject *descr_in2 = (QuadPrecDTypeObject *)given_descrs[1 ];
234
233
QuadBackendType target_backend;
235
234
236
235
const char *s1 = (descr_in1->backend == BACKEND_SLEEF) ? " SLEEF" : " LONGDOUBLE" ;
237
236
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 );
240
237
241
238
// Determine target backend and if casting is needed
242
239
NPY_CASTING casting = NPY_NO_CASTING;
243
240
if (descr_in1->backend != descr_in2->backend ) {
244
241
target_backend = BACKEND_LONGDOUBLE;
245
242
casting = NPY_SAFE_CASTING;
246
- printf (" Different backends detected. Casting to LONGDOUBLE.\n " );
247
243
} else {
248
244
target_backend = descr_in1->backend ;
249
- printf (" Unified backend: %s\n " , (target_backend == BACKEND_SLEEF) ? " SLEEF" : " LONGDOUBLE" );
250
245
}
251
246
252
247
// Set up input descriptors, casting if necessary
@@ -280,8 +275,6 @@ quad_binary_op_resolve_descriptors(PyObject *self, PyArray_DTypeMeta *const dtyp
280
275
loop_descrs[2 ] = given_descrs[2 ];
281
276
}
282
277
}
283
-
284
- printf (" Casting result: %d\n " , casting);
285
278
return casting;
286
279
}
287
280
@@ -291,7 +284,6 @@ quad_generic_binop_strided_loop(PyArrayMethod_Context *context, char *const data
291
284
npy_intp const dimensions[], npy_intp const strides[],
292
285
NpyAuxData *auxdata)
293
286
{
294
- printf (" Umath: Generic Strided loop is calledn\n " );
295
287
npy_intp N = dimensions[0 ];
296
288
char *in1_ptr = data[0 ], *in2_ptr = data[1 ];
297
289
char *out_ptr = data[2 ];
@@ -326,10 +318,6 @@ static int
326
318
quad_ufunc_promoter (PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
327
319
PyArray_DTypeMeta *signature[], PyArray_DTypeMeta *new_op_dtypes[])
328
320
{
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 );
333
321
334
322
int nin = ufunc->nin ;
335
323
int nargs = ufunc->nargs ;
@@ -343,52 +331,51 @@ quad_ufunc_promoter(PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
343
331
for (int i = 0 ; i < 3 ; i++) {
344
332
Py_INCREF (op_dtypes[1 ]);
345
333
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
+
347
335
}
348
336
return 0 ;
349
337
}
350
338
351
339
// Check if any input or signature is QuadPrecision
352
340
for (int i = 0 ; i < nin; i++) {
353
- printf ( " iterating on dtype : %s \n " , get_dtype_name (op_dtypes[i]));
341
+
354
342
if (op_dtypes[i] == &QuadPrecDType) {
355
343
has_quad = true ;
356
- printf ( " QuadPrecision detected in input %d \n " , i);
344
+
357
345
}
358
346
}
359
347
360
348
if (has_quad) {
361
349
common = &QuadPrecDType;
362
- printf ( " Using QuadPrecDType as common type \n " );
350
+
363
351
}
364
352
else {
365
353
for (int i = nin; i < nargs; i++) {
366
354
if (signature[i] != NULL ) {
367
355
if (common == NULL ) {
368
356
Py_INCREF (signature[i]);
369
357
common = signature[i];
370
- printf ( " Common type set to %s from signature \n " , get_dtype_name (common));
358
+
371
359
}
372
360
else if (common != signature[i]) {
373
361
Py_CLEAR (common); // Not homogeneous, unset common
374
- printf ( " Output signature not homogeneous, cleared common type \n " );
362
+
375
363
break ;
376
364
}
377
365
}
378
366
}
379
367
}
380
368
// If no common output dtype, use standard promotion for inputs
381
369
if (common == NULL ) {
382
- printf (" Using standard promotion for inputs\n " );
383
370
common = PyArray_PromoteDTypeSequence (nin, op_dtypes);
384
371
if (common == NULL ) {
385
372
if (PyErr_ExceptionMatches (PyExc_TypeError)) {
386
373
PyErr_Clear (); // Do not propagate normal promotion errors
387
374
}
388
- printf ( " Exiting quad_ufunc_promoter (promotion failed) \n " );
375
+
389
376
return -1 ;
390
377
}
391
- printf ( " Common type after promotion: %s \n " , get_dtype_name (common));
378
+
392
379
}
393
380
394
381
// Set all new_op_dtypes to the common dtype
@@ -397,20 +384,16 @@ quad_ufunc_promoter(PyUFuncObject *ufunc, PyArray_DTypeMeta *op_dtypes[],
397
384
// If signature is specified for this argument, use it
398
385
Py_INCREF (signature[i]);
399
386
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]));
402
387
}
403
388
else {
404
389
// Otherwise, use the common dtype
405
390
Py_INCREF (common);
406
391
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]));
409
392
}
410
393
}
411
394
412
395
Py_XDECREF (common);
413
- printf ( " Exiting quad_ufunc_promoter \n " );
396
+
414
397
return 0 ;
415
398
}
416
399
0 commit comments