Skip to content

Commit 336acad

Browse files
add E2E test
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent 13ca4e2 commit 336acad

File tree

5 files changed

+100
-21
lines changed

5 files changed

+100
-21
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,6 @@ void instrumentationFillCommonData(const std::string &KernelName,
20152015
xpti_td *CmdTraceEvent =
20162016
xptiMakeEvent("ExecCG", &Payload, xpti::trace_graph_event,
20172017
xpti::trace_activity_type_t::active, &CGKernelInstanceNo);
2018-
20192018
if (CmdTraceEvent) {
20202019
OutInstanceID = CGKernelInstanceNo;
20212020
OutTraceEvent = CmdTraceEvent;
@@ -2058,9 +2057,8 @@ std::pair<xpti_td *, uint64_t> emitKernelInstrumentationData(
20582057
std::vector<ArgDesc> &CGArgs) {
20592058

20602059
auto XptiObjects = std::make_pair<xpti_td *, uint64_t>(nullptr, -1);
2061-
20622060
constexpr uint16_t NotificationTraceType = xpti::trace_node_create;
2063-
if (!xptiCheckTraceEnabled(StreamID, NotificationTraceType))
2061+
if (!xptiCheckTraceEnabled(StreamID))
20642062
return XptiObjects;
20652063

20662064
void *Address = nullptr;

sycl/test-e2e/Tracing/code_location_queue_parallel_for.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010

1111
int main() {
1212
sycl::queue Queue;
13-
sycl::buffer<int, 1> Buf(8);
1413
sycl::device Dev = Queue.get_device();
1514
sycl::range<1> MaxWISizes =
1615
Dev.get_info<sycl::info::device::max_work_item_sizes<1>>();
1716
bool ExceptionCaught = false;
1817
try {
19-
// CHECK: code_location_queue_parallel_for.cpp:[[# @LINE + 3 ]] E2ETestKernel
18+
// CHECK: code_location_queue_parallel_for.cpp:[[# @LINE + 3 ]] E2ETestKernel
2019
Queue.parallel_for<class E2ETestKernel>(
2120
sycl::nd_range<1>{MaxWISizes.get(0), 2 * MaxWISizes.get(0)},
2221
[](sycl::id<1> idx) {});
Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,48 @@
11
// REQUIRES: cpu
22
// UNSUPPORTED: windows
33
// RUN: %{build} -o %t.out
4-
// RUN: %{run} sycl-trace --sycl %t.out | FileCheck %s
4+
// RUN: %{run} sycl-trace --sycl --print-format=verbose %t.out | FileCheck %s
55

66
// Test tracing of the code location data for queue.submit in case of failure
77
// (exception generation)
8+
// First queue creation (id = 0) is queue created on line 15.
9+
// The second queue is a host queue created on first scheduler usage.
810

911
#include <sycl/sycl.hpp>
1012

1113
int main() {
12-
sycl::queue Q;
1314
bool ExceptionCaught = false;
14-
unsigned char *HostAllocSrc = (unsigned char *)sycl::malloc_host(1, Q);
15-
unsigned char *HostAllocDst = NULL;
16-
try {
17-
// CHECK: code_location_queue_submit.cpp:[[# @LINE + 1]] main
18-
Q.submit(
19-
[&](sycl::handler &cgh) { cgh.copy(HostAllocDst, HostAllocSrc, 1); });
20-
} catch (sycl::exception &e) {
21-
std::ignore = e;
22-
ExceptionCaught = true;
15+
{
16+
sycl::queue Q;
17+
unsigned char *HostAllocSrc = (unsigned char *)sycl::malloc_host(1, Q);
18+
unsigned char *HostAllocDst = NULL;
19+
// CHECK: [SYCL] Queue create:
20+
// CHECK-DAG: queue_handle : {{.*}}
21+
// CHECK-DAG: queue_id : 0
22+
// CHECK-DAG: is_inorder : false
23+
// CHECK-DAG: sycl_device : {{.*}}
24+
// CHECK-DAG: sycl_device_name : {{.*}}
25+
// CHECK-DAG: sycl_context : {{.*}}
26+
// CHECK-NEXT: [SYCL] Queue create:
27+
// CHECK-DAG: queue_id : 1
28+
// CHECK-DAG: is_inorder : false
29+
// CHECK-DAG: sycl_device : {{.*}}
30+
// CHECK-DAG: sycl_device_name : SYCL host device
31+
// CHECK-DAG: sycl_context : {{.*}}
32+
// CHECK-NEXT: [SYCL] Runtime reports:
33+
// CHECK-NEXT: what: NULL pointer argument in memory copy operation. -30 (PI_ERROR_INVALID_VALUE)
34+
// CHECK-NEXT: where:{{.*}}code_location_queue_submit.cpp:[[# @LINE + 2 ]] main
35+
try {
36+
Q.submit(
37+
[&](sycl::handler &cgh) { cgh.copy(HostAllocDst, HostAllocSrc, 1); });
38+
} catch (sycl::exception &e) {
39+
std::ignore = e;
40+
ExceptionCaught = true;
41+
}
42+
Q.wait();
43+
sycl::free(HostAllocSrc, Q);
2344
}
24-
Q.wait();
25-
sycl::free(HostAllocSrc, Q);
26-
45+
// CHECK-NEXT: [SYCL] Queue destroy:
46+
// CHECK-DAG: queue_id : 0
2747
return !ExceptionCaught;
2848
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// REQUIRES: cpu
2+
// UNSUPPORTED: windows
3+
// RUN: %{build} -o %t.out
4+
// RUN: %{run} sycl-trace --sycl --print-format=verbose %t.out | FileCheck %s
5+
6+
#include <sycl/sycl.hpp>
7+
8+
int main() {
9+
{
10+
sycl::queue Q;
11+
unsigned char *AllocSrc = (unsigned char *)sycl::malloc_device(1, Q);
12+
unsigned char *AllocDst = (unsigned char *)sycl::malloc_device(1, Q);
13+
Q.memset(AllocSrc, 0, 1).wait();
14+
Q.copy(AllocDst, AllocSrc, 1).wait();
15+
// CHECK: [SYCL] Queue create:
16+
// CHECK-DAG: queue_handle : {{.*}}
17+
// CHECK-DAG: queue_id : 0
18+
// CHECK-DAG: is_inorder : false
19+
// CHECK-DAG: sycl_device : {{.*}}
20+
// CHECK-DAG: sycl_device_name : {{.*}}
21+
// CHECK-DAG: sycl_context : {{.*}}
22+
// CHECK-NEXT: [SYCL] Task begin (event={{.*}},instanceID={{.*}})
23+
// CHECK-DAG: queue_id : 0
24+
// CHECK-DAG: memory_size : 1
25+
// CHECK-DAG: value_set : 0
26+
// CHECK-DAG: memory_ptr : {{.*}}
27+
// CHECK-DAG: sycl_device : {{.*}}
28+
// CHECK-NEXT: [SYCL] Task end (event={{.*}},instanceID={{.*}})
29+
// CHECK-NEXT: [SYCL] Task begin (event={{.*}},instanceID={{.*}})
30+
// CHECK-DAG: queue_id : 0
31+
// CHECK-DAG: memory_size : 1
32+
// CHECK-DAG: dest_memory_ptr : {{.*}}
33+
// CHECK-DAG: src_memory_ptr : {{.*}}
34+
// CHECK-DAG: sycl_device : {{.*}}
35+
// CHECK-NEXT: [SYCL] Task end (event={{.*}},instanceID={{.*}})
36+
// CHECK-NEXT: [SYCL] Queue create:
37+
// CHECK-DAG: queue_id : 1
38+
// CHECK-DAG: is_inorder : false
39+
// CHECK-DAG: sycl_device : {{.*}}
40+
// CHECK-DAG: sycl_device_name : SYCL host device
41+
// CHECK-DAG: sycl_context : {{.*}}
42+
Q.single_task<class E2ETestKernel>([]() {}).wait();
43+
// CHECK-NEXT: [SYCL] Task begin (event={{.*}},instanceID={{.*}})
44+
// CHECK-DAG: enqueue_kernel_data : {{.*}}
45+
// CHECK-DAG: sym_column_no : {{.*}}
46+
// CHECK-DAG: sym_line_no : [[# @LINE - 5 ]]
47+
// CHECK-DAG: sym_source_file_name : {{.*}}task_execution.cpp
48+
// CHECK-DAG: queue_id : 0
49+
// CHECK-DAG: sym_function_name : typeinfo name for main::E2ETestKernel
50+
// CHECK-DAG: from_source : {{.*}}
51+
// CHECK-DAG: sycl_device_name : {{.*}}
52+
// CHECK-DAG: sycl_device_type : {{.*}}
53+
// CHECK-DAG: kernel_name : typeinfo name for main::E2ETestKernel
54+
// CHECK-DAG: sycl_device : {{.*}}
55+
// CHECK-NEXT: [SYCL] Task end (event={{.*}},instanceID={{.*}})
56+
// CHECK-NEXT: [SYCL] Queue destroy:
57+
// CHECK-DAG: queue_id : 0
58+
sycl::free(AllocSrc, Q);
59+
sycl::free(AllocDst, Q);
60+
}
61+
return 0;
62+
}

sycl/test-e2e/XPTI/basic_event_collection_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
// CHECK-DAG: sycl_device : {{.*}}
8080
// CHECK-NEXT: PI Call Begin : piEventRelease
8181
// CHECK-NEXT: Wait begin
82-
// CHECK: sycl_device : {{.*}}
82+
// CHECK: sycl_device_type : {{.*}}
8383
// CHECK: PI Call Begin : piQueueFinish
8484
// CHECK-NEXT: Wait end
85-
// CHECK: sycl_device : {{.*}}
85+
// CHECK: sycl_device_type : {{.*}}

0 commit comments

Comments
 (0)