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
abfa7d64
Commit
abfa7d64
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Avoid CUDA intrinsics in OpenCL / Mark some methods as not implemented
parent
38463a9b
No related branches found
No related tags found
1 merge request
!29
Basic support for OpenCL (experimental)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pystencils/backends/opencl_backend.py
+13
-1
13 additions, 1 deletion
pystencils/backends/opencl_backend.py
with
13 additions
and
1 deletion
pystencils/backends/opencl_backend.py
+
13
−
1
View file @
abfa7d64
import
pystencils.data_types
import
pystencils.data_types
from
pystencils.astnodes
import
Node
from
pystencils.astnodes
import
Node
from
pystencils.backends.cbackend
import
generate_c
from
pystencils.backends.cbackend
import
CustomSympyPrinter
,
generate_c
from
pystencils.backends.cuda_backend
import
CudaBackend
,
CudaSympyPrinter
from
pystencils.backends.cuda_backend
import
CudaBackend
,
CudaSympyPrinter
...
@@ -35,6 +35,12 @@ class OpenClBackend(CudaBackend):
...
@@ -35,6 +35,12 @@ class OpenClBackend(CudaBackend):
else
:
else
:
return
code
return
code
def
_print_ThreadBlockSynchronization
(
self
,
node
):
raise
NotImplementedError
()
def
_print_TextureDeclaration
(
self
,
node
):
raise
NotImplementedError
()
class
OpenClSympyPrinter
(
CudaSympyPrinter
):
class
OpenClSympyPrinter
(
CudaSympyPrinter
):
language
=
"
OpenCL
"
language
=
"
OpenCL
"
...
@@ -57,3 +63,9 @@ class OpenClSympyPrinter(CudaSympyPrinter):
...
@@ -57,3 +63,9 @@ class OpenClSympyPrinter(CudaSympyPrinter):
dimension
=
self
.
DIMENSION_MAPPING
[
dimension
]
dimension
=
self
.
DIMENSION_MAPPING
[
dimension
]
function_name
=
self
.
INDEXING_FUNCTION_MAPPING
[
function_name
]
function_name
=
self
.
INDEXING_FUNCTION_MAPPING
[
function_name
]
return
f
"
{
function_name
}
(
{
dimension
}
)
"
return
f
"
{
function_name
}
(
{
dimension
}
)
"
def
_print_TextureAccess
(
self
,
node
):
raise
NotImplementedError
()
# Avoid usage of CUDA intrinsics
_print_Function
=
CustomSympyPrinter
.
_print_Function
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