]>
Commit | Line | Data |
---|---|---|
99dee823 | 1 | /* Copyright (C) 2013-2021 Free Software Foundation, Inc. |
6103184e AM |
2 | Contributed by Jakub Jelinek <jakub@redhat.com>. |
3 | ||
4 | This file is part of the GNU Offloading and Multi Processing Library | |
5 | (libgomp). | |
6 | ||
7 | Libgomp is free software; you can redistribute it and/or modify it | |
8 | under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation; either version 3, or (at your option) | |
10 | any later version. | |
11 | ||
12 | Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY | |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
14 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
15 | more details. | |
16 | ||
17 | Under Section 7 of GPL version 3, you are granted additional | |
18 | permissions described in the GCC Runtime Library Exception, version | |
19 | 3.1, as published by the Free Software Foundation. | |
20 | ||
21 | You should have received a copy of the GNU General Public License and | |
22 | a copy of the GCC Runtime Library Exception along with this program; | |
23 | see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
24 | <http://www.gnu.org/licenses/>. */ | |
25 | ||
26 | #include "libgomp.h" | |
27 | #include <limits.h> | |
28 | ||
29 | void | |
30 | GOMP_teams (unsigned int num_teams, unsigned int thread_limit) | |
31 | { | |
32 | if (thread_limit) | |
33 | { | |
34 | struct gomp_task_icv *icv = gomp_icv (true); | |
35 | icv->thread_limit_var | |
36 | = thread_limit > INT_MAX ? UINT_MAX : thread_limit; | |
37 | } | |
38 | unsigned int num_blocks, block_id; | |
39 | asm ("mov.u32 %0, %%nctaid.x;" : "=r" (num_blocks)); | |
40 | asm ("mov.u32 %0, %%ctaid.x;" : "=r" (block_id)); | |
41 | if (!num_teams || num_teams >= num_blocks) | |
42 | num_teams = num_blocks; | |
43 | else if (block_id >= num_teams) | |
44 | { | |
45 | gomp_free_thread (nvptx_thrs); | |
46 | asm ("exit;"); | |
47 | } | |
48 | gomp_num_teams_var = num_teams - 1; | |
49 | } | |
28567c40 JJ |
50 | |
51 | int | |
52 | omp_pause_resource (omp_pause_resource_t kind, int device_num) | |
53 | { | |
54 | (void) kind; | |
55 | (void) device_num; | |
56 | return -1; | |
57 | } | |
58 | ||
59 | int | |
60 | omp_pause_resource_all (omp_pause_resource_t kind) | |
61 | { | |
62 | (void) kind; | |
63 | return -1; | |
64 | } | |
65 | ||
66 | ialias (omp_pause_resource) | |
67 | ialias (omp_pause_resource_all) | |
95d67762 JJ |
68 | |
69 | void | |
70 | GOMP_target_ext (int device, void (*fn) (void *), size_t mapnum, | |
71 | void **hostaddrs, size_t *sizes, unsigned short *kinds, | |
72 | unsigned int flags, void **depend, void **args) | |
73 | { | |
74 | (void) device; | |
75 | (void) fn; | |
76 | (void) mapnum; | |
77 | (void) hostaddrs; | |
78 | (void) sizes; | |
79 | (void) kinds; | |
80 | (void) flags; | |
81 | (void) depend; | |
82 | (void) args; | |
83 | __builtin_unreachable (); | |
84 | } | |
85 | ||
86 | void | |
87 | GOMP_target_data_ext (int device, size_t mapnum, void **hostaddrs, | |
88 | size_t *sizes, unsigned short *kinds) | |
89 | { | |
90 | (void) device; | |
91 | (void) mapnum; | |
92 | (void) hostaddrs; | |
93 | (void) sizes; | |
94 | (void) kinds; | |
95 | __builtin_unreachable (); | |
96 | } | |
97 | ||
98 | void | |
99 | GOMP_target_end_data (void) | |
100 | { | |
101 | __builtin_unreachable (); | |
102 | } | |
103 | ||
104 | void | |
105 | GOMP_target_update_ext (int device, size_t mapnum, void **hostaddrs, | |
106 | size_t *sizes, unsigned short *kinds, | |
107 | unsigned int flags, void **depend) | |
108 | { | |
109 | (void) device; | |
110 | (void) mapnum; | |
111 | (void) hostaddrs; | |
112 | (void) sizes; | |
113 | (void) kinds; | |
114 | (void) flags; | |
115 | (void) depend; | |
116 | __builtin_unreachable (); | |
117 | } | |
118 | ||
119 | void | |
120 | GOMP_target_enter_exit_data (int device, size_t mapnum, void **hostaddrs, | |
121 | size_t *sizes, unsigned short *kinds, | |
122 | unsigned int flags, void **depend) | |
123 | { | |
124 | (void) device; | |
125 | (void) mapnum; | |
126 | (void) hostaddrs; | |
127 | (void) sizes; | |
128 | (void) kinds; | |
129 | (void) flags; | |
130 | (void) depend; | |
131 | __builtin_unreachable (); | |
132 | } |