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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
6f5970a6
Commit
6f5970a6
authored
Feb 21, 2021
by
Michael Kuron
Browse files
Options
Downloads
Patches
Plain Diff
make detection of scalar RNG after substitution more robust
parent
cd2007fe
No related branches found
No related tags found
1 merge request
!219
Make RNG vectorization more robust
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/rng.py
+2
-2
2 additions, 2 deletions
pystencils/rng.py
with
2 additions
and
2 deletions
pystencils/rng.py
+
2
−
2
View file @
6f5970a6
...
...
@@ -2,7 +2,7 @@ import copy
import
numpy
as
np
import
sympy
as
sp
from
pystencils.data_types
import
TypedSymbol
from
pystencils.data_types
import
TypedSymbol
,
cast_func
from
pystencils.astnodes
import
LoopOverCoordinate
from
pystencils.backends.cbackend
import
CustomCodeNode
from
pystencils.sympyextensions
import
fast_subs
...
...
@@ -47,7 +47,7 @@ class RNGBase(CustomCodeNode):
def
get_code
(
self
,
dialect
,
vector_instruction_set
,
print_arg
):
code
=
"
\n
"
for
r
in
self
.
result_symbols
:
if
vector_instruction_set
and
isinstance
(
self
.
args
[
1
]
,
sp
.
Integer
):
if
vector_instruction_set
and
not
self
.
args
[
1
]
.
atoms
(
cast_func
):
# this vector RNG has become scalar through substitution
code
+=
f
"
{
r
.
dtype
}
{
r
.
name
}
;
\n
"
else
:
...
...
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
sign in
to comment