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
0abbbaff
Commit
0abbbaff
authored
4 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Make {Scalar,Vector,Other}Arg hashable
parent
73faf922
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!134
Speed up enqueue
Pipeline
#121685
failed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyopencl/tools.py
+20
-0
20 additions, 0 deletions
pyopencl/tools.py
with
20 additions
and
0 deletions
pyopencl/tools.py
+
20
−
0
View file @
0abbbaff
...
...
@@ -339,6 +339,12 @@ class DtypedArgument(Argument):
and
self
.
dtype
==
other
.
dtype
and
self
.
name
==
other
.
name
)
def
__hash__
(
self
):
return
(
hash
(
type
(
self
))
^
hash
(
self
.
dtype
)
^
hash
(
self
.
name
))
class
VectorArg
(
DtypedArgument
):
def
__init__
(
self
,
dtype
,
name
,
with_offset
=
False
):
...
...
@@ -359,6 +365,9 @@ class VectorArg(DtypedArgument):
return
(
super
().
__eq__
(
other
)
and
self
.
with_offset
==
other
.
with_offset
)
def
__hash__
(
self
):
return
super
.
__hash__
()
^
hash
(
self
.
with_offset
)
class
ScalarArg
(
DtypedArgument
):
def
declarator
(
self
):
...
...
@@ -373,6 +382,17 @@ class OtherArg(Argument):
def
declarator
(
self
):
return
self
.
decl
def
__eq__
(
self
,
other
):
return
(
type
(
self
)
==
type
(
other
)
and
self
.
decl
==
other
.
decl
and
self
.
name
==
other
.
name
)
def
__hash__
(
self
):
return
(
hash
(
type
(
self
))
^
hash
(
self
.
decl
)
^
hash
(
self
.
name
))
def
parse_c_arg
(
c_arg
,
with_offset
=
False
):
for
aspace
in
[
"
__local
"
,
"
__constant
"
]:
...
...
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