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
974febd7
Commit
974febd7
authored
5 years ago
by
Martin Bauer
Browse files
Options
Downloads
Plain Diff
Merge branch 'macos' into 'master'
OpenCL macOS support See merge request
pycodegen/pystencils!87
parents
33648089
885fc9c7
No related branches found
No related tags found
1 merge request
!87
OpenCL macOS support
Pipeline
#19846
passed
5 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/backends/opencl_backend.py
+1
-1
1 addition, 1 deletion
pystencils/backends/opencl_backend.py
pystencils/opencl/opencljit.py
+10
-0
10 additions, 0 deletions
pystencils/opencl/opencljit.py
with
11 additions
and
1 deletion
pystencils/backends/opencl_backend.py
+
1
−
1
View file @
974febd7
...
@@ -73,7 +73,7 @@ class OpenClSympyPrinter(CudaSympyPrinter):
...
@@ -73,7 +73,7 @@ class OpenClSympyPrinter(CudaSympyPrinter):
function_name
,
dimension
=
tuple
(
symbol_name
.
split
(
"
.
"
))
function_name
,
dimension
=
tuple
(
symbol_name
.
split
(
"
.
"
))
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
"
int(
{
function_name
}
(
{
dimension
}
)
)
"
def
_print_TextureAccess
(
self
,
node
):
def
_print_TextureAccess
(
self
,
node
):
raise
NotImplementedError
()
raise
NotImplementedError
()
...
...
This diff is collapsed.
Click to expand it.
pystencils/opencl/opencljit.py
+
10
−
0
View file @
974febd7
...
@@ -30,6 +30,16 @@ def make_python_function(kernel_function_node, opencl_queue, opencl_ctx, argumen
...
@@ -30,6 +30,16 @@ def make_python_function(kernel_function_node, opencl_queue, opencl_ctx, argumen
if
argument_dict
is
None
:
if
argument_dict
is
None
:
argument_dict
=
{}
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!)
# 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
kernel_function_node
.
function_name
=
"
opencl_
"
+
kernel_function_node
.
function_name
header_list
=
[
'"
opencl_stdint.h
"'
]
+
list
(
get_headers
(
kernel_function_node
))
header_list
=
[
'"
opencl_stdint.h
"'
]
+
list
(
get_headers
(
kernel_function_node
))
...
...
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