2 Copyright (c) 2014-2015 Intel Corporation. All Rights Reserved.
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions
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.
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.
31 // The parts of the offload library common to host and target
32 #include "offload_util.h"
34 DLL_LOCAL
void offload_stage_print(int stage
, int offload_number
, ...);
36 enum OffloadTraceStage
{
37 // Total time spent on the target
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
,
49 c_offload_receive_pointer_data
,
50 c_offload_received_pointer_data
,
51 c_offload_start_target_func
,
53 c_offload_scatter_copyin_data
,
54 c_offload_gather_copyout_data
,
55 c_offload_scatter_copyout_data
,
56 c_offload_copyout_data
,
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
,
73 c_offload_myosupportsfeature
,
74 c_offload_myosharedarenacreate
,
75 c_offload_myosharedalignedarenamalloc
,
76 c_offload_myosharedalignedarenafree
,
77 c_offload_myoarenaacquire
,
78 c_offload_myoarenarelease
,
82 enum OffloadWaitKind
{
83 c_offload_wait_signal
= 0,
84 c_offload_wait_stream
,
85 c_offload_wait_all_streams