1
/**
2
 * Testing the utilites of the CPU dispatcher
3
 *
4
 * @targets $werror baseline
5
 * SSE2 SSE41 AVX2
6
 * VSX VSX2 VSX3
7
 * NEON ASIMD ASIMDHP
8
 */
9
#include <Python.h>
10
#include "npy_cpu_dispatch.h"
11

12
#ifndef NPY_DISABLE_OPTIMIZATION
13
    #include "_umath_tests.dispatch.h"
14
#endif
15

16
NPY_CPU_DISPATCH_DECLARE(const char *_umath_tests_dispatch_func, (void))
17
NPY_CPU_DISPATCH_DECLARE(extern const char *_umath_tests_dispatch_var)
18
NPY_CPU_DISPATCH_DECLARE(void _umath_tests_dispatch_attach, (PyObject *list))
19

20
const char *NPY_CPU_DISPATCH_CURFX(_umath_tests_dispatch_var) = NPY_TOSTRING(NPY_CPU_DISPATCH_CURFX(var));
21 1
const char *NPY_CPU_DISPATCH_CURFX(_umath_tests_dispatch_func)(void)
22
{
23
    static const char *current = NPY_TOSTRING(NPY_CPU_DISPATCH_CURFX(func));
24 1
    return current;
25
}
26

27 1
void NPY_CPU_DISPATCH_CURFX(_umath_tests_dispatch_attach)(PyObject *list)
28
{
29 1
    PyObject *item = PyUnicode_FromString(NPY_TOSTRING(NPY_CPU_DISPATCH_CURFX(func)));
30 1
    if (item) {
31 1
        PyList_Append(list, item);
32
    }
33
}

Read our documentation on viewing source code .

Loading