File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def __copy__(self):
63
63
return res
64
64
65
65
66
- class OrderManagerMap :
66
+ class SyclQueueToOrderManagerMap :
67
67
"""Utility class to ensure sequential ordering of offloaded
68
68
tasks issued by dpctl.tensor functions"""
69
69
@@ -74,14 +74,21 @@ def __init__(self):
74
74
)
75
75
76
76
def __getitem__ (self , q : SyclQueue ) -> _SequentialOrderManager :
77
+ """Get order manager for given SyclQueue"""
77
78
_local = self ._map .get ()
78
- print (_local )
79
+ if not isinstance (q , SyclQueue ):
80
+ raise TypeError (f"Expected `dpctl.SyclQueue`, got { type (q )} " )
79
81
if q in _local :
80
82
return _local [q ]
81
83
else :
82
84
v = _local [q ]
83
85
_local [q ] = v
84
86
return v
85
87
88
+ def clear (self ):
89
+ """Clear content of internal dictionary"""
90
+ _local = self ._map .get ()
91
+ _local .clear ()
92
+
86
93
87
- SequentialOrderManager = OrderManagerMap ()
94
+ SequentialOrderManager = SyclQueueToOrderManagerMap ()
You can’t perform that action at this time.
0 commit comments