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
f469e70e
Commit
f469e70e
authored
3 months ago
by
Richard Angersbach
Browse files
Options
Downloads
Patches
Plain Diff
Extend test_reduction_gpu with assume_warp_aligned_block_size and use_block_fitting parameters
parent
b008a9e9
No related branches found
No related tags found
1 merge request
!438
Reduction Support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/kernelcreation/test_reduction.py
+14
-3
14 additions, 3 deletions
tests/kernelcreation/test_reduction.py
with
14 additions
and
3 deletions
tests/kernelcreation/test_reduction.py
+
14
−
3
View file @
f469e70e
...
...
@@ -52,7 +52,14 @@ def test_reduction_cpu(instruction_set, dtype, op):
@pytest.mark.parametrize
(
"
dtype
"
,
[
"
float64
"
,
"
float32
"
])
@pytest.mark.parametrize
(
"
op
"
,
[
"
+
"
,
"
-
"
,
"
*
"
,
"
min
"
,
"
max
"
])
def
test_reduction_gpu
(
dtype
,
op
):
@pytest.mark.parametrize
(
"
assume_warp_aligned_block_size
"
,
[
True
,
False
])
@pytest.mark.parametrize
(
"
use_block_fitting
"
,
[
True
,
False
])
def
test_reduction_gpu
(
dtype
:
str
,
op
:
str
,
assume_warp_aligned_block_size
:
bool
,
use_block_fitting
:
bool
,
):
try
:
import
cupy
as
cp
from
cupy_backends.cuda.api.runtime
import
CUDARuntimeError
...
...
@@ -66,12 +73,16 @@ def test_reduction_gpu(dtype, op):
reason
=
"
No CUDA capable device is detected
"
,
allow_module_level
=
True
)
config
=
ps
.
CreateKernelConfig
(
target
=
ps
.
Target
.
GPU
)
cfg
=
ps
.
CreateKernelConfig
(
target
=
ps
.
Target
.
GPU
)
cfg
.
gpu
.
assume_warp_aligned_block_size
=
assume_warp_aligned_block_size
ast_reduction
=
get_reduction_assign_ast
(
dtype
,
op
,
c
onfi
g
)
ast_reduction
=
get_reduction_assign_ast
(
dtype
,
op
,
c
f
g
)
ps
.
show_code
(
ast_reduction
)
kernel_reduction
=
ast_reduction
.
compile
()
if
use_block_fitting
:
kernel_reduction
.
launch_config
.
fit_block_size
((
32
,
1
,
1
))
array
=
np
.
full
((
SIZE
,),
INIT_ARR
,
dtype
=
dtype
)
reduction_array
=
np
.
full
((
1
,),
INIT_W
,
dtype
=
dtype
)
...
...
This diff is collapsed.
Click to expand it.
Frederik Hennig
@da15siwa
mentioned in commit
4e688b86
·
2 months ago
mentioned in commit
4e688b86
mentioned in commit 4e688b867339c90a6fba3ad12c383d1e59211ed9
Toggle commit list
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