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
480f6687
Commit
480f6687
authored
Mar 13, 2012
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ndarray specialization
parent
1eabb1c6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
1 deletion
+13
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-0
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+3
-0
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+7
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
480f6687
...
...
@@ -623,7 +623,7 @@ class ExprNode(Node):
return
self
if
src_type
.
is_fused
:
error
(
self
.
pos
,
"Type is not speci
fic
"
)
error
(
self
.
pos
,
"Type is not speci
alized
"
)
else
:
error
(
self
.
pos
,
"Cannot coerce to a type that is not specialized"
)
...
...
Cython/Compiler/Nodes.py
View file @
480f6687
...
...
@@ -963,6 +963,8 @@ class TemplatedTypeNode(CBaseTypeNode):
for
name
,
value
in
options
.
items
()
])
self
.
type
=
PyrexTypes
.
BufferType
(
base_type
,
**
options
)
if
self
.
type
.
is_fused
and
env
.
fused_to_specific
:
self
.
type
=
self
.
type
.
specialize
(
env
.
fused_to_specific
)
else
:
# Array
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
480f6687
...
...
@@ -1495,12 +1495,15 @@ if VALUE is not None:
self
.
fused_function
=
None
if
node
.
py_func
:
# Create PyCFunction nodes for each specialization
node
.
stats
.
insert
(
0
,
node
.
py_func
)
node
.
py_func
=
self
.
visit
(
node
.
py_func
)
pycfunc
=
ExprNodes
.
PyCFunctionNode
.
from_defnode
(
node
.
py_func
,
True
)
pycfunc
=
ExprNodes
.
ProxyNode
(
pycfunc
.
coerce_to_temp
(
env
))
node
.
resulting_fused_function
=
pycfunc
# Create assignment node for our def function
node
.
fused_func_assignment
=
self
.
_create_assignment
(
node
.
py_func
,
ExprNodes
.
CloneNode
(
pycfunc
),
env
)
else
:
...
...
Cython/Compiler/PyrexTypes.py
View file @
480f6687
...
...
@@ -767,6 +767,13 @@ class BufferType(BaseType):
def
as_argument_type
(
self
):
return
self
def
specialize
(
self
,
values
):
dtype
=
self
.
dtype
.
specialize
(
values
)
if
dtype
is
not
self
.
dtype
:
return
BufferType
(
self
.
base
,
dtype
,
self
.
ndim
,
self
.
mode
,
self
.
negative_indices
,
self
.
cast
)
return
self
def
__getattr__
(
self
,
name
):
return
getattr
(
self
.
base
,
name
)
...
...
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