@@ -668,10 +668,10 @@ constexpr size_t AlignMask(size_t n) { return n - 1; }
668668// / ASAN Load/Store Report Built-ins
669669// /
670670
671- #define ASAN_REPORT_ERROR (type, is_write, size ) \
672- DEVICE_EXTERN_C_NOINLINE void __asan_##type##size( \
673- uptr addr, uint32_t as, const char __SYCL_CONSTANT__ *file, \
674- uint32_t line, const char __SYCL_CONSTANT__ *func) { \
671+ #define ASAN_REPORT_ERROR_BASE (type, is_write, size, as ) \
672+ DEVICE_EXTERN_C_NOINLINE void __asan_##type##size##_as##as( \
673+ uptr addr, const char __SYCL_CONSTANT__ *file, uint32_t line, \
674+ const char __SYCL_CONSTANT__ *func) { \
675675 if (addr & AlignMask (size)) { \
676676 __asan_report_misalign_error (addr, as, size, is_write, addr, file, line, \
677677 func); \
@@ -681,9 +681,9 @@ constexpr size_t AlignMask(size_t n) { return n - 1; }
681681 func); \
682682 } \
683683 } \
684- DEVICE_EXTERN_C_NOINLINE void __asan_##type##size##_noabort( \
685- uptr addr, uint32_t as, const char __SYCL_CONSTANT__ *file, \
686- uint32_t line, const char __SYCL_CONSTANT__ *func) { \
684+ DEVICE_EXTERN_C_NOINLINE void __asan_##type##size##_as##as## _noabort( \
685+ uptr addr, const char __SYCL_CONSTANT__ *file, uint32_t line, \
686+ const char __SYCL_CONSTANT__ *func) { \
687687 if (addr & AlignMask (size)) { \
688688 __asan_report_misalign_error (addr, as, size, is_write, addr, file, line, \
689689 func, true ); \
@@ -694,6 +694,13 @@ constexpr size_t AlignMask(size_t n) { return n - 1; }
694694 } \
695695 }
696696
697+ #define ASAN_REPORT_ERROR (type, is_write, size ) \
698+ ASAN_REPORT_ERROR_BASE (type, is_write, size, 0 ) \
699+ ASAN_REPORT_ERROR_BASE(type, is_write, size, 1 ) \
700+ ASAN_REPORT_ERROR_BASE(type, is_write, size, 2 ) \
701+ ASAN_REPORT_ERROR_BASE(type, is_write, size, 3 ) \
702+ ASAN_REPORT_ERROR_BASE(type, is_write, size, 4 )
703+
697704ASAN_REPORT_ERROR(load, false , 1 )
698705ASAN_REPORT_ERROR(load, false , 2 )
699706ASAN_REPORT_ERROR(load, false , 4 )
@@ -705,24 +712,31 @@ ASAN_REPORT_ERROR(store, true, 4)
705712ASAN_REPORT_ERROR(store, true , 8 )
706713ASAN_REPORT_ERROR(store, true , 16 )
707714
708- #define ASAN_REPORT_ERROR_N (type, is_write ) \
709- DEVICE_EXTERN_C_NOINLINE void __asan_##type##N( \
710- uptr addr, size_t size, uint32_t as, const char __SYCL_CONSTANT__ *file, \
715+ #define ASAN_REPORT_ERROR_N_BASE (type, is_write, as ) \
716+ DEVICE_EXTERN_C_NOINLINE void __asan_##type##N_as##as( \
717+ uptr addr, size_t size, const char __SYCL_CONSTANT__ *file, \
711718 uint32_t line, const char __SYCL_CONSTANT__ *func) { \
712719 if (auto poisoned_addr = __asan_region_is_poisoned (addr, as, size)) { \
713720 __asan_report_access_error (addr, as, size, is_write, poisoned_addr, \
714721 file, line, func); \
715722 } \
716723 } \
717- DEVICE_EXTERN_C_NOINLINE void __asan_##type##N_noabort( \
718- uptr addr, size_t size, uint32_t as, const char __SYCL_CONSTANT__ *file, \
724+ DEVICE_EXTERN_C_NOINLINE void __asan_##type##N_as##as##_noabort( \
725+ uptr addr, size_t size, const char __SYCL_CONSTANT__ *file, \
719726 uint32_t line, const char __SYCL_CONSTANT__ *func) { \
720727 if (auto poisoned_addr = __asan_region_is_poisoned (addr, as, size)) { \
721728 __asan_report_access_error (addr, as, size, is_write, poisoned_addr, \
722729 file, line, func, true ); \
723730 } \
724731 }
725732
733+ #define ASAN_REPORT_ERROR_N (type, is_write ) \
734+ ASAN_REPORT_ERROR_N_BASE (type, is_write, 0 ) \
735+ ASAN_REPORT_ERROR_N_BASE(type, is_write, 1 ) \
736+ ASAN_REPORT_ERROR_N_BASE(type, is_write, 2 ) \
737+ ASAN_REPORT_ERROR_N_BASE(type, is_write, 3 ) \
738+ ASAN_REPORT_ERROR_N_BASE(type, is_write, 4 )
739+
726740ASAN_REPORT_ERROR_N(load, false )
727741ASAN_REPORT_ERROR_N(store, true )
728742
0 commit comments