Skip to content

Commit 8cbb352

Browse files
authored
Fixes bad returns on ptiViewDisable of extcorrids. (#176)
1 parent fe8d356 commit 8cbb352

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

sdk/src/view_handler.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,10 @@ struct PtiViewRecordHandler {
334334
}
335335

336336
try {
337-
for (const auto& view_types : GetViewNameAndCallback(type)) {
338-
view_event_map_.Erase(view_types.fn_name);
337+
if (type != pti_view_kind::PTI_VIEW_EXTERNAL_CORRELATION) {
338+
for (const auto& view_types : GetViewNameAndCallback(type)) {
339+
view_event_map_.Erase(view_types.fn_name);
340+
}
339341
}
340342
} catch (const std::out_of_range&) {
341343
result = pti_result::PTI_ERROR_BAD_ARGUMENT;

sdk/test/main_dpcgemm_fixture.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ void StartTracing() {
5656
}
5757

5858
void StopTracing() {
59-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_KERNEL);
60-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY);
61-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_FILL);
62-
ptiViewDisable(PTI_VIEW_SYCL_RUNTIME_CALLS);
63-
ptiViewDisable(PTI_VIEW_EXTERNAL_CORRELATION);
64-
ptiViewDisable(PTI_VIEW_COLLECTION_OVERHEAD);
59+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_KERNEL), pti_result::PTI_SUCCESS);
60+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY), pti_result::PTI_SUCCESS);
61+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_FILL), pti_result::PTI_SUCCESS);
62+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_SYCL_RUNTIME_CALLS), pti_result::PTI_SUCCESS);
63+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_EXTERNAL_CORRELATION), pti_result::PTI_SUCCESS);
64+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_COLLECTION_OVERHEAD), pti_result::PTI_SUCCESS);
6565
}
6666

6767
float Check(const std::vector<float>& a, float value) {

sdk/test/main_vecsqadd_fixture.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ void StopTracing() {
120120
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY), pti_result::PTI_SUCCESS);
121121
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_FILL), pti_result::PTI_SUCCESS);
122122
ASSERT_EQ(ptiViewDisable(PTI_VIEW_SYCL_RUNTIME_CALLS), pti_result::PTI_SUCCESS);
123-
// TODO: ASSERT_EQ(ptiViewDisable(PTI_VIEW_EXTERNAL_CORRELATION), pti_result::PTI_SUCCESS);
124-
ptiViewDisable(PTI_VIEW_EXTERNAL_CORRELATION);
123+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_EXTERNAL_CORRELATION), pti_result::PTI_SUCCESS);
125124
}
126125

127126
static void BufferRequested(unsigned char **buf, size_t *buf_size) {

sdk/test/mem_ops_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ void StartTracing() {
4040
}
4141

4242
void StopTracing() {
43-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_KERNEL);
44-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY);
45-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY_P2P);
46-
ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_FILL);
47-
ptiViewDisable(PTI_VIEW_SYCL_RUNTIME_CALLS);
43+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_KERNEL), pti_result::PTI_SUCCESS);
44+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY), pti_result::PTI_SUCCESS);
45+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_COPY_P2P), pti_result::PTI_SUCCESS);
46+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_DEVICE_GPU_MEM_FILL), pti_result::PTI_SUCCESS);
47+
ASSERT_EQ(ptiViewDisable(PTI_VIEW_SYCL_RUNTIME_CALLS), pti_result::PTI_SUCCESS);
4848
}
4949

5050
static void BufferRequested(unsigned char** buf, size_t* buf_size) {

0 commit comments

Comments
 (0)