Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
loopy
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kaushik Kulkarni
loopy
Commits
166ddd3a
Commit
166ddd3a
authored
9 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Only generate static workgroup size info if workgroup sizes are actually static
parent
851d5e27
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loopy/target/cuda.py
+9
-3
9 additions, 3 deletions
loopy/target/cuda.py
loopy/target/opencl.py
+12
-3
12 additions, 3 deletions
loopy/target/opencl.py
with
21 additions
and
6 deletions
loopy/target/cuda.py
+
9
−
3
View file @
166ddd3a
...
@@ -213,10 +213,16 @@ class CudaTarget(CTarget):
...
@@ -213,10 +213,16 @@ class CudaTarget(CTarget):
_
,
local_grid_size
=
kernel
.
get_grid_sizes_as_exprs
()
_
,
local_grid_size
=
kernel
.
get_grid_sizes_as_exprs
()
from
pytools
import
product
from
loopy.symbolic
import
get_dependencies
nthreads
=
product
(
local_grid_size
)
if
not
get_dependencies
(
local_grid_size
):
# Sizes can't have parameter dependencies if they are
# to be used in static thread block size.
from
pytools
import
product
nthreads
=
product
(
local_grid_size
)
return
CudaLaunchBounds
(
nthreads
,
fdecl
)
fdecl
=
CudaLaunchBounds
(
nthreads
,
fdecl
)
return
fdecl
def
generate_code
(
self
,
kernel
,
codegen_state
,
impl_arg_info
):
def
generate_code
(
self
,
kernel
,
codegen_state
,
impl_arg_info
):
code
,
implemented_domains
=
(
code
,
implemented_domains
=
(
...
...
This diff is collapsed.
Click to expand it.
loopy/target/opencl.py
+
12
−
3
View file @
166ddd3a
...
@@ -239,9 +239,18 @@ class OpenCLTarget(CTarget):
...
@@ -239,9 +239,18 @@ class OpenCLTarget(CTarget):
def
wrap_function_declaration
(
self
,
kernel
,
fdecl
):
def
wrap_function_declaration
(
self
,
kernel
,
fdecl
):
from
cgen.opencl
import
CLKernel
,
CLRequiredWorkGroupSize
from
cgen.opencl
import
CLKernel
,
CLRequiredWorkGroupSize
return
CLRequiredWorkGroupSize
(
fdecl
=
CLKernel
(
fdecl
)
kernel
.
get_grid_sizes_as_exprs
()[
1
],
CLKernel
(
fdecl
))
_
,
local_sizes
=
kernel
.
get_grid_sizes_as_exprs
()
from
loopy.symbolic
import
get_dependencies
if
not
get_dependencies
(
local_sizes
):
# sizes can't have parameter dependencies if they are
# to be used in static WG size.
fdecl
=
CLRequiredWorkGroupSize
(
local_sizes
,
fdecl
)
return
fdecl
def
generate_code
(
self
,
kernel
,
codegen_state
,
impl_arg_info
):
def
generate_code
(
self
,
kernel
,
codegen_state
,
impl_arg_info
):
code
,
implemented_domains
=
(
code
,
implemented_domains
=
(
...
...
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