Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions src/RipTide.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ PyArrayObject* AllocateNumpyArrayForData(int ndim, npy_intp* dims, int32_t numpy
// nullify string for special matlab runt case
*pData = 0;
}


if (!returnObject) {
printf("!!!out of memory allocating numpy array size:%llu dims:%d dtype:%d itemsize:%lld flags:%d dim0:%lld\n", len, ndim, numpyType, itemsize, array_flags, (int64_t)dims[0]);
Expand Down Expand Up @@ -961,12 +961,12 @@ bool ConvertSingleItemArray(void* pInput, int16_t numpyInType, _m256all* pDest,
fvalue = (double)value;
break;
CASE_NPY_UINT64:

value = (int64_t)*(uint64_t*)pInput;
fvalue = (double)value;
break;
CASE_NPY_INT64:

value = (int64_t)*(int64_t*)pInput;
fvalue = (double)value;
break;
Expand Down Expand Up @@ -998,9 +998,9 @@ bool ConvertSingleItemArray(void* pInput, int16_t numpyInType, _m256all* pDest,
pDest->i = _mm256_set1_epi32((int32_t)value);
break;
CASE_NPY_UINT64:

CASE_NPY_INT64:

pDest->ci.i1 = _mm_set1_epi64x(value);
pDest->ci.i2 = _mm_set1_epi64x(value);
break;
Expand Down Expand Up @@ -1071,7 +1071,7 @@ bool ConvertScalarObject(PyObject* inObject1, _m256all* pDest, int16_t numpyOutT
pDest->i = _mm256_set1_epi32((int32_t)value);
break;
CASE_NPY_UINT64:

CASE_NPY_INT64:

pDest->ci.i1 = _mm_set1_epi64x(value);
Expand Down Expand Up @@ -1151,12 +1151,12 @@ bool ConvertScalarObject(PyObject* inObject1, _m256all* pDest, int16_t numpyOutT
pDest->i = _mm256_set1_epi32((uint32_t)value2);
break;
CASE_NPY_INT64:

pDest->ci.i1 = _mm_set1_epi64x(value);
pDest->ci.i2 = _mm_set1_epi64x(value);
break;
CASE_NPY_UINT64:

pDest->ci.i1 = _mm_set1_epi64x(value2);
pDest->ci.i2 = _mm_set1_epi64x(value2);
break;
Expand Down Expand Up @@ -1196,12 +1196,12 @@ bool ConvertScalarObject(PyObject* inObject1, _m256all* pDest, int16_t numpyOutT
pDest->i = _mm256_set1_epi32((int32_t)value);
break;
CASE_NPY_UINT64:

pDest->ci.i1 = _mm_set1_epi64x((uint64_t)value);
pDest->ci.i2 = _mm_set1_epi64x((uint64_t)value);
break;
CASE_NPY_INT64:

pDest->ci.i1 = _mm_set1_epi64x((int64_t)value);
pDest->ci.i2 = _mm_set1_epi64x((int64_t)value);
break;
Expand All @@ -1228,7 +1228,11 @@ bool ConvertScalarObject(PyObject* inObject1, _m256all* pDest, int16_t numpyOutT
}
else if (PyUnicode_Check(inObject1)) {
// happens when pass in 'test'
*pItemSize = PyUnicode_GET_SIZE(inObject1) * 4;
if (PyUnicode_READY(inObject1) < 0) {
printf("!!unable to make UNICODE object ready");
return false;
}
*pItemSize = PyUnicode_GET_LENGTH(inObject1) * 4;
// memory leak needs to be deleted
*ppDataIn = PyUnicode_AsUCS4Copy(inObject1);
return true;
Expand Down Expand Up @@ -1944,7 +1948,7 @@ PyMODINIT_FUNC PyInit_riptide_cpp() {
LOGGING("An error occurred when creating/registering SDS Python types.");
return NULL;
}

// start up the worker threads now in case we use them
g_cMathWorker->StartWorkerThreads(0);

Expand Down Expand Up @@ -1991,12 +1995,12 @@ void* GetDefaultForType(int numpyInType) {
case NPY_INT16:
pgDefault = &gDefaultInt16;
break;
CASE_NPY_INT32:
CASE_NPY_INT32:
// case NPY_INT: This is the same numeric value as NPY_INT32 above
pgDefault = &gDefaultInt32;
break;
CASE_NPY_INT64:

pgDefault = &gDefaultInt64;
break;
case NPY_UINT8:
Expand All @@ -2010,7 +2014,7 @@ void* GetDefaultForType(int numpyInType) {
pgDefault = &gDefaultUInt32;
break;
CASE_NPY_UINT64:

pgDefault = &gDefaultUInt64;
break;
case NPY_STRING:
Expand Down
Loading