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
52e67bc6
Commit
52e67bc6
authored
Feb 8, 2022
by
Jan Hönig
Committed by
Markus Holzer
Feb 10, 2022
Browse files
Options
Downloads
Patches
Plain Diff
Fix RNG test cases
parent
42a9e630
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!292
Rebase of pystencils Type System
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/backends/cbackend.py
+1
-1
1 addition, 1 deletion
pystencils/backends/cbackend.py
pystencils_tests/test_conditional_vec.py
+2
-3
2 additions, 3 deletions
pystencils_tests/test_conditional_vec.py
with
3 additions
and
4 deletions
pystencils/backends/cbackend.py
+
1
−
1
View file @
52e67bc6
...
@@ -611,7 +611,7 @@ class VectorizedCustomSympyPrinter(CustomSympyPrinter):
...
@@ -611,7 +611,7 @@ class VectorizedCustomSympyPrinter(CustomSympyPrinter):
basic_data_type
=
data_type
.
base_type
basic_data_type
=
data_type
.
base_type
symbol
=
self
.
_print
(
expr
)
symbol
=
self
.
_print
(
expr
)
if
basic_data_type
!=
expr
.
dtype
:
if
basic_data_type
!=
expr
.
dtype
:
symbol
=
f
'
((
{
basic_data_type
.
data_type
}
)(
{
symbol
}
))
'
symbol
=
f
'
((
{
basic_data_type
}
)(
{
symbol
}
))
'
instruction
=
'
makeVecConst
'
instruction
=
'
makeVecConst
'
if
basic_data_type
.
is_bool
():
if
basic_data_type
.
is_bool
():
...
...
This diff is collapsed.
Click to expand it.
pystencils_tests/test_conditional_vec.py
+
2
−
3
View file @
52e67bc6
...
@@ -86,7 +86,7 @@ def test_boolean_before_loop():
...
@@ -86,7 +86,7 @@ def test_boolean_before_loop():
ast
=
ps
.
create_kernel
(
a
,
cpu_vectorize_info
=
{
'
instruction_set
'
:
supported_instruction_sets
[
-
1
]})
ast
=
ps
.
create_kernel
(
a
,
cpu_vectorize_info
=
{
'
instruction_set
'
:
supported_instruction_sets
[
-
1
]})
kernel
=
ast
.
compile
()
kernel
=
ast
.
compile
()
kernel
(
f
=
f_arr
,
g
=
g_arr
,
t2
=
1.0
)
kernel
(
f
=
f_arr
,
g
=
g_arr
,
t2
=
1.0
)
print
(
g
)
#
print(g)
np
.
testing
.
assert_array_equal
(
g_arr
,
1.0
)
np
.
testing
.
assert_array_equal
(
g_arr
,
1.0
)
kernel
(
f
=
f_arr
,
g
=
g_arr
,
t2
=-
1.0
)
kernel
(
f
=
f_arr
,
g
=
g_arr
,
t2
=-
1.0
)
np
.
testing
.
assert_array_equal
(
g_arr
,
42.0
)
np
.
testing
.
assert_array_equal
(
g_arr
,
42.0
)
...
@@ -102,8 +102,7 @@ def test_vec_maskstore(instruction_set, dtype):
...
@@ -102,8 +102,7 @@ def test_vec_maskstore(instruction_set, dtype):
c
=
[
Conditional
(
data
.
center
()
<
1.0
,
Block
([
SympyAssignment
(
data
.
center
(),
2.0
)]))]
c
=
[
Conditional
(
data
.
center
()
<
1.0
,
Block
([
SympyAssignment
(
data
.
center
(),
2.0
)]))]
assignmets
=
NodeCollection
(
c
)
assignmets
=
NodeCollection
(
c
)
ast
=
ps
.
create_kernel
(
assignmets
,
target
=
Target
.
CPU
,
ast
=
ps
.
create_kernel
(
assignmets
,
target
=
Target
.
CPU
,
cpu_vectorize_info
=
{
'
instruction_set
'
:
instruction_set
})
cpu_vectorize_info
=
{
'
instruction_set
'
:
instruction_set
})
kernel
=
ast
.
compile
()
kernel
=
ast
.
compile
()
kernel
(
data
=
data_arr
)
kernel
(
data
=
data_arr
)
np
.
testing
.
assert_equal
(
data_arr
[:
3
,
:],
2.0
)
np
.
testing
.
assert_equal
(
data_arr
[:
3
,
:],
2.0
)
...
...
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