Robert Bradshaw wrote:
> On Oct 25, 2009, at 7:33 AM, Stefan Behnel wrote:
> 
>> Hi all,
>>
>> the wiki has an enhancement page on better C array support.
>>
>> http://wiki.cython.org/enhancements/arraytypes
>>
>> Note that this is not about SIMD operations and whatnot, just about  
>> plain
>>
>>      int[] x
>>
>> The page mentions things like dynamic memory allocation happening
>> automatically behind the scenes, so that
>>
>>      cdef int a[runtime_size]
>>
>> would locally allocate memory, as would subsequent slicing, I guess. I
>> wonder if that's not too much magic, and if a much simpler thing  
>> wouldn't
>> get us far enough already.
> 
> I think dynamic memory allocation is the primary advantage of such a  
> type, though the proposed SIMD type would meet these needs as well.

Just a few notes on terminology (and feel free to protest if you think 
this is wrong):

  a) Me and Kurt decided to use the name "memoryview" everywhere in the 
code written in summer. The essential feature of the proposed Cython 
type described in enhancements/array is a) a view to a reference-counted 
PEP 3118 buffer, b) slices returns new sub-views. This is exactly what 
the Python memoryview type does. Cython adds static typing to this, but 
we decided to also name the Cython concept memoryview.

  b) There was a recent discussion on numpy-discuss where people reacted 
on using the term SIMD for anything but CPU SIMD (i.e. many people 
understand "Instruction" in SIMD to refer exclusively to CPU 
instructions). Some voiced opposition to this view as well, but to avoid 
any ambiguity I suppose "vectorized operation" is the most neutral (and 
that's got nothing to do with the vectors of linear algebra! As I've 
said in other places, some of my vectors are sometimes stored as 2D 
arrays and some of my matrices in 1D arrays...)

If I don't get a response to this I'll update the wiki accordingly.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to