Skip to content

Commit

Permalink
[SYCL][XPTI] Improve tests formatting (intel/llvm-test-suite#703)
Browse files Browse the repository at this point in the history
 - use @line macro;
 - print pointers in hexadecimal format.
  • Loading branch information
vladimirlaz authored Jan 29, 2022
1 parent 04d7a79 commit f969f56
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 92 deletions.
24 changes: 13 additions & 11 deletions SYCL/XPTI/Inputs/buffer_info_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ XPTI_CALLBACK_API void syclBufferCallback(uint16_t TraceType,
switch (Type) {
case xpti::trace_point_type_t::offload_alloc_construct: {
auto BufConstr = (xpti::offload_buffer_data_t *)UserData;
std::cout << IId << "|Create buffer|" << BufConstr->user_object_handle
<< "|" << Event->reserved.payload->name << "|"
std::cout << IId << "|Create buffer|0x" << std::hex
<< BufConstr->user_object_handle << "|" << std::dec
<< Event->reserved.payload->source_file << ":"
<< Event->reserved.payload->line_no << ":"
<< Event->reserved.payload->column_no << "\n";
Expand All @@ -110,28 +110,30 @@ XPTI_CALLBACK_API void syclBufferCallback(uint16_t TraceType,
}
case xpti::trace_point_type_t::offload_alloc_associate: {
auto BufAssoc = (xpti::offload_buffer_association_data_t *)UserData;
std::cout << IId << "|Associate buffer|" << BufAssoc->user_object_handle
<< "|" << BufAssoc->mem_object_handle << std::endl;
std::cout << IId << "|Associate buffer|0x" << std::hex
<< BufAssoc->user_object_handle << "|0x"
<< BufAssoc->mem_object_handle << std::dec << std::endl;
break;
}
case xpti::trace_point_type_t::offload_alloc_release: {
auto BufRelease = (xpti::offload_buffer_association_data_t *)UserData;
std::cout << IId << "|Release buffer|" << BufRelease->user_object_handle
<< "|" << BufRelease->mem_object_handle << std::endl;
std::cout << IId << "|Release buffer|0x" << std::hex
<< BufRelease->user_object_handle << "|0x"
<< BufRelease->mem_object_handle << std::dec << std::endl;
break;
}
case xpti::trace_point_type_t::offload_alloc_destruct: {
auto BufDestr = (xpti::offload_buffer_data_t *)UserData;
std::cout << IId << "|Destruct buffer|" << BufDestr->user_object_handle
<< "\n";
std::cout << IId << "|Destruct buffer|0x" << std::hex
<< BufDestr->user_object_handle << std::dec << std::endl;
break;
}
case xpti::trace_point_type_t::offload_alloc_accessor: {
auto BufAccessor = (xpti::offload_accessor_data_t *)UserData;
std::cout << IId << "|Construct accessor|" << BufAccessor->buffer_handle
<< "|" << BufAccessor->accessor_handle << "|"
std::cout << IId << "|Construct accessor|0x" << std::hex
<< BufAccessor->buffer_handle << "|0x"
<< BufAccessor->accessor_handle << std::dec << "|"
<< BufAccessor->target << "|" << BufAccessor->mode << "|"
<< Event->reserved.payload->name << "|"
<< Event->reserved.payload->source_file << ":"
<< Event->reserved.payload->line_no << ":"
<< Event->reserved.payload->column_no << "\n";
Expand Down
39 changes: 23 additions & 16 deletions SYCL/XPTI/buffer/accessors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,47 @@ int main() {
bool MismatchFound = false;
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[#BUFFERID:]]|{{.*}}accessors.cpp:21:24|{{.*}}accessors.cpp:21:24
sycl::buffer<int, 1> Buf(4);
// CHECK:{{[0-9]+}}|Create buffer|[[BUFFERID:[0-9,a-f,x]+]]|{{.*}}accessors.cpp:[[# @LINE + 1]]:24
sycl::buffer<int, 1> Buf(3);

sycl::range<1> Range{Buf.size()};

Queue.submit([&](sycl::handler &cgh) {
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2015|1024|{{.*}}accessors.cpp:27:15|{{.*}}accessors.cpp:27:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID1:.+]]|2015|1024|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
auto A1 = Buf.get_access<mode::read, target::constant_buffer>(cgh);
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID2:]]|2014|1025|{{.*}}accessors.cpp:29:15|{{.*}}accessors.cpp:29:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID2:.*]]|2014|1025|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
auto A2 = Buf.get_access<mode::write>(cgh);
// CHECK: {{[0-9]+}}|Construct accessor|0|[[#ACCID3:]]|2016|1026|{{.*}}accessors.cpp:31:61|{{.*}}accessors.cpp:31:61
// CHECK: {{[0-9]+}}|Construct accessor|0x0|[[ACCID3:.*]]|2016|1026|{{.*}}accessors.cpp:[[# @LINE + 1]]:61
sycl::accessor<int, 1, mode::read_write, target::local> A3(Range, cgh);
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID4:]]|2014|1027|{{.*}}accessors.cpp:33:15|{{.*}}accessors.cpp:33:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID4:.*]]|2014|1027|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
auto A4 = Buf.get_access<mode::discard_write>(cgh);
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID5:]]|2014|1028|{{.*}}accessors.cpp:35:15|{{.*}}accessors.cpp:35:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID5:.*]]|2014|1028|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
auto A5 = Buf.get_access<mode::discard_read_write, target::device>(cgh);
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID6:]]|2014|1029|{{.*}}accessors.cpp:37:15|{{.*}}accessors.cpp:37:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID6:.*]]|2014|1029|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
auto A6 = Buf.get_access<mode::atomic>(cgh);
cgh.parallel_for<class FillBuffer>(Range, [=](sycl::id<1> WIid) {});
cgh.parallel_for<class FillBuffer>(Range, [=](sycl::id<1> WIid) {
(void)A1;
(void)A2;
(void)A3;
(void)A4;
(void)A5;
(void)A6;
});
});
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2018|1024|{{.*}}accessors.cpp:41:15|{{.*}}accessors.cpp:41:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID7:.*]]|2018|1024|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::read>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2018|1025|{{.*}}accessors.cpp:43:15|{{.*}}accessors.cpp:43:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID8:.*]]|2018|1025|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2018|1026|{{.*}}accessors.cpp:45:15|{{.*}}accessors.cpp:45:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID9:.*]]|2018|1026|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::read_write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2018|1027|{{.*}}accessors.cpp:47:15|{{.*}}accessors.cpp:47:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID10:.*]]|2018|1027|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::discard_write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2018|1028|{{.*}}accessors.cpp:49:15|{{.*}}accessors.cpp:49:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID11:.*]]|2018|1028|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::discard_read_write>(); }
// CHECK: {{[0-9]+}}|Construct accessor|[[#BUFFERID]]|[[#ACCID1:]]|2018|1029|{{.*}}accessors.cpp:51:15|{{.*}}accessors.cpp:51:15
// CHECK: {{[0-9]+}}|Construct accessor|[[BUFFERID]]|[[ACCID12:.*]]|2018|1029|{{.*}}accessors.cpp:[[# @LINE + 1]]:15
{ auto HA = Buf.get_access<mode::atomic>(); }

