1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// Constants shared by the host and device ConcurrencySanitizer runtimes.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef CSAN_DEFS_H
15#define CSAN_DEFS_H
16
17enum {
18 CSAN_ACCESS_ATOMIC = 1u << 0,
19 CSAN_ACCESS_COMPOUND = 1u << 1,
20 CSAN_ACCESS_WRITE = 1u << 2
21};
22
23enum {
24 CSAN_RACE_DATA = 0,
25 CSAN_RACE_UNKNOWN_ORIGIN = 1,
26 CSAN_RACE_INTRA_WAVE = 2
27};
28
29// The size of the device watchpoint table used by the host and device runtime.
30static constexpr unsigned long CSAN_WATCHPOINT_TABLE_BYTES =
31 2ul * 1024ul * 1024ul;
32static constexpr unsigned long CSAN_WATCHPOINT_TABLE_ENTRIES =
33 CSAN_WATCHPOINT_TABLE_BYTES / sizeof(unsigned long long);
34
35#endif // CSAN_DEFS_H
36