Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DeviceSanitizer] Add a report flag to LaunchInfo #2069

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions source/loader/layers/sanitizer/asan_libdevice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

#include <cinttypes>

#if !defined(__SPIR__) && !defined(__SPIRV__)
namespace ur_sanitizer_layer {
#endif // !__SPIR__ && !__SPIRV__

enum class DeviceSanitizerErrorType : int32_t {
UNKNOWN,
Expand Down Expand Up @@ -79,6 +81,7 @@ struct LaunchInfo {
uint32_t NumLocalArgs = 0;
LocalArgsInfo *LocalArgs = nullptr; // Ordered by ArgIndex

int ReportFlag = 0;
Copy link
Contributor

@pbalcer pbalcer Oct 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a general comment: I really dislike the fact that we have an implicit ABI requirement on these structures, where they need to be kept in sync between the two repos.
Would it be possible to refactor this so that we move these structures into a separate header (in include/) that the libdevice/include/asan_libdevice.hpp uses?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbalcer, can we make a common include folder in sycl runtime?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a ur-related header in sycl runtime:
https://github.com/intel/llvm/blob/sycl/sycl/include/sycl/detail/ur.hpp
is that what you mean?

Why though? I was more thinking about putting the headers in UR and then including them in SYCL.

Copy link
Contributor

@AllanZyne AllanZyne Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought wrong, I want to move "asan_libdevice.hpp" into sycl runtime.

I was more thinking about putting the headers in UR and then including them in SYCL.

You're right, this is what we will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I updated intel/llvm pr, then libdevice will re-use asan_libdevice.hpp in ur.

DeviceSanitizerReport SanitizerReport[ASAN_MAX_NUM_REPORTS];
};

Expand Down Expand Up @@ -160,4 +163,6 @@ inline const char *ToString(DeviceSanitizerErrorType ErrorType) {
}
}

#if !defined(__SPIR__) && !defined(__SPIRV__)
} // namespace ur_sanitizer_layer
#endif // !__SPIR__ && !__SPIRV__
Loading