annotate libcilkrts/runtime/metacall_impl.h @ 143:76e1cf5455ef

add cbc_gc test
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 19:24:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* metacall_impl.h -*-C++-*-
kono
parents:
diff changeset
2 *
kono
parents:
diff changeset
3 *************************************************************************
kono
parents:
diff changeset
4 *
kono
parents:
diff changeset
5 * Copyright (C) 2010-2016, Intel Corporation
kono
parents:
diff changeset
6 * All rights reserved.
kono
parents:
diff changeset
7 *
kono
parents:
diff changeset
8 * Redistribution and use in source and binary forms, with or without
kono
parents:
diff changeset
9 * modification, are permitted provided that the following conditions
kono
parents:
diff changeset
10 * are met:
kono
parents:
diff changeset
11 *
kono
parents:
diff changeset
12 * * Redistributions of source code must retain the above copyright
kono
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer.
kono
parents:
diff changeset
14 * * Redistributions in binary form must reproduce the above copyright
kono
parents:
diff changeset
15 * notice, this list of conditions and the following disclaimer in
kono
parents:
diff changeset
16 * the documentation and/or other materials provided with the
kono
parents:
diff changeset
17 * distribution.
kono
parents:
diff changeset
18 * * Neither the name of Intel Corporation nor the names of its
kono
parents:
diff changeset
19 * contributors may be used to endorse or promote products derived
kono
parents:
diff changeset
20 * from this software without specific prior written permission.
kono
parents:
diff changeset
21 *
kono
parents:
diff changeset
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
kono
parents:
diff changeset
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
kono
parents:
diff changeset
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
kono
parents:
diff changeset
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
kono
parents:
diff changeset
26 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
kono
parents:
diff changeset
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
kono
parents:
diff changeset
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
kono
parents:
diff changeset
29 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
kono
parents:
diff changeset
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
kono
parents:
diff changeset
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
kono
parents:
diff changeset
32 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
kono
parents:
diff changeset
33 * POSSIBILITY OF SUCH DAMAGE.
kono
parents:
diff changeset
34 *
kono
parents:
diff changeset
35 * *********************************************************************
kono
parents:
diff changeset
36 *
kono
parents:
diff changeset
37 * PLEASE NOTE: This file is a downstream copy of a file mainitained in
kono
parents:
diff changeset
38 * a repository at cilkplus.org. Changes made to this file that are not
kono
parents:
diff changeset
39 * submitted through the contribution process detailed at
kono
parents:
diff changeset
40 * http://www.cilkplus.org/submit-cilk-contribution will be lost the next
kono
parents:
diff changeset
41 * time that a new version is released. Changes only submitted to the
kono
parents:
diff changeset
42 * GNU compiler collection or posted to the git repository at
kono
parents:
diff changeset
43 * https://bitbucket.org/intelcilkruntime/intel-cilk-runtime.git are
kono
parents:
diff changeset
44 * not tracked.
kono
parents:
diff changeset
45 *
kono
parents:
diff changeset
46 * We welcome your contributions to this open source project. Thank you
kono
parents:
diff changeset
47 * for your assistance in helping us improve Cilk Plus.
kono
parents:
diff changeset
48 *
kono
parents:
diff changeset
49 **************************************************************************/
kono
parents:
diff changeset
50
kono
parents:
diff changeset
51 /**
kono
parents:
diff changeset
52 * @file metacall_impl.h
kono
parents:
diff changeset
53 *
kono
parents:
diff changeset
54 * @brief Meta-function calls to be used within the Cilk runtime system.
kono
parents:
diff changeset
55 *
kono
parents:
diff changeset
56 * These differ from the macros in cilkscreen.h and cilkview.h because they go
kono
parents:
diff changeset
57 * through the __cilkrts_metacall interface, which ensures that the operation
kono
parents:
diff changeset
58 * is performed even when instrumentation is disabled.
kono
parents:
diff changeset
59 */
kono
parents:
diff changeset
60
kono
parents:
diff changeset
61 #ifndef INCLUDED_CILKRTS_METACALL_H
kono
parents:
diff changeset
62 #define INCLUDED_CILKRTS_METACALL_H
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 #include "rts-common.h"
kono
parents:
diff changeset
65 #include <internal/metacall.h>
kono
parents:
diff changeset
66 #include <cilk/common.h>
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 __CILKRTS_BEGIN_EXTERN_C
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 /**
kono
parents:
diff changeset
71 * This function is effectively an unconditional call from the runtime into
kono
parents:
diff changeset
72 * a tool. It is used for operations that must be performed by the tool,
kono
parents:
diff changeset
73 * even when the tool is not instrumenting. For example, Cilkscreen always
kono
parents:
diff changeset
74 * recognizes the address of this function and performs the action specified
kono
parents:
diff changeset
75 * in the contained metadata.
kono
parents:
diff changeset
76 *
kono
parents:
diff changeset
77 * Note that this function MUST NOT BE INLINED within the runtime. This must
kono
parents:
diff changeset
78 * be the ONLY instance of the cilkscreen_metacall metadata.
kono
parents:
diff changeset
79 */
kono
parents:
diff changeset
80 CILK_API_VOID
kono
parents:
diff changeset
81 __cilkrts_metacall(unsigned int tool, unsigned int code, void *data);
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 /**
kono
parents:
diff changeset
84 * Return non-zero if running under Cilkscreen or Cilkview
kono
parents:
diff changeset
85 */
kono
parents:
diff changeset
86 COMMON_PORTABLE
kono
parents:
diff changeset
87 int __cilkrts_running_under_sequential_ptool(void);
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 /**
kono
parents:
diff changeset
90 * Disable Cilkscreen implementation
kono
parents:
diff changeset
91 */
kono
parents:
diff changeset
92 #define __cilkrts_cilkscreen_disable_instrumentation() \
kono
parents:
diff changeset
93 __cilkrts_metacall(METACALL_TOOL_SYSTEM, HYPER_DISABLE_INSTRUMENTATION, 0)
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 /**
kono
parents:
diff changeset
96 * Enable Cilkscreen implementation
kono
parents:
diff changeset
97 */
kono
parents:
diff changeset
98 #define __cilkrts_cilkscreen_enable_instrumentation() \
kono
parents:
diff changeset
99 __cilkrts_metacall(METACALL_TOOL_SYSTEM, HYPER_ENABLE_INSTRUMENTATION, 0)
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 /**
kono
parents:
diff changeset
102 * Set the worker on entering runtime.
kono
parents:
diff changeset
103 *
kono
parents:
diff changeset
104 * @attention Deprecated in favor of __cilkrts_cilkscreen_ignore_block. The
kono
parents:
diff changeset
105 * begin/enter pairs in the current metadata mean Cilkscreen no longer has to
kono
parents:
diff changeset
106 * have improper knowledge of the __cilkrts_worker or __cilkrts_stack_frame
kono
parents:
diff changeset
107 * structures.
kono
parents:
diff changeset
108 */
kono
parents:
diff changeset
109 #define __cilkrts_cilkscreen_establish_worker(w) \
kono
parents:
diff changeset
110 __cilkrts_metacall(METACALL_TOOL_SYSTEM, HYPER_ESTABLISH_WORKER, w)
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 /**
kono
parents:
diff changeset
113 * Notify Cilkscreen of the extent of the stack.
kono
parents:
diff changeset
114 *
kono
parents:
diff changeset
115 * @param[in] begin Start (low address) of stack
kono
parents:
diff changeset
116 * @param[in] end One past high address of stack
kono
parents:
diff changeset
117 */
kono
parents:
diff changeset
118 void __cilkrts_cilkscreen_establish_c_stack(char *begin, char *end);
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 /**
kono
parents:
diff changeset
121 * Tell tools to ignore a block of memory - currently the global state and
kono
parents:
diff changeset
122 * memory allocated for workers.
kono
parents:
diff changeset
123 */
kono
parents:
diff changeset
124 #define __cilkrts_cilkscreen_ignore_block(_begin, _end) \
kono
parents:
diff changeset
125 { \
kono
parents:
diff changeset
126 void *block[2] = {_begin, _end}; \
kono
parents:
diff changeset
127 __cilkrts_metacall(METACALL_TOOL_SYSTEM, \
kono
parents:
diff changeset
128 HYPER_IGNORE_MEMORY_BLOCK, \
kono
parents:
diff changeset
129 block); \
kono
parents:
diff changeset
130 }
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 __CILKRTS_END_EXTERN_C
kono
parents:
diff changeset
133
kono
parents:
diff changeset
134 #endif /* ! defined(INCLUDED_CILKRTS_METACALL_H) */