111
|
1 /*
|
|
2 Copyright (c) 2014-2016 Intel Corporation. All Rights Reserved.
|
|
3
|
|
4 Redistribution and use in source and binary forms, with or without
|
|
5 modification, are permitted provided that the following conditions
|
|
6 are met:
|
|
7
|
|
8 * Redistributions of source code must retain the above copyright
|
|
9 notice, this list of conditions and the following disclaimer.
|
|
10 * Redistributions in binary form must reproduce the above copyright
|
|
11 notice, this list of conditions and the following disclaimer in the
|
|
12 documentation and/or other materials provided with the distribution.
|
|
13 * Neither the name of Intel Corporation nor the names of its
|
|
14 contributors may be used to endorse or promote products derived
|
|
15 from this software without specific prior written permission.
|
|
16
|
|
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28 */
|
|
29
|
|
30
|
|
31 // The parts of the offload library common to host and target
|
|
32 #include "offload_util.h"
|
|
33
|
|
34 DLL_LOCAL void offload_stage_print(int stage, int offload_number, ...);
|
|
35
|
|
36 enum OffloadTraceStage {
|
|
37 // Total time spent on the target
|
|
38 c_offload_start = 0,
|
|
39 c_offload_init,
|
|
40 c_offload_register,
|
|
41 c_offload_init_func,
|
|
42 c_offload_create_buf_host,
|
|
43 c_offload_create_buf_mic,
|
|
44 c_offload_send_pointer_data,
|
|
45 c_offload_sent_pointer_data,
|
|
46 c_offload_gather_copyin_data,
|
|
47 c_offload_copyin_data,
|
|
48 c_offload_compute,
|
|
49 c_offload_receive_pointer_data,
|
|
50 c_offload_received_pointer_data,
|
|
51 c_offload_start_target_func,
|
|
52 c_offload_var,
|
|
53 c_offload_scatter_copyin_data,
|
|
54 c_offload_gather_copyout_data,
|
|
55 c_offload_scatter_copyout_data,
|
|
56 c_offload_copyout_data,
|
|
57 c_offload_signal,
|
|
58 c_offload_wait,
|
|
59 c_offload_unregister,
|
|
60 c_offload_destroy,
|
|
61 c_offload_finish,
|
|
62 c_offload_myoinit,
|
|
63 c_offload_myoregister,
|
|
64 c_offload_mic_myo_shared,
|
|
65 c_offload_mic_myo_fptr,
|
|
66 c_offload_myosharedmalloc,
|
|
67 c_offload_myosharedfree,
|
|
68 c_offload_myosharedalignedmalloc,
|
|
69 c_offload_myosharedalignedfree,
|
|
70 c_offload_myoacquire,
|
|
71 c_offload_myorelease,
|
|
72 c_offload_myofini,
|
|
73 c_offload_myosupportsfeature,
|
|
74 c_offload_myosharedarenacreate,
|
|
75 c_offload_myosharedalignedarenamalloc,
|
|
76 c_offload_myosharedalignedarenafree,
|
|
77 c_offload_myoarenaacquire,
|
|
78 c_offload_myoarenarelease,
|
|
79 c_offload_stream
|
|
80 };
|
|
81
|
|
82 enum OffloadWaitKind {
|
|
83 c_offload_wait_signal = 0,
|
|
84 c_offload_wait_stream,
|
|
85 c_offload_wait_all_streams
|
|
86 };
|