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
8e4aae93
Commit
8e4aae93
authored
6 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
CUDA backend: use fastmath by default
parent
7c0fc3e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gpucuda/cudajit.py
+7
-2
7 additions, 2 deletions
gpucuda/cudajit.py
with
7 additions
and
2 deletions
gpucuda/cudajit.py
+
7
−
2
View file @
8e4aae93
...
...
@@ -6,6 +6,9 @@ from pystencils.field import FieldType
from
pystencils.include
import
get_pystencils_include_path
USE_FAST_MATH
=
True
def
make_python_function
(
kernel_function_node
,
argument_dict
=
None
):
"""
Creates a kernel function from an abstract syntax tree which
...
...
@@ -33,8 +36,10 @@ def make_python_function(kernel_function_node, argument_dict=None):
code
+=
"
#define FUNC_PREFIX __global__
\n
"
code
+=
"
#define RESTRICT __restrict__
\n\n
"
code
+=
str
(
generate_c
(
kernel_function_node
,
dialect
=
'
cuda
'
))
mod
=
SourceModule
(
code
,
options
=
[
"
-w
"
,
"
-std=c++11
"
,
"
-Wno-deprecated-gpu-targets
"
],
include_dirs
=
[
get_pystencils_include_path
()])
options
=
options
=
[
"
-w
"
,
"
-std=c++11
"
,
"
-Wno-deprecated-gpu-targets
"
,
"
-use_fast_math
"
]
if
USE_FAST_MATH
:
options
.
append
(
"
-use_fast_math
"
)
mod
=
SourceModule
(
code
,
options
=
options
,
include_dirs
=
[
get_pystencils_include_path
()])
func
=
mod
.
get_function
(
kernel_function_node
.
function_name
)
parameters
=
kernel_function_node
.
get_parameters
()
...
...
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