Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit f5b8c83

Browse files
committed
modify context
Signed-off-by: rehana begam <[email protected]>
1 parent 6043755 commit f5b8c83

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

SYCL/Basic/subsubdevice.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ int main() {
9090
info::partition_affinity_domain::numa);
9191
std::cout
9292
<< "Created " << SubSubDevicesDomainNuma.size()
93-
<< " sub-subdevices using partition by numa affinity domain scheme."
93+
<< " sub-subdevices from subdevice 0 using partition by numa "
94+
"affinity domain scheme."
9495
<< std::endl;
9596
} catch (feature_not_supported) {
9697
// okay skip it

SYCL/Basic/subsubdevice_pi.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// RUN: %GPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out separate affinity %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-SEPARATE
33
// RUN: %GPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out shared affinity %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-SHARED --implicit-check-not piContextCreate --implicit-check-not piMemBufferCreate
44
// RUN: %GPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 %t.out fused affinity %GPU_CHECK_PLACEHOLDER --check-prefix CHECK-FUSED --implicit-check-not piContextCreate --implicit-check-not piMemBufferCreate
5-
//
6-
// Intel OpenCL CPU Runtime supports device partition on all (multi-core)
7-
// platforms. Other devices may not support this.
85

96
#include <CL/sycl.hpp>
107
#include <string>
@@ -52,7 +49,7 @@ static bool check_separate(device dev, buffer<int, 1> buf,
5249

5350
log_pi("Create sub sub devices of sub device 0");
5451
std::vector<device> subsubdevices = partition(subdevices[0]);
55-
assert(subsubdevices.size() >= 1);
52+
assert(subsubdevices.size() > 1);
5653
// CHECK-SEPARATE: Create sub sub devices of sub device 0
5754
// CHECK-SEPARATE: ---> piDevicePartition
5855

@@ -81,7 +78,7 @@ static bool check_shared_context(device dev, buffer<int, 1> buf,
8178

8279
log_pi("Create sub sub devices of sub device 0");
8380
std::vector<device> subsubdevices = partition(subdevices[0]);
84-
assert(subsubdevices.size() >= 1);
81+
assert(subsubdevices.size() > 1);
8582
// CHECK-SHARED: Create sub sub devices of sub device 0
8683
// CHECK-SHARED: ---> piDevicePartition
8784

@@ -96,8 +93,8 @@ static bool check_shared_context(device dev, buffer<int, 1> buf,
9693

9794
log_pi("Test sub sub device 0");
9895
{
99-
queue q0(shared_context, subsubdevices[0]);
100-
use_mem(buf, q0);
96+
queue q(shared_context, subsubdevices[0]);
97+
use_mem(buf, q);
10198
}
10299
// CHECK-SHARED: Test sub sub device 0
103100
// CHECK-SHARED: ---> piQueueCreate
@@ -107,7 +104,18 @@ static bool check_shared_context(device dev, buffer<int, 1> buf,
107104
// see --implicit-check-not above.
108105
//
109106
// CHECK-SHARED: ---> piEnqueueKernelLaunch
110-
// CHECK-SHARED: ---> piEventsWait
107+
// CHECK-SHARED: ---> piQueueFinish
108+
109+
log_pi("Test sub sub device 1");
110+
{
111+
queue q1(shared_context, subsubdevices[1]);
112+
use_mem(buf, q1);
113+
}
114+
// CHECK-SHARED: Test sub sub device 1
115+
// CHECK-SHARED: ---> piQueueCreate
116+
// CHECK-SHARED: ---> piEnqueueKernelLaunch
117+
// CHECK-SHARED: ---> piQueueFinish
118+
// CHECK-SHARED: ---> piEnqueueMemBufferRead
111119

112120
return true;
113121
}
@@ -122,7 +130,7 @@ static bool check_fused_context(device dev, buffer<int, 1> buf,
122130

123131
log_pi("Create sub sub devices of sub device 0");
124132
std::vector<device> subsubdevices = partition(subdevices[0]);
125-
assert(subsubdevices.size() >= 1);
133+
assert(subsubdevices.size() > 1);
126134
// CHECK-FUSED: Create sub sub devices of sub device 0
127135
// CHECK-FUSED: ---> piDevicePartition
128136

0 commit comments

Comments
 (0)