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
d9d97fab
Commit
d9d97fab
authored
10 years ago
by
Yichao Yu
Browse files
Options
Downloads
Patches
Plain Diff
check cb availability only when needed
parent
9865abe9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyopencl/cffi_cl.py
+0
-11
0 additions, 11 deletions
pyopencl/cffi_cl.py
src/c_wrapper/context.h
+1
-1
1 addition, 1 deletion
src/c_wrapper/context.h
src/c_wrapper/event.cpp
+7
-1
7 additions, 1 deletion
src/c_wrapper/event.cpp
with
8 additions
and
13 deletions
pyopencl/cffi_cl.py
+
0
−
11
View file @
d9d97fab
...
@@ -918,17 +918,6 @@ class Kernel(_Common):
...
@@ -918,17 +918,6 @@ class Kernel(_Common):
class
Event
(
_Common
):
class
Event
(
_Common
):
_id
=
'
event
'
_id
=
'
event
'
@classmethod
def
_create
(
cls
,
ptr
):
self
=
_Common
.
_create
.
__func__
(
cls
,
ptr
)
try
:
if
(
self
.
context
.
_get_cl_version
()
>=
(
1
,
1
)
and
get_cl_header_version
()
>=
(
1
,
1
)):
_lib
.
event__set_support_cb
(
ptr
,
1
);
except
:
pass
return
self
def
__init__
(
self
):
def
__init__
(
self
):
pass
pass
...
...
This diff is collapsed.
Click to expand it.
src/c_wrapper/context.h
+
1
−
1
View file @
d9d97fab
...
@@ -16,7 +16,7 @@ extern template void print_buf<cl_context>(std::ostream&, const cl_context*,
...
@@ -16,7 +16,7 @@ extern template void print_buf<cl_context>(std::ostream&, const cl_context*,
class
context
:
public
clobj
<
cl_context
>
{
class
context
:
public
clobj
<
cl_context
>
{
public:
public:
PYOPENCL_DEF_CL_CLASS
(
CONTEXT
);
PYOPENCL_DEF_CL_CLASS
(
CONTEXT
);
void
get_version
(
cl_context
ctx
,
int
*
major
,
int
*
minor
);
static
void
get_version
(
cl_context
ctx
,
int
*
major
,
int
*
minor
);
PYOPENCL_INLINE
PYOPENCL_INLINE
context
(
cl_context
ctx
,
bool
retain
)
context
(
cl_context
ctx
,
bool
retain
)
:
clobj
(
ctx
)
:
clobj
(
ctx
)
...
...
This diff is collapsed.
Click to expand it.
src/c_wrapper/event.cpp
+
7
−
1
View file @
d9d97fab
...
@@ -64,7 +64,13 @@ release_private_use_cb(event *evt)
...
@@ -64,7 +64,13 @@ release_private_use_cb(event *evt)
// is already completed.
// is already completed.
if
(
status
<=
CL_COMPLETE
)
if
(
status
<=
CL_COMPLETE
)
return
false
;
return
false
;
return
evt
->
support_cb
;
cl_context
ctx
;
pyopencl_call_guarded
(
clGetEventInfo
,
evt
,
CL_EVENT_CONTEXT
,
size_arg
(
ctx
),
nullptr
);
int
major
;
int
minor
;
context
::
get_version
(
ctx
,
&
major
,
&
minor
);
return
(
major
>
1
)
||
(
major
>=
1
&&
minor
>=
1
);
}
catch
(
const
clerror
&
e
)
{
}
catch
(
const
clerror
&
e
)
{
cleanup_print_error
(
e
.
code
(),
e
.
what
());
cleanup_print_error
(
e
.
code
(),
e
.
what
());
return
false
;
return
false
;
...
...
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