Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pairs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
software
pairs
Commits
838a20c9
Commit
838a20c9
authored
1 year ago
by
Rafael Ravedutti
Browse files
Options
Downloads
Patches
Plain Diff
Fix code for DEM
Signed-off-by:
Rafael Ravedutti
<
rafaelravedutti@gmail.com
>
parent
3ac8cd6f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/pairs/ir/apply.py
+1
-1
1 addition, 1 deletion
src/pairs/ir/apply.py
src/pairs/ir/device.py
+2
-2
2 additions, 2 deletions
src/pairs/ir/device.py
src/pairs/ir/kernel.py
+1
-1
1 addition, 1 deletion
src/pairs/ir/kernel.py
src/pairs/ir/properties.py
+1
-1
1 addition, 1 deletion
src/pairs/ir/properties.py
with
5 additions
and
5 deletions
src/pairs/ir/apply.py
+
1
−
1
View file @
838a20c9
...
@@ -54,7 +54,7 @@ class Apply(Lowerable):
...
@@ -54,7 +54,7 @@ class Apply(Lowerable):
return
self
.
_build_expression_with_index
(
expr
,
index
)[
0
]
return
self
.
_build_expression_with_index
(
expr
,
index
)[
0
]
# TODO: This method should comprise all operators and dynamic data types, it would also be
# TODO: This method should comprise all operators and dynamic data types, it would also be
# better to provide a
better
way to implement it
such as
a Mutator or Visitor
# better to provide a way to implement it
with
a Mutator or Visitor
def
_build_expression_with_index
(
self
,
expr
,
index
):
def
_build_expression_with_index
(
self
,
expr
,
index
):
if
isinstance
(
expr
,
(
ScalarOp
,
VectorOp
)):
if
isinstance
(
expr
,
(
ScalarOp
,
VectorOp
)):
new_lhs
,
changed_lhs
=
self
.
_build_expression_with_index
(
expr
.
lhs
,
index
)
new_lhs
,
changed_lhs
=
self
.
_build_expression_with_index
(
expr
.
lhs
,
index
)
...
...
This diff is collapsed.
Click to expand it.
src/pairs/ir/device.py
+
2
−
2
View file @
838a20c9
...
@@ -72,7 +72,7 @@ class CopyProperty(ASTNode):
...
@@ -72,7 +72,7 @@ class CopyProperty(ASTNode):
class
CopyContactProperty
(
ASTNode
):
class
CopyContactProperty
(
ASTNode
):
def
__init__
(
self
,
sim
,
prop
,
ctx
,
write
):
def
__init__
(
self
,
sim
,
prop
,
ctx
,
action
):
super
().
__init__
(
sim
)
super
().
__init__
(
sim
)
self
.
_contact_prop
=
prop
self
.
_contact_prop
=
prop
self
.
_ctx
=
ctx
self
.
_ctx
=
ctx
...
@@ -89,7 +89,7 @@ class CopyContactProperty(ASTNode):
...
@@ -89,7 +89,7 @@ class CopyContactProperty(ASTNode):
return
self
.
_action
return
self
.
_action
def
children
(
self
):
def
children
(
self
):
return
[
self
.
_prop
]
return
[
self
.
_
contact_
prop
]
class
CopyVar
(
ASTNode
):
class
CopyVar
(
ASTNode
):
...
...
This diff is collapsed.
Click to expand it.
src/pairs/ir/kernel.py
+
1
−
1
View file @
838a20c9
...
@@ -116,7 +116,7 @@ class Kernel(ASTNode):
...
@@ -116,7 +116,7 @@ class Kernel(ASTNode):
new_op
=
'
w
'
if
write
else
'
r
'
new_op
=
'
w
'
if
write
else
'
r
'
for
contact_prop
in
contact_prop_list
:
for
contact_prop
in
contact_prop_list
:
assert
isinstance
(
cp
,
ContactProperty
),
\
assert
isinstance
(
c
ontact_pro
p
,
ContactProperty
),
\
"
Kernel.add_contact_property(): Element is not of type ContactProperty.
"
"
Kernel.add_contact_property(): Element is not of type ContactProperty.
"
action
=
Actions
.
NoAction
if
contact_prop
not
in
self
.
_contact_properties
else
\
action
=
Actions
.
NoAction
if
contact_prop
not
in
self
.
_contact_properties
else
\
...
...
This diff is collapsed.
Click to expand it.
src/pairs/ir/properties.py
+
1
−
1
View file @
838a20c9
...
@@ -258,7 +258,7 @@ class ContactProperty(ASTNode):
...
@@ -258,7 +258,7 @@ class ContactProperty(ASTNode):
def
copy_size
(
self
):
def
copy_size
(
self
):
return
ScalarOp
.
inline
(
self
.
sim
.
nlocal
*
return
ScalarOp
.
inline
(
self
.
sim
.
nlocal
*
self
.
sim
.
neighbor_capacity
*
self
.
sim
.
neighbor_capacity
*
Types
.
number_of_elements
(
self
.
sim
,
self
.
prop_type
)
*
Types
.
number_of_elements
(
self
.
sim
,
self
.
contact_
prop_type
)
*
Sizeof
(
self
.
sim
,
self
.
type
()))
Sizeof
(
self
.
sim
,
self
.
type
()))
def
sizes
(
self
):
def
sizes
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment