|
12 | 12 | #include "frameobject.h" |
13 | 13 | #include "traceback.h" |
14 | 14 | #include "typeconv.hpp" |
15 | | -#include "_devicearray.h" |
16 | 15 |
|
17 | 16 | /* |
18 | 17 | * Notes on the C_TRACE macro: |
@@ -940,37 +939,6 @@ Dispatcher_cuda_call(Dispatcher *self, PyObject *args, PyObject *kws) |
940 | 939 | return retval; |
941 | 940 | } |
942 | 941 |
|
943 | | -static int |
944 | | -import_devicearray(void) |
945 | | -{ |
946 | | - PyObject *devicearray = PyImport_ImportModule(NUMBA_DEVICEARRAY_IMPORT_NAME); |
947 | | - if (devicearray == NULL) { |
948 | | - return -1; |
949 | | - } |
950 | | - |
951 | | - PyObject *d = PyModule_GetDict(devicearray); |
952 | | - if (d == NULL) { |
953 | | - Py_DECREF(devicearray); |
954 | | - return -1; |
955 | | - } |
956 | | - |
957 | | - PyObject *key = PyUnicode_FromString("_DEVICEARRAY_API"); |
958 | | - PyObject *c_api = PyDict_GetItemWithError(d, key); |
959 | | - int retcode = 0; |
960 | | - if (PyCapsule_IsValid(c_api, NUMBA_DEVICEARRAY_IMPORT_NAME "._DEVICEARRAY_API")) { |
961 | | - DeviceArray_API = (void**)PyCapsule_GetPointer(c_api, NUMBA_DEVICEARRAY_IMPORT_NAME "._DEVICEARRAY_API"); |
962 | | - if (DeviceArray_API == NULL) { |
963 | | - retcode = -1; |
964 | | - } |
965 | | - } else { |
966 | | - retcode = -1; |
967 | | - } |
968 | | - |
969 | | - Py_DECREF(key); |
970 | | - Py_DECREF(devicearray); |
971 | | - return retcode; |
972 | | -} |
973 | | - |
974 | 942 | static PyMethodDef Dispatcher_methods[] = { |
975 | 943 | { "_clear", (PyCFunction)Dispatcher_clear, METH_NOARGS, NULL }, |
976 | 944 | { "_insert", (PyCFunction)Dispatcher_Insert, METH_VARARGS | METH_KEYWORDS, |
@@ -1076,12 +1044,6 @@ static PyMethodDef ext_methods[] = { |
1076 | 1044 |
|
1077 | 1045 |
|
1078 | 1046 | MOD_INIT(_dispatcher) { |
1079 | | - if (import_devicearray() < 0) { |
1080 | | - PyErr_Print(); |
1081 | | - PyErr_SetString(PyExc_ImportError, NUMBA_DEVICEARRAY_IMPORT_NAME " failed to import"); |
1082 | | - return MOD_ERROR_VAL; |
1083 | | - } |
1084 | | - |
1085 | 1047 | PyObject *m; |
1086 | 1048 | MOD_DEF(m, "_dispatcher", "No docs", ext_methods) |
1087 | 1049 | if (m == NULL) |
|
0 commit comments