Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
f4db6743
Commit
f4db6743
authored
Aug 03, 2009
by
Kurt Smith
Committed by
Mark Florisson
Sep 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
consistent naming scheme for memoryviews and memoryview slices.
parent
a7697342
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
24 deletions
+23
-24
Cython/Compiler/CythonScope.py
Cython/Compiler/CythonScope.py
+15
-15
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+0
-1
Cython/Compiler/MemoryView.py
Cython/Compiler/MemoryView.py
+6
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+2
-2
No files found.
Cython/Compiler/CythonScope.py
View file @
f4db6743
...
@@ -94,9 +94,9 @@ class CythonScope(ModuleScope):
...
@@ -94,9 +94,9 @@ class CythonScope(ModuleScope):
#
#
self
.
memviewentry
=
entry
=
viewscope
.
declare_c_class
(
memview_name
,
None
,
self
.
memviewentry
=
entry
=
viewscope
.
declare_c_class
(
memview_name
,
None
,
implementing
=
1
,
implementing
=
1
,
objstruct_cname
=
memview
ext
_objstruct_cname
,
objstruct_cname
=
memview_objstruct_cname
,
typeobj_cname
=
memview
ext
_typeobj_cname
,
typeobj_cname
=
memview_typeobj_cname
,
typeptr_cname
=
memview
ext
_typeptr_cname
)
typeptr_cname
=
memview_typeptr_cname
)
entry
.
utility_code_definition
=
view_utility_code
entry
.
utility_code_definition
=
view_utility_code
...
@@ -236,9 +236,9 @@ cdef object _testscope(int value):
...
@@ -236,9 +236,9 @@ cdef object _testscope(int value):
"""
)
"""
)
memview_name
=
u'memoryview'
memview_name
=
u'memoryview'
memview
ext
_typeptr_cname
=
Naming
.
typeptr_prefix
+
memview_name
memview_typeptr_cname
=
Naming
.
typeptr_prefix
+
memview_name
memview
ext
_typeobj_cname
=
'__pyx_tobj_'
+
memview_name
memview_typeobj_cname
=
'__pyx_tobj_'
+
memview_name
memview
ext
_objstruct_cname
=
'__pyx_obj_'
+
memview_name
memview_objstruct_cname
=
'__pyx_obj_'
+
memview_name
view_utility_code
=
CythonUtilityCode
(
u"""
view_utility_code
=
CythonUtilityCode
(
u"""
cdef class Enum(object):
cdef class Enum(object):
cdef object name
cdef object name
...
@@ -289,8 +289,8 @@ cdef extern from *:
...
@@ -289,8 +289,8 @@ cdef extern from *:
ctypedef struct __Pyx_mv_DimInfo:
ctypedef struct __Pyx_mv_DimInfo:
Py_ssize_t shape, strides, suboffsets
Py_ssize_t shape, strides, suboffsets
ctypedef struct __Pyx_memviews
truct
:
ctypedef struct __Pyx_memviews
lice
:
__pyx_obj_memoryview *memview
ext
__pyx_obj_memoryview *memview
char *data
char *data
__Pyx_mv_DimInfo diminfo[BUF_MAX_NDIMS]
__Pyx_mv_DimInfo diminfo[BUF_MAX_NDIMS]
...
@@ -316,13 +316,13 @@ cdef is_cf_contig(int *specs, int ndim):
...
@@ -316,13 +316,13 @@ cdef is_cf_contig(int *specs, int ndim):
return is_c_contig, is_f_contig
return is_c_contig, is_f_contig
cdef object pyxmemview_from_memview(
cdef object pyxmemview
slice
_from_memview(
memoryview memview,
memoryview memview,
int *axes_specs,
int *axes_specs,
int ndim,
int ndim,
Py_ssize_t itemsize,
Py_ssize_t itemsize,
char *format,
char *format,
__Pyx_memviews
truct *pyx_memview
):
__Pyx_memviews
lice *memviewslice
):
cdef int i
cdef int i
...
@@ -384,13 +384,13 @@ cdef object pyxmemview_from_memview(
...
@@ -384,13 +384,13 @@ cdef object pyxmemview_from_memview(
stride = stride * pybuf.shape[i]
stride = stride * pybuf.shape[i]
for i in range(ndim):
for i in range(ndim):
pyx_memview
.diminfo[i].strides = pybuf.strides[i]
memviewslice
.diminfo[i].strides = pybuf.strides[i]
pyx_memview
.diminfo[i].shape = pybuf.shape[i]
memviewslice
.diminfo[i].shape = pybuf.shape[i]
if has_suboffsets:
if has_suboffsets:
pyx_memview
.diminfo[i].suboffsets = pybuf.suboffsets[i]
memviewslice
.diminfo[i].suboffsets = pybuf.suboffsets[i]
pyx_memview.memviewext
= <__pyx_obj_memoryview*>memview
memviewslice.memview
= <__pyx_obj_memoryview*>memview
pyx_memview
.data = <char *>pybuf.buf
memviewslice
.data = <char *>pybuf.buf
"""
%
Options
.
buffer_max_dims
,
name
=
"foobar"
,
prefix
=
"__pyx_viewaxis_"
)
"""
%
Options
.
buffer_max_dims
,
name
=
"foobar"
,
prefix
=
"__pyx_viewaxis_"
)
...
...
Cython/Compiler/ExprNodes.py
View file @
f4db6743
...
@@ -1698,7 +1698,6 @@ class NameNode(AtomicExprNode):
...
@@ -1698,7 +1698,6 @@ class NameNode(AtomicExprNode):
def
generate_acquire_memoryview
(
self
,
rhs
,
code
):
def
generate_acquire_memoryview
(
self
,
rhs
,
code
):
import
MemoryView
import
MemoryView
import
pdb
;
pdb
.
set_trace
()
MemoryView
.
put_assign_to_memview
(
self
.
result
(),
rhs
.
result
(),
self
.
entry
,
MemoryView
.
put_assign_to_memview
(
self
.
result
(),
rhs
.
result
(),
self
.
entry
,
is_initialized
=
not
self
.
lhs_of_first_assignment
,
is_initialized
=
not
self
.
lhs_of_first_assignment
,
pos
=
self
.
pos
,
code
=
code
)
pos
=
self
.
pos
,
code
=
code
)
...
...
Cython/Compiler/MemoryView.py
View file @
f4db6743
...
@@ -332,22 +332,22 @@ spec_constants_code = UtilityCode(proto="""
...
@@ -332,22 +332,22 @@ spec_constants_code = UtilityCode(proto="""
"""
"""
)
)
memviews
truct_cname
=
u'__Pyx_memviewstruct
'
memviews
lice_cname
=
u'__Pyx_memviewslice
'
memviews
truct
_declare_code
=
UtilityCode
(
proto
=
"""
memviews
lice
_declare_code
=
UtilityCode
(
proto
=
"""
/* memoryview struct */
/* memoryview s
lice s
truct */
typedef struct {
typedef struct {
Py_ssize_t shape, strides, suboffsets;
Py_ssize_t shape, strides, suboffsets;
} __Pyx_mv_DimInfo;
} __Pyx_mv_DimInfo;
typedef struct {
typedef struct {
struct %s *memview
ext
;
struct %s *memview;
char *data;
char *data;
__Pyx_mv_DimInfo diminfo[%d];
__Pyx_mv_DimInfo diminfo[%d];
} %s;
} %s;
"""
%
(
CythonScope
.
memview
ext
_objstruct_cname
,
"""
%
(
CythonScope
.
memview_objstruct_cname
,
Options
.
buffer_max_dims
,
Options
.
buffer_max_dims
,
memviews
truct
_cname
)
memviews
lice
_cname
)
)
)
Cython/Compiler/PyrexTypes.py
View file @
f4db6743
...
@@ -362,9 +362,9 @@ class MemoryViewType(PyrexType):
...
@@ -362,9 +362,9 @@ class MemoryViewType(PyrexType):
assert
not
pyrex
assert
not
pyrex
assert
not
dll_linkage
assert
not
dll_linkage
import
MemoryView
import
MemoryView
self
.
env
.
use_utility_code
(
MemoryView
.
memviews
truct
_declare_code
)
self
.
env
.
use_utility_code
(
MemoryView
.
memviews
lice
_declare_code
)
return
self
.
base_declaration_code
(
return
self
.
base_declaration_code
(
MemoryView
.
memviews
truct
_cname
,
MemoryView
.
memviews
lice
_cname
,
entity_code
)
entity_code
)
class
BufferType
(
BaseType
):
class
BufferType
(
BaseType
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment