Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
abfa7d64
Commit
abfa7d64
authored
Aug 13, 2019
by
Stephan Seitz
Browse files
Avoid CUDA intrinsics in OpenCL / Mark some methods as not implemented
parent
38463a9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/backends/opencl_backend.py
View file @
abfa7d64
import
pystencils.data_types
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
...
...
@@ -35,6 +35,12 @@ class OpenClBackend(CudaBackend):
else
:
return
code
def
_print_ThreadBlockSynchronization
(
self
,
node
):
raise
NotImplementedError
()
def
_print_TextureDeclaration
(
self
,
node
):
raise
NotImplementedError
()
class
OpenClSympyPrinter
(
CudaSympyPrinter
):
language
=
"OpenCL"
...
...
@@ -57,3 +63,9 @@ class OpenClSympyPrinter(CudaSympyPrinter):
dimension
=
self
.
DIMENSION_MAPPING
[
dimension
]
function_name
=
self
.
INDEXING_FUNCTION_MAPPING
[
function_name
]
return
f
"
{
function_name
}
(
{
dimension
}
)"
def
_print_TextureAccess
(
self
,
node
):
raise
NotImplementedError
()
# Avoid usage of CUDA intrinsics
_print_Function
=
CustomSympyPrinter
.
_print_Function
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment