Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
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
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kaushik Kulkarni
loopy
Commits
d21e4963
Commit
d21e4963
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Fix alignment of aliased temporary storage
parent
238c80e7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loopy/target/c/__init__.py
+15
-1
15 additions, 1 deletion
loopy/target/c/__init__.py
loopy/target/c/compyte
+1
-1
1 addition, 1 deletion
loopy/target/c/compyte
with
16 additions
and
2 deletions
loopy/target/c/__init__.py
+
15
−
1
View file @
d21e4963
...
...
@@ -91,8 +91,9 @@ class CTarget(TargetBase):
base_storage_sizes
=
{}
base_storage_to_is_local
=
{}
base_storage_to_align_bytes
=
{}
from
cgen
import
ArrayOf
,
Pointer
,
Initializer
from
cgen
import
ArrayOf
,
Pointer
,
Initializer
,
AlignedAttribute
from
loopy.codegen
import
POD
# uses the correct complex type
from
cgen.opencl
import
CLLocal
...
...
@@ -124,6 +125,16 @@ class CTarget(TargetBase):
base_storage_to_is_local
.
setdefault
(
tv
.
base_storage
,
[]).
append
(
tv
.
is_local
)
align_size
=
tv
.
dtype
.
itemsize
from
loopy.kernel.array
import
VectorArrayDimTag
for
dim_tag
,
axis_len
in
zip
(
tv
.
dim_tags
,
tv
.
shape
):
if
isinstance
(
dim_tag
,
VectorArrayDimTag
):
align_size
*=
axis_len
base_storage_to_align_bytes
.
setdefault
(
tv
.
base_storage
,
[]).
append
(
align_size
)
for
idi
in
decl_info
:
cast_decl
=
POD
(
self
,
idi
.
dtype
,
""
)
temp_var_decl
=
POD
(
self
,
idi
.
dtype
,
idi
.
name
)
...
...
@@ -162,6 +173,9 @@ class CTarget(TargetBase):
bs_var_decl
=
ArrayOf
(
bs_var_decl
,
max
(
bs_sizes
))
alignment
=
max
(
base_storage_to_align_bytes
[
bs_name
])
bs_var_decl
=
AlignedAttribute
(
alignment
,
bs_var_decl
)
body
.
append
(
bs_var_decl
)
body
.
extend
(
temp_decls
)
...
...
This diff is collapsed.
Click to expand it.
compyte
@
fb6ba114
Compare
ac1c71d4
...
fb6ba114
Subproject commit
ac1c71d46428c14aa1bd1c09d7da19cd0298d5cc
Subproject commit
fb6ba114d9d906403d47b0aaf69e2fe4cef382f2
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