return 0;
}
// CHECK:{{[0-9]+}}|Destruct buffer|[[#BUFFERID]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[BUFFERID]]
#endif
8 changes: 4 additions & 4 deletions SYCL/XPTI/buffer/host_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ int main() {
int Array[4];
{
sycl::range<1> NumOfWorkItems{4};
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}host_array.cpp:22:26|{{.*}}host_array.cpp:22:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]+]]|{{.*}}host_array.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(Array, NumOfWorkItems);

// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
Queue.submit([&](sycl::handler &cgh) {
// Get write only access to the buffer on a device.
auto Accessor1 = Buffer1.get_access<sycl::access::mode::write>(cgh);
Expand All @@ -43,6 +43,6 @@ int main() {

return MismatchFound;
}
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]
#endif
24 changes: 12 additions & 12 deletions SYCL/XPTI/buffer/in_cycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ int main() {
// Create a SYCL queue.
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}in_cycle.cpp:17:24|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID2:]]|{{.*}}in_cycle.cpp:17:24|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID2]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID2]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID2]]
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID3:]]|{{.*}}in_cycle.cpp:17:24|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID3]]|[[#BEID3:]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID3]]|[[#BEID3:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID3]]
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]*]]|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]
// CHECK:{{[0-9]+}}|Create buffer|[[USERID2:[0-9,a-f,x]*]]|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID2]]|[[BEID2:.*]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID2]]|[[BEID2]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID2]]
// CHECK:{{[0-9]+}}|Create buffer|[[USERID3:[0-9,a-f,x]*]]|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID3]]|[[BEID3:.*]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID3]]|[[BEID3]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID3]]
for (int i = 0; i < 3; i++)
MismatchFound &= func(Queue);
return MismatchFound;
Expand Down
28 changes: 14 additions & 14 deletions SYCL/XPTI/buffer/multiple_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ int main() {
bool MismatchFound = false;
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}multiple_buffers.cpp:19:24|{{.*}}multiple_buffers.cpp:19:24
sycl::buffer<int, 1> Buffer1(4);
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID2:]]|{{.*}}multiple_buffers.cpp:21:24|{{.*}}multiple_buffers.cpp:21:24
sycl::buffer<int, 1> Buffer2(4);
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]+]]|{{.*}}multiple_buffers.cpp:[[# @LINE + 1]]:26
sycl::buffer<short, 1> Buffer1(4);
// CHECK:{{[0-9]+}}|Create buffer|[[USERID2:[0-9,a-f,x]+]]|{{.*}}multiple_buffers.cpp:[[# @LINE + 1]]:25
sycl::buffer<char, 3> Buffer2({5, 4, 3});

sycl::range<1> NumOfWorkItems{Buffer1.size()};

// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID2]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID2]]|[[BEID2:.*]]
Queue.submit([&](sycl::handler &cgh) {
// Get write only access to the buffer on a device.
auto Accessor1 = Buffer1.get_access<sycl::access::mode::write>(cgh);
auto Accessor2 = Buffer2.get_access<sycl::access::mode::write>(cgh);
// Execute kernel.
cgh.parallel_for<class FillBuffer>(NumOfWorkItems, [=](sycl::id<1> WIid) {
Accessor1[WIid] = static_cast<int>(WIid.get(0));
Accessor2[WIid] = static_cast<int>(WIid.get(0));
Accessor1[WIid] = static_cast<short>(WIid.get(0));
Accessor2[WIid][0][0] = static_cast<char>(WIid.get(0));
});
});

Expand All @@ -40,18 +40,18 @@ int main() {

// Check the results.
for (size_t I = 0; I < Buffer1.size(); ++I) {
if (HostAccessor1[I] != I || HostAccessor2[I] != I) {
if (HostAccessor1[I] != I || HostAccessor2[I][0][0] != I) {
std::cout << "The result is incorrect for element: " << I
<< " , expected: " << I << " , got: " << HostAccessor1[I]
<< ", " << HostAccessor2[I] << std::endl;
<< ", " << HostAccessor2[I][0][0] << std::endl;
MismatchFound = true;
}
}

return MismatchFound;
}
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID2]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID2]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID2]]|[[BEID2]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID2]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]
#endif
18 changes: 8 additions & 10 deletions SYCL/XPTI/buffer/multiple_queues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,31 @@ int main() {
sycl::queue Queue1{Devices[0]};
sycl::queue Queue2{Devices[1]};
sycl::range<1> NumOfWorkItems{4};
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}multiple_queues.cpp:27:26|{{.*}}multiple_queues.cpp:27:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}multiple_queues.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(Array, NumOfWorkItems);

// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
Queue1.submit([&](sycl::handler &cgh) {
// Get write only access to the buffer on a device.
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID1:.*]]|2014|1025|{{.*}}multiple_queues.cpp:[[# @LINE + 1]]:24
auto Accessor1 = Buffer1.get_access<sycl::access::mode::write>(cgh);
// Execute kernel.
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
cgh.parallel_for<class FillBuffer>(NumOfWorkItems, [=](sycl::id<1> WIid) {
Accessor1[WIid] = static_cast<int>(WIid.get(0));
});
});
Queue1.wait();

// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID2:]]
Queue2.submit([&](sycl::handler &cgh) {
// Get write only access to the buffer on a device.
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID2:.*]]|2014|1025|{{.*}}multiple_queues.cpp:[[# @LINE + 1]]:24
auto Accessor1 = Buffer1.get_access<sycl::access::mode::write>(cgh);
// Execute kernel.
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID2:.*]]
cgh.parallel_for<class MulBuffer>(NumOfWorkItems, [=](sycl::id<1> WIid) {
Accessor1[WIid] *= static_cast<int>(WIid.get(0));
});
});
}
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID2]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]

// Check the results.
for (size_t I = 0; I < 4; ++I) {
Expand Down
24 changes: 12 additions & 12 deletions SYCL/XPTI/buffer/recursion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ int main() {
// Create a SYCL queue.
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}recursion.cpp:17:24|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID2:]]|{{.*}}recursion.cpp:17:24|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID2]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID3:]]|{{.*}}recursion.cpp:17:24|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID3]]|[[#BEID3:]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID3]]|[[#BEID3:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID3]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID2]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID2]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
// CHECK:{{[0-9]+}}|Create buffer|[[USERID2:0x[0-9,a-f,x]+]]|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID2]]|[[BEID2:.*]]
// CHECK:{{[0-9]+}}|Create buffer|[[USERID3:0x[0-9,a-f,x]+]]|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID3]]|[[BEID3:.*]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID3]]|[[BEID3]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID3]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID2]]|[[BEID2]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID2]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]
MismatchFound &= func(Queue, 2);

return MismatchFound;
Expand Down
18 changes: 9 additions & 9 deletions SYCL/XPTI/buffer/sub_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@ int main() {

{
sycl::range<1> NumOfWorkItems{128};
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}sub_buffer.cpp:21:26|{{.*}}sub_buffer.cpp:21:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(NumOfWorkItems);
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}sub_buffer.cpp:23:26|{{.*}}sub_buffer.cpp:23:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> SubBuffer{Buffer1, sycl::range<1>{32},
sycl::range<1>{32}};

Queue.submit([&](sycl::handler &cgh) {
// CHECK: {{[0-9]+}}|Construct accessor|[[#USERID1]]|[[#ACCID1:]]|2014|1025|{{.*}}sub_buffer.cpp:28:24|{{.*}}sub_buffer.cpp:28:24
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID1:.*]]|2014|1025|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:24
auto Accessor1 = SubBuffer.get_access<sycl::access::mode::write>(cgh);
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID2:.*]]
cgh.parallel_for<class FillBuffer>(
sycl::range<1>{32}, [=](sycl::id<1> WIid) {
Accessor1[WIid] = static_cast<int>(WIid.get(0));
});
});
// CHECK: {{[0-9]+}}|Construct accessor|[[#USERID1]]|[[#ACCID2:]]|2018|1024|{{.*}}sub_buffer.cpp:37:22|{{.*}}sub_buffer.cpp:37:22
// CHECK: {{[0-9]+}}|Construct accessor|[[USERID1]]|[[ACCID2:.*]]|2018|1024|{{.*}}sub_buffer.cpp:[[# @LINE + 1]]:22
auto Accessor1 = Buffer1.get_access<sycl::access::mode::read>();
for (size_t I = 32; I < 64; ++I) {
if (Accessor1[I] != I - 32) {
Expand All @@ -47,7 +47,7 @@ int main() {

return MismatchFound;
}
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID2:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID2]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]
#endif
8 changes: 4 additions & 4 deletions SYCL/XPTI/buffer/use_host_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ int main() {
int Array[4];
{
sycl::range<1> NumOfWorkItems{4};
// CHECK:{{[0-9]+}}|Create buffer|[[#USERID1:]]|{{.*}}use_host_ptr.cpp:22:26|{{.*}}use_host_ptr.cpp:22:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}use_host_ptr.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(Array, NumOfWorkItems,
{sycl::property::buffer::use_host_ptr()});

// CHECK:{{[0-9]+}}|Associate buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
Queue.submit([&](sycl::handler &cgh) {
// Get write only access to the buffer on a device.
auto Accessor1 = Buffer1.get_access<sycl::access::mode::write>(cgh);
Expand All @@ -44,6 +44,6 @@ int main() {

return MismatchFound;
}
// CHECK:{{[0-9]+}}|Release buffer|[[#USERID1]]|[[#BEID1:]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[#USERID1]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID1]]|[[BEID1]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID1]]
#endif

0 comments on commit f969f56

Please sign in to comment.