comparison PyTypeInterface.cpp @ 72:ffaa1fb3d7de vampyhost

inline is not a useful keyword with contemporary compilers
author Chris Cannam
date Mon, 24 Nov 2014 09:50:49 +0000
parents 40a01bb24209
children
comparison
equal deleted inserted replaced
71:40a01bb24209 72:ffaa1fb3d7de
228 228
229 /* Convert Sample Buffers to Python */ 229 /* Convert Sample Buffers to Python */
230 230
231 /// passing the sample buffers as builtin python lists 231 /// passing the sample buffers as builtin python lists
232 /// Optimization: using fast sequence protocol 232 /// Optimization: using fast sequence protocol
233 inline PyObject* 233 PyObject*
234 PyTypeInterface::InputBuffers_As_PythonLists(const float *const *inputBuffers,const size_t& channels, const size_t& blockSize, const Vamp::Plugin::InputDomain& dtype) 234 PyTypeInterface::InputBuffers_As_PythonLists(const float *const *inputBuffers,const size_t& channels, const size_t& blockSize, const Vamp::Plugin::InputDomain& dtype)
235 { 235 {
236 //create a list of lists (new references) 236 //create a list of lists (new references)
237 PyObject *pyChannelList = PyList_New((Py_ssize_t) channels); 237 PyObject *pyChannelList = PyList_New((Py_ssize_t) channels);
238 238
287 return pyChannelList; 287 return pyChannelList;
288 } 288 }
289 289
290 /// numpy buffer interface: passing the sample buffers as shared memory buffers 290 /// numpy buffer interface: passing the sample buffers as shared memory buffers
291 /// Optimization: using sequence protocol for creating the buffer list 291 /// Optimization: using sequence protocol for creating the buffer list
292 inline PyObject* 292 PyObject*
293 PyTypeInterface::InputBuffers_As_SharedMemoryList(const float *const *inputBuffers,const size_t& channels, const size_t& blockSize, const Vamp::Plugin::InputDomain& dtype) 293 PyTypeInterface::InputBuffers_As_SharedMemoryList(const float *const *inputBuffers,const size_t& channels, const size_t& blockSize, const Vamp::Plugin::InputDomain& dtype)
294 { 294 {
295 //create a list of buffers (returns new references) 295 //create a list of buffers (returns new references)
296 PyObject *pyChannelList = PyList_New((Py_ssize_t) channels); 296 PyObject *pyChannelList = PyList_New((Py_ssize_t) channels);
297 PyObject **pyChannelListArray = PySequence_Fast_ITEMS(pyChannelList); 297 PyObject **pyChannelListArray = PySequence_Fast_ITEMS(pyChannelList);
318 318
319 319
320 /// numpy array interface: passing the sample buffers as 2D numpy array 320 /// numpy array interface: passing the sample buffers as 2D numpy array
321 /// Optimization: using array API (needs numpy headers) 321 /// Optimization: using array API (needs numpy headers)
322 #ifdef HAVE_NUMPY 322 #ifdef HAVE_NUMPY
323 inline PyObject* 323 PyObject*
324 PyTypeInterface::InputBuffers_As_NumpyArray(const float *const *inputBuffers,const size_t& channels, const size_t& blockSize, const Vamp::Plugin::InputDomain& dtype) 324 PyTypeInterface::InputBuffers_As_NumpyArray(const float *const *inputBuffers,const size_t& channels, const size_t& blockSize, const Vamp::Plugin::InputDomain& dtype)
325 { 325 {
326 /* 326 /*
327 NOTE: We create a list of 1D Numpy arrays for each channel instead 327 NOTE: We create a list of 1D Numpy arrays for each channel instead
328 of a matrix, because the address space of inputBuffers doesn't seem 328 of a matrix, because the address space of inputBuffers doesn't seem