@@ -323,7 +323,7 @@ void TYPE_divide(char **args, npy_intp const *dimensions, npy_intp const *steps,
323
323
324
324
#if NPY_HWY
325
325
// Handle array-array case
326
- if (IS_BLOCKABLE_BINARY (sizeof (T), NPY_SIMD_WIDTH ))
326
+ if (IS_BLOCKABLE_BINARY (sizeof (T), kMaxLanes < uint8_t > ))
327
327
{
328
328
bool no_overlap = nomemoverlap (args[2 ], steps[2 ], args[0 ], steps[0 ], dimensions[0 ]) &&
329
329
nomemoverlap (args[2 ], steps[2 ], args[1 ], steps[1 ], dimensions[0 ]);
@@ -336,7 +336,7 @@ void TYPE_divide(char **args, npy_intp const *dimensions, npy_intp const *steps,
336
336
return ;
337
337
}
338
338
}
339
- else if (IS_BLOCKABLE_BINARY_SCALAR2 (sizeof (T), NPY_SIMD_WIDTH ) &&
339
+ else if (IS_BLOCKABLE_BINARY_SCALAR2 (sizeof (T), kMaxLanes < uint8_t > ) &&
340
340
*reinterpret_cast <T*>(args[1 ]) != 0 )
341
341
{
342
342
bool no_overlap = nomemoverlap (args[2 ], steps[2 ], args[0 ], steps[0 ], dimensions[0 ]);
@@ -388,7 +388,7 @@ void TYPE_divide_unsigned(char **args, npy_intp const *dimensions, npy_intp cons
388
388
}
389
389
#if NPY_HWY
390
390
// Handle array-array case
391
- if (IS_BLOCKABLE_BINARY (sizeof (T), NPY_SIMD_WIDTH )) {
391
+ if (IS_BLOCKABLE_BINARY (sizeof (T), kMaxLanes < uint8_t > )) {
392
392
bool no_overlap = nomemoverlap (args[2 ], steps[2 ], args[0 ], steps[0 ], dimensions[0 ]) &&
393
393
nomemoverlap (args[2 ], steps[2 ], args[1 ], steps[1 ], dimensions[0 ]);
394
394
// Check if we can use SIMD for contiguous arrays - all steps must equal to sizeof(T)
@@ -400,7 +400,7 @@ void TYPE_divide_unsigned(char **args, npy_intp const *dimensions, npy_intp cons
400
400
return ;
401
401
}
402
402
}
403
- else if (IS_BLOCKABLE_BINARY_SCALAR2 (sizeof (T), NPY_SIMD_WIDTH ) &&
403
+ else if (IS_BLOCKABLE_BINARY_SCALAR2 (sizeof (T), kMaxLanes < uint8_t > ) &&
404
404
*reinterpret_cast <T*>(args[1 ]) != 0 )
405
405
{
406
406
bool no_overlap = nomemoverlap (args[2 ], steps[2 ], args[0 ], steps[0 ], dimensions[0 ]);
@@ -483,25 +483,21 @@ int TYPE_divide_unsigned_indexed(PyArrayMethod_Context *NPY_UNUSED(context),
483
483
484
484
// Macro to define the dispatch functions for signed types
485
485
#define DEFINE_DIVIDE_FUNCTION (TYPE, SCALAR_TYPE ) \
486
- extern " C" { \
487
486
NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX (TYPE##_divide)(char **args, npy_intp const *dimensions, npy_intp const *steps, void *func) { \
488
487
TYPE_divide<SCALAR_TYPE>(args, dimensions, steps, func); \
489
488
} \
490
489
NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX (TYPE##_divide_indexed)(PyArrayMethod_Context *context, char * const *args, npy_intp const *dimensions, npy_intp const *steps, NpyAuxData *func) { \
491
490
return TYPE_divide_indexed<SCALAR_TYPE>(context, args, dimensions, steps, func); \
492
- } \
493
- } // extern "C"
491
+ }
494
492
495
493
// Macro to define the dispatch functions for unsigned types
496
494
#define DEFINE_DIVIDE_FUNCTION_UNSIGNED (TYPE, SCALAR_TYPE ) \
497
- extern " C" { \
498
495
NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX (TYPE##_divide)(char **args, npy_intp const *dimensions, npy_intp const *steps, void *func) { \
499
496
TYPE_divide_unsigned<SCALAR_TYPE>(args, dimensions, steps, func); \
500
497
} \
501
498
NPY_NO_EXPORT int NPY_CPU_DISPATCH_CURFX (TYPE##_divide_indexed)(PyArrayMethod_Context *context, char * const *args, npy_intp const *dimensions, npy_intp const *steps, NpyAuxData *func) { \
502
499
return TYPE_divide_unsigned_indexed<SCALAR_TYPE>(context, args, dimensions, steps, func); \
503
- } \
504
- } // extern "C"
500
+ }
505
501
506
502
507
503
#ifdef NPY_CPU_DISPATCH_CURFX
0 commit comments