Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
9d3e1113
Commit
9d3e1113
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add target option to LLVMPrinter
parent
946f812d
No related branches found
No related tags found
1 merge request
!53
Compile CUDA using the LLVM backend
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/llvm/llvm.py
+2
-1
2 additions, 1 deletion
pystencils/llvm/llvm.py
with
2 additions
and
1 deletion
pystencils/llvm/llvm.py
+
2
−
1
View file @
9d3e1113
...
...
@@ -35,7 +35,7 @@ def generate_llvm(ast_node, module=None, builder=None):
class
LLVMPrinter
(
Printer
):
"""
Convert expressions to LLVM IR
"""
def
__init__
(
self
,
module
,
builder
,
fn
=
None
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
module
,
builder
,
fn
=
None
,
target
=
'
cpu
'
,
*
args
,
**
kwargs
):
self
.
func_arg_map
=
kwargs
.
pop
(
"
func_arg_map
"
,
{})
super
(
LLVMPrinter
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
fp_type
=
ir
.
DoubleType
()
...
...
@@ -48,6 +48,7 @@ class LLVMPrinter(Printer):
self
.
fn
=
fn
self
.
ext_fn
=
{}
# keep track of wrappers to external functions
self
.
tmp_var
=
{}
self
.
target
=
target
def
_add_tmp_var
(
self
,
name
,
value
):
self
.
tmp_var
[
name
]
=
value
...
...
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