Skip to content

Commit 6818c7b

Browse files
sergey-semenovvladimirlaz
authored andcommitted
[SYCL] Disable compile->link kernel-and-program test case on GPU
This usage pattern is currently broken in IGC. Signed-off-by: Vladimir Lazarev <vladimir.lazarev@intel.com> Signed-off-by: Sergey Semenov <sergey.semenov@intel.com>
1 parent 898de60 commit 6818c7b

File tree

1 file changed

+30
-25
lines changed

1 file changed

+30
-25
lines changed

sycl/test/kernel-and-program/kernel-and-program.cpp

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -98,35 +98,40 @@ int main() {
9898
{
9999
cl::sycl::queue q;
100100
std::vector<int> dataVec(10);
101-
std::iota(dataVec.begin(), dataVec.end(), 0);
101+
102102
// Precompiled kernel invocation
103-
{
104-
cl::sycl::range<1> numOfItems(dataVec.size());
105-
cl::sycl::buffer<int, 1> buf(dataVec.data(), numOfItems);
106-
cl::sycl::program prg(q.get_context());
107-
assert(prg.get_state() == cl::sycl::program_state::none);
108-
// Test compiling -> linking
109-
prg.compile_with_kernel_type<class ParallelFor>();
110-
assert(prg.get_state() == cl::sycl::program_state::compiled);
111-
prg.link();
112-
assert(prg.get_state() == cl::sycl::program_state::linked);
113-
assert(prg.has_kernel<class ParallelFor>());
114-
cl::sycl::kernel krn = prg.get_kernel<class ParallelFor>();
115-
assert(krn.get_context() == q.get_context());
116-
assert(krn.get_program() == prg);
103+
// TODO Disabled on GPU, revert once compile -> link issue is fixed there
104+
if (!q.get_device().is_gpu()) {
105+
std::iota(dataVec.begin(), dataVec.end(), 0);
106+
{
107+
cl::sycl::range<1> numOfItems(dataVec.size());
108+
cl::sycl::buffer<int, 1> buf(dataVec.data(), numOfItems);
109+
cl::sycl::program prg(q.get_context());
110+
assert(prg.get_state() == cl::sycl::program_state::none);
111+
// Test compiling -> linking
112+
prg.compile_with_kernel_type<class ParallelFor>();
113+
assert(prg.get_state() == cl::sycl::program_state::compiled);
114+
prg.link();
115+
assert(prg.get_state() == cl::sycl::program_state::linked);
116+
assert(prg.has_kernel<class ParallelFor>());
117+
cl::sycl::kernel krn = prg.get_kernel<class ParallelFor>();
118+
assert(krn.get_context() == q.get_context());
119+
assert(krn.get_program() == prg);
117120

118-
q.submit([&](cl::sycl::handler &cgh) {
119-
auto acc = buf.get_access<cl::sycl::access::mode::read_write>(cgh);
120-
cgh.parallel_for<class ParallelFor>(
121-
numOfItems, krn,
122-
[=](cl::sycl::id<1> wiID) { acc[wiID] = acc[wiID] + 1; });
123-
});
124-
}
125-
for (size_t i = 0; i < dataVec.size(); ++i) {
126-
assert(dataVec[i] == i + 1);
121+
q.submit([&](cl::sycl::handler &cgh) {
122+
auto acc = buf.get_access<cl::sycl::access::mode::read_write>(cgh);
123+
cgh.parallel_for<class ParallelFor>(
124+
numOfItems, krn,
125+
[=](cl::sycl::id<1> wiID) { acc[wiID] = acc[wiID] + 1; });
126+
});
127+
}
128+
for (size_t i = 0; i < dataVec.size(); ++i) {
129+
assert(dataVec[i] == i + 1);
130+
}
127131
}
128132

129133
// OpenCL interoperability kernel invocation
134+
std::iota(dataVec.begin(), dataVec.end(), 0);
130135
if (!q.is_host()) {
131136
cl_int err;
132137
{
@@ -158,7 +163,7 @@ int main() {
158163
clReleaseContext(clCtx);
159164
assert(err == CL_SUCCESS);
160165
for (size_t i = 0; i < dataVec.size(); ++i) {
161-
assert(dataVec[i] == i + 2);
166+
assert(dataVec[i] == i + 1);
162167
}
163168
}
164169
}

0 commit comments

Comments
 (0)