Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tom Harke
pystencils
Commits
974febd7
Commit
974febd7
authored
Nov 18, 2019
by
Martin Bauer
Browse files
Merge branch 'macos' into 'master'
OpenCL macOS support See merge request
pycodegen/pystencils!87
parents
33648089
885fc9c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
pystencils/backends/opencl_backend.py
View file @
974febd7
...
...
@@ -73,7 +73,7 @@ class OpenClSympyPrinter(CudaSympyPrinter):
function_name
,
dimension
=
tuple
(
symbol_name
.
split
(
"."
))
dimension
=
self
.
DIMENSION_MAPPING
[
dimension
]
function_name
=
self
.
INDEXING_FUNCTION_MAPPING
[
function_name
]
return
f
"
{
function_name
}
(
{
dimension
}
)"
return
f
"
int(
{
function_name
}
(
{
dimension
}
)
)
"
def
_print_TextureAccess
(
self
,
node
):
raise
NotImplementedError
()
...
...
pystencils/opencl/opencljit.py
View file @
974febd7
...
...
@@ -30,6 +30,16 @@ def make_python_function(kernel_function_node, opencl_queue, opencl_ctx, argumen
if
argument_dict
is
None
:
argument_dict
=
{}
# check if double precision is supported and required
if
any
([
d
.
double_fp_config
==
0
for
d
in
opencl_ctx
.
devices
]):
for
param
in
kernel_function_node
.
get_parameters
():
if
param
.
symbol
.
dtype
.
base_type
:
if
param
.
symbol
.
dtype
.
base_type
.
numpy_dtype
==
np
.
float64
:
raise
ValueError
(
'OpenCL device does not support double precision'
)
else
:
if
param
.
symbol
.
dtype
.
numpy_dtype
==
np
.
float64
:
raise
ValueError
(
'OpenCL device does not support double precision'
)
# Changing of kernel name necessary since compilation with default name "kernel" is not possible (OpenCL keyword!)
kernel_function_node
.
function_name
=
"opencl_"
+
kernel_function_node
.
function_name
header_list
=
[
'"opencl_stdint.h"'
]
+
list
(
get_headers
(
kernel_function_node
))
...
...
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