Skip to content

Commit 308a80c

Browse files
fix comment
1 parent 2e02582 commit 308a80c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

numpy/_core/src/umath/loops_arithmetic.dispatch.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ void TYPE_divide(char **args, npy_intp const *dimensions, npy_intp const *steps,
323323

324324
#if NPY_HWY
325325
// Handle array-array case
326-
if (IS_BLOCKABLE_BINARY(sizeof(T), NPY_SIMD_WIDTH))
326+
if (IS_BLOCKABLE_BINARY(sizeof(T), kMaxLanes<uint8_t>))
327327
{
328328
bool no_overlap = nomemoverlap(args[2], steps[2], args[0], steps[0], dimensions[0]) &&
329329
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,
336336
return;
337337
}
338338
}
339-
else if (IS_BLOCKABLE_BINARY_SCALAR2(sizeof(T), NPY_SIMD_WIDTH) &&
339+
else if (IS_BLOCKABLE_BINARY_SCALAR2(sizeof(T), kMaxLanes<uint8_t>) &&
340340
*reinterpret_cast<T*>(args[1]) != 0)
341341
{
342342
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
388388
}
389389
#if NPY_HWY
390390
// Handle array-array case
391-
if (IS_BLOCKABLE_BINARY(sizeof(T), NPY_SIMD_WIDTH)) {
391+
if (IS_BLOCKABLE_BINARY(sizeof(T), kMaxLanes<uint8_t>)) {
392392
bool no_overlap = nomemoverlap(args[2], steps[2], args[0], steps[0], dimensions[0]) &&
393393
nomemoverlap(args[2], steps[2], args[1], steps[1], dimensions[0]);
394394
// 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
400400
return;
401401
}
402402
}
403-
else if (IS_BLOCKABLE_BINARY_SCALAR2(sizeof(T), NPY_SIMD_WIDTH) &&
403+
else if (IS_BLOCKABLE_BINARY_SCALAR2(sizeof(T), kMaxLanes<uint8_t>) &&
404404
*reinterpret_cast<T*>(args[1]) != 0)
405405
{
406406
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),
483483

484484
// Macro to define the dispatch functions for signed types
485485
#define DEFINE_DIVIDE_FUNCTION(TYPE, SCALAR_TYPE) \
486-
extern "C" { \
487486
NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(TYPE##_divide)(char **args, npy_intp const *dimensions, npy_intp const *steps, void *func) { \
488487
TYPE_divide<SCALAR_TYPE>(args, dimensions, steps, func); \
489488
} \
490489
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) { \
491490
return TYPE_divide_indexed<SCALAR_TYPE>(context, args, dimensions, steps, func); \
492-
} \
493-
} // extern "C"
491+
}
494492

495493
// Macro to define the dispatch functions for unsigned types
496494
#define DEFINE_DIVIDE_FUNCTION_UNSIGNED(TYPE, SCALAR_TYPE) \
497-
extern "C" { \
498495
NPY_NO_EXPORT void NPY_CPU_DISPATCH_CURFX(TYPE##_divide)(char **args, npy_intp const *dimensions, npy_intp const *steps, void *func) { \
499496
TYPE_divide_unsigned<SCALAR_TYPE>(args, dimensions, steps, func); \
500497
} \
501498
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) { \
502499
return TYPE_divide_unsigned_indexed<SCALAR_TYPE>(context, args, dimensions, steps, func); \
503-
} \
504-
} // extern "C"
500+
}
505501

506502

507503
#ifdef NPY_CPU_DISPATCH_CURFX

0 commit comments

Comments
 (0)