Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephan Seitz
pystencils
Commits
aff0c6b8
Commit
aff0c6b8
authored
Sep 26, 2019
by
Stephan Seitz
Browse files
Let show_code also work for KernelWrapper
parent
afe8c892
Pipeline
#18421
passed with stage
in 3 minutes and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pystencils/display_utils.py
View file @
aff0c6b8
...
...
@@ -3,6 +3,7 @@ from typing import Any, Dict, Optional
import
sympy
as
sp
from
pystencils.astnodes
import
KernelFunction
from
pystencils.kernel_wrapper
import
KernelWrapper
def
to_dot
(
expr
:
sp
.
Expr
,
graph_style
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
short
=
True
):
...
...
@@ -40,6 +41,10 @@ def show_code(ast: KernelFunction, custom_backend=None):
Can either be displayed as HTML in Jupyter notebooks or printed as normal string.
"""
from
pystencils.backends.cbackend
import
generate_c
if
isinstance
(
ast
,
KernelWrapper
):
ast
=
ast
.
ast
dialect
=
'cuda'
if
ast
.
backend
==
'gpucuda'
else
'c'
class
CodeDisplay
:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment