Skip to content

Commit 9824003

Browse files
committed
[DeviceSanitizer] Do not print error log for unsupported feature in urProgramBuildExp.
1 parent 92121c9 commit 9824003

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// REQUIRES: linux, cpu || (gpu && level_zero)
2+
// RUN: %{build} %device_asan_flags -DGPU -o %t_gpu.out
3+
// RUN: %{build} %device_asan_flags -o %t.out
4+
// RUN: %{run} not --crash %if gpu %{ %t_gpu.out %} %else %{ %t.out %} 2>&1 | FileCheck %s
5+
6+
#include <sycl/detail/core.hpp>
7+
8+
void test() {
9+
sycl::queue Q;
10+
sycl:: buffer<int> A{1};
11+
Q.submit([&](sycl::handler &h) {
12+
sycl::accessor A_acc(A, h);
13+
14+
h.single_task([=]() { A_acc[0] = 88; });
15+
});
16+
}
17+
18+
// CHECK-NOT: <SANITIZER>[ERROR]: Printing build log for program
19+
20+
int main() {
21+
test();
22+
return 0;
23+
}

unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp(
355355

356356
auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions);
357357
if (UrRes != UR_RESULT_SUCCESS) {
358-
PrintUrBuildLog(hProgram, phDevices, numDevices);
358+
if (UrRes != UR_RESULT_ERROR_UNSUPPORTED_FEATURE)
359+
PrintUrBuildLog(hProgram, phDevices, numDevices);
359360
return UrRes;
360361
}
361362

unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ ur_result_t urProgramBuildExp(
294294

295295
auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions);
296296
if (UrRes != UR_RESULT_SUCCESS) {
297-
PrintUrBuildLog(hProgram, phDevices, numDevices);
297+
if (UrRes != UR_RESULT_ERROR_UNSUPPORTED_FEATURE)
298+
PrintUrBuildLog(hProgram, phDevices, numDevices);
298299
return UrRes;
299300
}
300301

0 commit comments

Comments
 (0)