forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
itt_user_wrappers.cpp
63 lines (51 loc) · 2.01 KB
/
itt_user_wrappers.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//==--- itt_user_wrappers.cpp - user visible functions for ITT ------------==//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "device_itt.h"
#ifdef __SPIR__
DEVICE_EXTERN_C void __itt_offload_wi_start(size_t *group_id, size_t wi_id,
uint32_t wg_size) {
if (isITTEnabled())
__itt_offload_wi_start_stub(group_id, wi_id, wg_size);
}
DEVICE_EXTERN_C void __itt_offload_wi_finish(size_t *group_id, size_t wi_id) {
if (isITTEnabled())
__itt_offload_wi_finish_stub(group_id, wi_id);
}
DEVICE_EXTERN_C void __itt_offload_wg_barrier(uintptr_t barrier_id) {
if (isITTEnabled())
__itt_offload_wg_barrier_stub(barrier_id);
}
DEVICE_EXTERN_C void __itt_offload_wi_resume(size_t *group_id, size_t wi_id) {
if (isITTEnabled())
__itt_offload_wi_resume_stub(group_id, wi_id);
}
DEVICE_EXTERN_C void __itt_offload_sync_acquired(uintptr_t sync_id) {
if (isITTEnabled())
__itt_offload_sync_acquired_stub(sync_id);
}
DEVICE_EXTERN_C void __itt_offload_sync_releasing(uintptr_t sync_id) {
if (isITTEnabled())
__itt_offload_sync_releasing_stub(sync_id);
}
DEVICE_EXTERN_C void __itt_offload_wg_local_range(void *ptr, size_t size) {
if (isITTEnabled())
__itt_offload_wg_local_range_stub(ptr, size);
}
DEVICE_EXTERN_C void
__itt_offload_atomic_op_start(void *object, __itt_atomic_mem_op_t op_type,
__itt_atomic_mem_order_t mem_order) {
if (isITTEnabled())
__itt_offload_atomic_op_start_stub(object, op_type, mem_order);
}
DEVICE_EXTERN_C void
__itt_offload_atomic_op_finish(void *object, __itt_atomic_mem_op_t op_type,
__itt_atomic_mem_order_t mem_order) {
if (isITTEnabled())
__itt_offload_atomic_op_finish_stub(object, op_type, mem_order);
}
#endif // __SPIR__