Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pyopencl
Commits
acb75315
Commit
acb75315
authored
4 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Add CL2.1 timer functions
parent
20ff881e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!124
Opencl 3
Pipeline
#73462
passed with warnings
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/runtime_platform.rst
+15
-1
15 additions, 1 deletion
doc/runtime_platform.rst
src/wrap_cl.hpp
+17
-2
17 additions, 2 deletions
src/wrap_cl.hpp
src/wrap_cl_part_1.cpp
+4
-0
4 additions, 0 deletions
src/wrap_cl_part_1.cpp
with
36 additions
and
3 deletions
doc/runtime_platform.rst
+
15
−
1
View file @
acb75315
...
...
@@ -45,6 +45,8 @@ Device
.. class:: Device
Two instances of this class may be compared using *=="* and *"!="*.
.. attribute:: info
Lower case versions of the :class:`device_info` constants
...
...
@@ -88,7 +90,19 @@ Device
.. versionadded:: 2011.2
Two instances of this class may be compared using *=="* and *"!="*.
.. method:: device_and_host_timer
:returns: a tuple ``(device_timestamp, host_timestamp)``.
Only available with CL 2.0.
.. versionadded:: 2020.3
.. method:: host_timer
Only available with CL 2.0.
.. versionadded:: 2020.3
Context
-------
...
...
This diff is collapsed.
Click to expand it.
src/wrap_cl.hpp
+
17
−
2
View file @
acb75315
...
...
@@ -35,8 +35,6 @@
// CL 2.1 missing:
// clGetKernelSubGroupInfo
// clSetDefaultDeviceCommandQueue
// clGetDeviceAndHostTimer
// clGetHostTimer
// clEnqueueSVMMigrateMem
// CL 2.2 complete
...
...
@@ -1031,6 +1029,23 @@ namespace pyopencl
}
#endif
#if PYOPENCL_CL_VERSION >= 0x2010
py
::
tuple
device_and_host_timer
()
const
{
cl_ulong
device_timestamp
,
host_timestamp
;
PYOPENCL_CALL_GUARDED
(
clGetDeviceAndHostTimer
,
(
m_device
,
&
device_timestamp
,
&
host_timestamp
));
return
py
::
make_tuple
(
device_timestamp
,
host_timestamp
);
}
cl_ulong
host_timer
()
const
{
cl_ulong
host_timestamp
;
PYOPENCL_CALL_GUARDED
(
clGetHostTimer
,
(
m_device
,
&
host_timestamp
));
return
host_timestamp
;
}
#endif
};
...
...
This diff is collapsed.
Click to expand it.
src/wrap_cl_part_1.cpp
+
4
−
0
View file @
acb75315
...
...
@@ -68,6 +68,10 @@ void pyopencl_expose_part_1(py::module &m)
.
DEF_SIMPLE_METHOD
(
create_sub_devices
)
#endif
PYOPENCL_EXPOSE_TO_FROM_INT_PTR
(
cl_device_id
)
#if PYOPENCL_CL_VERSION >= 0x2010
.
DEF_SIMPLE_METHOD
(
device_and_host_timer
)
.
DEF_SIMPLE_METHOD
(
host_timer
)
#endif
;
}
...
...
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