@@ -46,16 +46,30 @@ def test_memory_without_context (self):
4646 def test_memory_cpu_context (self ):
4747 mobj = self ._create_memory ()
4848
49- # CPU context
49+ # CPU context
5050 with dppl .device_context (dppl .device_type .cpu ):
51- self .assertEqual (mobj ._usm_type (), 'shared' )
51+ # type respective to the context in which
52+ # memory was created
53+ usm_type = mobj ._usm_type ()
54+ self .assertEqual (usm_type , 'shared' )
55+
56+ current_queue = dppl .get_current_queue ()
57+ # type as view from current queue
58+ usm_type = mobj ._usm_type (context = current_queue )
59+ # type can be unknown if current queue is
60+ # not in the same SYCL context
61+ self .assertTrue (usm_type in ['unknown' , 'shared' ])
5262
5363 def test_memory_gpu_context (self ):
5464 mobj = self ._create_memory ()
5565
5666 # GPU context
5767 with dppl .device_context (dppl .device_type .gpu ):
58- self .assertEqual (mobj ._usm_type (), 'shared' )
68+ usm_type = mobj ._usm_type ()
69+ self .assertEqual (usm_type , 'shared' )
70+ current_queue = dppl .get_current_queue ()
71+ usm_type = mobj ._usm_type (context = current_queue )
72+ self .assertTrue (usm_type in ['unknown' , 'shared' ])
5973
6074
6175class TestMemoryUSMBase :
0 commit comments