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):
6363 return res
6464
6565
66- class OrderManagerMap :
66+ class SyclQueueToOrderManagerMap :
6767 """Utility class to ensure sequential ordering of offloaded
6868 tasks issued by dpctl.tensor functions"""
6969
@@ -74,14 +74,21 @@ def __init__(self):
7474 )
7575
7676 def __getitem__ (self , q : SyclQueue ) -> _SequentialOrderManager :
77+ """Get order manager for given SyclQueue"""
7778 _local = self ._map .get ()
78- print (_local )
79+ if not isinstance (q , SyclQueue ):
80+ raise TypeError (f"Expected `dpctl.SyclQueue`, got { type (q )} " )
7981 if q in _local :
8082 return _local [q ]
8183 else :
8284 v = _local [q ]
8385 _local [q ] = v
8486 return v
8587
88+ def clear (self ):
89+ """Clear content of internal dictionary"""
90+ _local = self ._map .get ()
91+ _local .clear ()
92+
8693
87- SequentialOrderManager = OrderManagerMap ()
94+ SequentialOrderManager = SyclQueueToOrderManagerMap ()
You can’t perform that action at this time.
0 commit comments