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

[SYCL] Extend tests to check extra buffer constructors parameters #788

Merged
merged 3 commits into from
Feb 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion SYCL/XPTI/Inputs/buffer_info_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ XPTI_CALLBACK_API void syclBufferCallback(uint16_t TraceType,
case xpti::trace_point_type_t::offload_alloc_construct: {
auto BufConstr = (xpti::offload_buffer_data_t *)UserData;
std::cout << IId << "|Create buffer|0x" << std::hex
<< BufConstr->user_object_handle << "|" << std::dec
<< BufConstr->user_object_handle << "|0x"
<< BufConstr->host_object_handle << "|" << std::dec
<< BufConstr->element_type << "|" << BufConstr->element_size
<< "|" << BufConstr->dim << "|"
<< "{" << BufConstr->range[0] << "," << BufConstr->range[1] << ","
<< BufConstr->range[2] << "}|"
<< Event->reserved.payload->source_file << ":"
<< Event->reserved.payload->line_no << ":"
<< Event->reserved.payload->column_no << "\n";
Expand Down
2 changes: 1 addition & 1 deletion SYCL/XPTI/buffer/accessors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main() {
bool MismatchFound = false;
sycl::queue Queue{};

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

sycl::range<1> Range{Buf.size()};
Expand Down
2 changes: 1 addition & 1 deletion SYCL/XPTI/buffer/host_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main() {
int Array[4];
{
sycl::range<1> NumOfWorkItems{4};
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]+]]|{{.*}}host_array.cpp:[[# @LINE + 1]]:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]+]]|0x{{.*}}|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}host_array.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(Array, NumOfWorkItems);

// CHECK:{{[0-9]+}}|Associate buffer|[[USERID1]]|[[BEID1:.*]]
Expand Down
6 changes: 3 additions & 3 deletions SYCL/XPTI/buffer/in_cycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ int main() {
// Create a SYCL queue.
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]*]]|{{.*}}in_cycle.cpp:17:24
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]*]]|0x0|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}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]+}}|Create buffer|[[USERID2:[0-9,a-f,x]*]]|0x0|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}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]+}}|Create buffer|[[USERID3:[0-9,a-f,x]*]]|0x0|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}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]]
Expand Down
4 changes: 2 additions & 2 deletions SYCL/XPTI/buffer/multiple_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ int main() {
bool MismatchFound = false;
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]+]]|{{.*}}multiple_buffers.cpp:[[# @LINE + 1]]:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:[0-9,a-f,x]+]]|0x0|{{s(hort)*}}|2|1|{4,0,0}|{{.*}}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
// CHECK:{{[0-9]+}}|Create buffer|[[USERID2:[0-9,a-f,x]+]]|0x0|{{c(har)*}}|1|3|{5,4,3}|{{.*}}multiple_buffers.cpp:[[# @LINE + 1]]:25
sycl::buffer<char, 3> Buffer2({5, 4, 3});

sycl::range<1> NumOfWorkItems{Buffer1.size()};
Expand Down
2 changes: 1 addition & 1 deletion SYCL/XPTI/buffer/multiple_queues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main() {
sycl::queue Queue1{Devices[0]};
sycl::queue Queue2{Devices[1]};
sycl::range<1> NumOfWorkItems{4};
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}multiple_queues.cpp:[[# @LINE + 1]]:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|0x{{.*}}|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}multiple_queues.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(Array, NumOfWorkItems);

Queue1.submit([&](sycl::handler &cgh) {
Expand Down
6 changes: 3 additions & 3 deletions SYCL/XPTI/buffer/recursion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ int main() {
// Create a SYCL queue.
sycl::queue Queue{};

// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|0x0|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}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]+}}|Create buffer|[[USERID2:0x[0-9,a-f,x]+]]|0x0|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}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]+}}|Create buffer|[[USERID3:0x[0-9,a-f,x]+]]|0x0|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}recursion.cpp:17:24
// CHECK:{{[0-9]+}}|Associate buffer|[[USERID3]]|[[BEID3:.*]]
// CHECK:{{[0-9]+}}|Release buffer|[[USERID3]]|[[BEID3]]
// CHECK:{{[0-9]+}}|Destruct buffer|[[USERID3]]
Expand Down
4 changes: 2 additions & 2 deletions SYCL/XPTI/buffer/sub_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ int main() {

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

Expand Down
2 changes: 1 addition & 1 deletion SYCL/XPTI/buffer/use_host_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main() {
int Array[4];
{
sycl::range<1> NumOfWorkItems{4};
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|{{.*}}use_host_ptr.cpp:[[# @LINE + 1]]:26
// CHECK:{{[0-9]+}}|Create buffer|[[USERID1:0x[0-9,a-f,x]+]]|0x{{.*}}|{{i(nt)*}}|4|1|{4,0,0}|{{.*}}use_host_ptr.cpp:[[# @LINE + 1]]:26
sycl::buffer<int, 1> Buffer1(Array, NumOfWorkItems,
{sycl::property::buffer::use_host_ptr()});

Expand Down