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

Commit 7b05546

Browse files
authored
[SYCL][XPTI] Make sub-buffer use 64-bit alignment (#694)
1 parent 8cdb16e commit 7b05546

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

SYCL/XPTI/buffer/sub_buffer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ int main() {
1616
sycl::queue Queue{};
1717

1818
{
19-
sycl::range<1> NumOfWorkItems{4};
19+
sycl::range<1> NumOfWorkItems{64};
2020
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}sub_buffer.cpp:21:26|{{.*}}sub_buffer.cpp:21:26
2121
sycl::buffer<int, 1> Buffer1(NumOfWorkItems);
2222
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}sub_buffer.cpp:23:26|{{.*}}sub_buffer.cpp:23:26
23-
sycl::buffer<int, 1> SubBuffer{Buffer1, sycl::range<1>{1},
24-
sycl::range<1>{2}};
23+
sycl::buffer<int, 1> SubBuffer{Buffer1, sycl::range<1>{16},
24+
sycl::range<1>{32}};
2525

2626
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
2727
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID2:]]
@@ -30,17 +30,17 @@ int main() {
3030
auto Accessor1 = SubBuffer.get_access<sycl::access::mode::write>(cgh);
3131
// Execute kernel.
3232
cgh.parallel_for<class FillBuffer>(
33-
sycl::range<1>{2}, [=](sycl::id<1> WIid) {
33+
sycl::range<1>{32}, [=](sycl::id<1> WIid) {
3434
Accessor1[WIid] = static_cast<int>(WIid.get(0));
3535
});
3636
});
3737

3838
auto Accessor1 = Buffer1.get_access<sycl::access::mode::read>();
3939
// Check the results.
40-
for (size_t I = 1; I < 3; ++I) {
41-
if (Accessor1[I] != I - 1) {
40+
for (size_t I = 16; I < 48; ++I) {
41+
if (Accessor1[I] != I - 16) {
4242
std::cout << "The result is incorrect for element: " << I
43-
<< " , expected: " << I - 1 << " , got: " << Accessor1[I]
43+
<< " , expected: " << I - 16 << " , got: " << Accessor1[I]
4444
<< std::endl;
4545
MismatchFound = true;
4646
}

0 commit comments

Comments
 (0)