1 /*
2 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18 /*
19 * ompstubs.c:
20 *
21 * libpgc stubs for omp_ routines not appearing in crit.o & omp.o for
22 * non-x64/x86 targets.
23 *
24 */
25
26 #include <stdio.h>
27 #include "komp.h"
28
29 int
omp_get_thread_limit(void)30 omp_get_thread_limit(void)
31 {
32 return 1;
33 }
34
35 int
omp_get_thread_limit_(void)36 omp_get_thread_limit_(void)
37 {
38 return 1;
39 }
40
41 int
omp_in_parallel(void)42 omp_in_parallel(void)
43 {
44 return 0;
45 }
46
47 int
omp_in_parallel_(void)48 omp_in_parallel_(void)
49 {
50 return 0;
51 }
52
53 void
omp_set_num_threads(int num_threads)54 omp_set_num_threads(int num_threads)
55 {
56 }
57
58 void
omp_set_num_threads_(int * num_threads)59 omp_set_num_threads_(int *num_threads)
60 {
61 }
62
63 void
omp_set_lock(omp_lock_t * sem)64 omp_set_lock(omp_lock_t *sem)
65 {
66 }
67
68 void
omp_set_lock_(omp_lock_t * sem)69 omp_set_lock_(omp_lock_t *sem)
70 {
71 }
72
73 void
omp_unset_lock(omp_lock_t * sem)74 omp_unset_lock(omp_lock_t *sem)
75 {
76 }
77
78 void
omp_unset_lock_(omp_lock_t * sem)79 omp_unset_lock_(omp_lock_t *sem)
80 {
81 }
82
83 int
omp_get_num_procs(void)84 omp_get_num_procs(void)
85 {
86 return 1;
87 }
88
89 int
omp_get_num_procs_(void)90 omp_get_num_procs_(void)
91 {
92 return 1;
93 }
94
95 int
omp_get_num_threads(void)96 omp_get_num_threads(void)
97 {
98 return 1;
99 }
100
101 int
omp_get_num_threads_(void)102 omp_get_num_threads_(void)
103 {
104 return 1;
105 }
106
107 int
omp_get_max_threads(void)108 omp_get_max_threads(void)
109 {
110 return 1;
111 }
112
113 int
omp_get_max_threads_(void)114 omp_get_max_threads_(void)
115 {
116 return 1;
117 }
118
119 int
omp_get_thread_num(void)120 omp_get_thread_num(void)
121 {
122 return 0;
123 }
124 int
omp_get_thread_num_(void)125 omp_get_thread_num_(void)
126 {
127 return 0;
128 }
129 void
omp_set_dynamic(int dynamic_threads)130 omp_set_dynamic(int dynamic_threads)
131 {
132 }
133
134 void
omp_set_dynamic_(int * dynamic_threads)135 omp_set_dynamic_(int *dynamic_threads)
136 {
137 }
138
139 int
omp_get_dynamic(void)140 omp_get_dynamic(void)
141 {
142 return 0;
143 }
144
145 int
omp_get_dynamic_(void)146 omp_get_dynamic_(void)
147 {
148 return 0;
149 }
150
151 void
omp_set_nested(int nested)152 omp_set_nested(int nested)
153 {
154 }
155
156 void
omp_set_nested_(int * nested)157 omp_set_nested_(int *nested)
158 {
159 }
160
161 int
omp_get_nested(void)162 omp_get_nested(void)
163 {
164 return 0;
165 }
166
167 int
omp_get_nested_(void)168 omp_get_nested_(void)
169 {
170 return 0;
171 }
172
173 void
omp_set_schedule(omp_sched_t kind,int modifier)174 omp_set_schedule(omp_sched_t kind, int modifier)
175 {
176 }
177
178 void
omp_set_schedule_(omp_sched_t * kind,int * modifier)179 omp_set_schedule_(omp_sched_t *kind, int *modifier)
180 {
181 }
182
183 void
omp_get_schedule(omp_sched_t * kind,int * modifier)184 omp_get_schedule(omp_sched_t *kind, int *modifier)
185 {
186 *kind = omp_sched_static;
187 *modifier = 0;
188 }
189
190 void
omp_get_schedule_(omp_sched_t * kind,int * modifier)191 omp_get_schedule_(omp_sched_t *kind, int *modifier)
192 {
193 *kind = omp_sched_static;
194 *modifier = 0;
195 }
196
197 void
omp_set_max_active_levels(int max_active_levels)198 omp_set_max_active_levels(int max_active_levels)
199 {
200 }
201
202 void
omp_set_max_active_levels_(int * max_active_levels)203 omp_set_max_active_levels_(int *max_active_levels)
204 {
205 }
206
207 int
omp_get_max_active_levels(void)208 omp_get_max_active_levels(void)
209 {
210 return 0;
211 }
212
213 int
omp_get_max_active_levels_(void)214 omp_get_max_active_levels_(void)
215 {
216 return 0;
217 }
218
219 int
omp_get_level(void)220 omp_get_level(void)
221 {
222 return 0;
223 }
224
225 int
omp_get_level_(void)226 omp_get_level_(void)
227 {
228 return 0;
229 }
230
231 int
omp_get_ancestor_thread_num(int level)232 omp_get_ancestor_thread_num(int level)
233 {
234 if (level == 0) {
235 return 0;
236 }
237 return -1;
238 }
239
240 int
omp_get_ancestor_thread_num_(int * level)241 omp_get_ancestor_thread_num_(int *level)
242 {
243 if (*level == 0) {
244 return 0;
245 }
246 return -1;
247 }
248
249 int
omp_get_team_size(int level)250 omp_get_team_size(int level)
251 {
252 if (level == 0) {
253 return 1;
254 }
255 return -1;
256 }
257
258 int
omp_get_team_size_(int * level)259 omp_get_team_size_(int *level)
260 {
261 if (*level == 0) {
262 return 1;
263 }
264 return -1;
265 }
266
267 int
omp_get_active_level(void)268 omp_get_active_level(void)
269 {
270 return 0;
271 }
272
273 int
omp_get_active_level_(void)274 omp_get_active_level_(void)
275 {
276 return 0;
277 }
278
279 void
omp_init_lock(omp_lock_t * s)280 omp_init_lock(omp_lock_t *s)
281 {
282 }
283
284 void
omp_init_lock_(omp_lock_t * s)285 omp_init_lock_(omp_lock_t *s)
286 {
287 }
288
289 void
omp_destroy_lock(omp_lock_t * arg)290 omp_destroy_lock(omp_lock_t *arg)
291 {
292 }
293
294 void
omp_destroy_lock_(omp_lock_t * arg)295 omp_destroy_lock_(omp_lock_t *arg)
296 {
297 }
298
299 int
omp_test_lock(omp_lock_t * arg)300 omp_test_lock(omp_lock_t *arg)
301 {
302 return 0;
303 }
304
305 int
omp_test_lock_(omp_lock_t * arg)306 omp_test_lock_(omp_lock_t *arg)
307 {
308 return 0;
309 }
310
311 void
omp_init_nest_lock(omp_nest_lock_t * arg)312 omp_init_nest_lock(omp_nest_lock_t *arg)
313 {
314 }
315
316 void
omp_init_nest_lock_(omp_nest_lock_t * arg)317 omp_init_nest_lock_(omp_nest_lock_t *arg)
318 {
319 }
320
321 void
omp_destroy_nest_lock(omp_nest_lock_t * arg)322 omp_destroy_nest_lock(omp_nest_lock_t *arg)
323 {
324 }
325
326 void
omp_destroy_nest_lock_(omp_nest_lock_t * arg)327 omp_destroy_nest_lock_(omp_nest_lock_t *arg)
328 {
329 }
330
331 void
omp_set_nest_lock(omp_nest_lock_t * arg)332 omp_set_nest_lock(omp_nest_lock_t *arg)
333 {
334 }
335
336 void
omp_set_nest_lock_(omp_nest_lock_t * arg)337 omp_set_nest_lock_(omp_nest_lock_t *arg)
338 {
339 }
340
341 void
omp_unset_nest_lock(omp_nest_lock_t * arg)342 omp_unset_nest_lock(omp_nest_lock_t *arg)
343 {
344 }
345
346 void
omp_unset_nest_lock_(omp_nest_lock_t * arg)347 omp_unset_nest_lock_(omp_nest_lock_t *arg)
348 {
349 }
350
351 int
omp_test_nest_lock(omp_nest_lock_t * arg)352 omp_test_nest_lock(omp_nest_lock_t *arg)
353 {
354 return 0;
355 }
356
357 int
omp_test_nest_lock_(omp_nest_lock_t * arg)358 omp_test_nest_lock_(omp_nest_lock_t *arg)
359 {
360 return 0;
361 }
362
363 int
omp_get_cancellation()364 omp_get_cancellation()
365 {
366 return 0;
367 }
368
369 int
omp_get_cancellation_()370 omp_get_cancellation_()
371 {
372 return 0;
373 }
374
375 omp_proc_bind_t
omp_get_proc_bind_()376 omp_get_proc_bind_()
377 {
378 return 0;
379 }
380
381 omp_proc_bind_t
omp_get_proc_bind()382 omp_get_proc_bind()
383 {
384 return 0;
385 }
386
387 int
omp_get_num_places()388 omp_get_num_places()
389 {
390 return 0;
391 }
392
393 int
omp_get_num_places_()394 omp_get_num_places_()
395 {
396 return 0;
397 }
398
399 int
omp_get_place_num_procs(int placenum)400 omp_get_place_num_procs(int placenum)
401 {
402 return 0;
403 }
404
405 int
omp_get_place_num_procs_(int placenum)406 omp_get_place_num_procs_(int placenum)
407 {
408 return 0;
409 }
410 void
omp_get_place_proc_ids(int place_num,int * ids)411 omp_get_place_proc_ids(int place_num, int *ids)
412 {
413 return;
414 }
415
416 void
omp_get_place_proc_ids_(int place_num,int * ids)417 omp_get_place_proc_ids_(int place_num, int *ids)
418 {
419 return;
420 }
421
422 int
omp_get_place_num()423 omp_get_place_num()
424 {
425 return -1;
426 }
427
428 int
omp_get_place_num_()429 omp_get_place_num_()
430 {
431 return -1;
432 }
433
434 int
omp_get_partition_num_places()435 omp_get_partition_num_places()
436 {
437 return 0;
438 }
439
440 int
omp_get_partition_num_places_()441 omp_get_partition_num_places_()
442 {
443 return 0;
444 }
445
446 void
omp_get_partition_place_nums(int * place_nums)447 omp_get_partition_place_nums(int *place_nums)
448 {
449 }
450
451 void
omp_get_partition_place_nums_(int * place_nums)452 omp_get_partition_place_nums_(int *place_nums)
453 {
454 }
455
456 void
omp_set_default_device(int device_num)457 omp_set_default_device(int device_num)
458 {
459 }
460
461 void
omp_set_default_device_(int device_num)462 omp_set_default_device_(int device_num)
463 {
464 }
465
466 int
omp_get_default_device(void)467 omp_get_default_device(void)
468 {
469 return 0;
470 }
471
472 int
omp_get_default_device_(void)473 omp_get_default_device_(void)
474 {
475 return 0;
476 }
477
478 int
omp_get_num_devices(void)479 omp_get_num_devices(void)
480 {
481 return 0;
482 }
483
484 int
omp_get_num_devices_(void)485 omp_get_num_devices_(void)
486 {
487 return 0;
488 }
489
490 int
omp_get_num_teams(void)491 omp_get_num_teams(void)
492 {
493 return 1;
494 }
495
496 int
omp_get_num_teams_(void)497 omp_get_num_teams_(void)
498 {
499 return 1;
500 }
501
502 int
omp_get_team_num(void)503 omp_get_team_num(void)
504 {
505 return 0;
506 }
507
508 int
omp_get_team_num_(void)509 omp_get_team_num_(void)
510 {
511 return 0;
512 }
513
514 int
omp_is_initial_device(void)515 omp_is_initial_device(void)
516 {
517 return 1;
518 }
519
520 int
omp_is_initial_device_(void)521 omp_is_initial_device_(void)
522 {
523 return 1;
524 }
525
526 int
omp_get_initial_device(void)527 omp_get_initial_device(void)
528 {
529 return -10;
530 }
531
532 int
omp_get_initial_device_(void)533 omp_get_initial_device_(void)
534 {
535 return -10;
536 }
537
538 int
omp_get_max_task_priority(void)539 omp_get_max_task_priority(void)
540 {
541 return 0;
542 }
543
544 int
omp_get_max_task_priority_(void)545 omp_get_max_task_priority_(void)
546 {
547 return 0;
548 }
549
550 void
omp_init_nest_lock_with_hint(omp_nest_lock_t * arg,omp_lock_hint_t hint)551 omp_init_nest_lock_with_hint(omp_nest_lock_t *arg, omp_lock_hint_t hint)
552 {
553 omp_init_nest_lock(arg);
554 }
555
556 void
omp_init_nest_lock_with_hint_(omp_nest_lock_t * arg,omp_lock_hint_t hint)557 omp_init_nest_lock_with_hint_(omp_nest_lock_t *arg, omp_lock_hint_t hint)
558 {
559 omp_init_nest_lock(arg);
560 }
561
562
563 double
omp_get_wtime(void)564 omp_get_wtime(void)
565 {
566 /* This function does not provide a working
567 * wallclock timer. Replace it with a version
568 * customized for the target machine.
569 */
570 return 0.0;
571 }
572
573 double
omp_get_wtime_(void)574 omp_get_wtime_(void)
575 {
576 /* This function does not provide a working
577 * wallclock timer. Replace it with a version
578 * customized for the target machine.
579 */
580 return 0.0;
581 }
582
583 double
omp_get_wtick(void)584 omp_get_wtick(void)
585 {
586 /* This function does not provide a working
587 * clock tick function. Replace it with
588 * a version customized for the target machine.
589 */
590 return 365. * 86400.;
591 }
592
593 double
omp_get_wtick_(void)594 omp_get_wtick_(void)
595 {
596 /* This function does not provide a working
597 * clock tick function. Replace it with
598 * a version customized for the target machine.
599 */
600 return 365. * 86400.;
601 }
602
603 kmp_int32
__kmpc_global_thread_num(void * id)604 __kmpc_global_thread_num(void *id)
605 {
606 return 0;
607 }
608
609 kmp_int32
__kmpc_global_thread_num_(void * id)610 __kmpc_global_thread_num_(void *id)
611 {
612 return 0;
613 }
614
615 void
__kmpc_critical(ident_t * id,kmp_int32 tn,kmp_critical_name * sem)616 __kmpc_critical(ident_t *id, kmp_int32 tn, kmp_critical_name *sem)
617 {
618 }
619
620 void
__kmpc_critical_(ident_t * id,kmp_int32 * tn,kmp_critical_name * sem)621 __kmpc_critical_(ident_t *id, kmp_int32 *tn, kmp_critical_name *sem)
622 {
623 }
624
625 void
__kmpc_end_critical(ident_t * id,kmp_int32 tn,kmp_critical_name * sem)626 __kmpc_end_critical(ident_t *id, kmp_int32 tn, kmp_critical_name *sem)
627 {
628 }
629
630 void
__kmpc_end_critical_(ident_t * id,kmp_int32 * tn,kmp_critical_name * sem)631 __kmpc_end_critical_(ident_t *id, kmp_int32 *tn, kmp_critical_name *sem)
632 {
633 }
634
635 void *
__kmpc_threadprivate_cached(ident_t * id,kmp_int32 tn,void * data,size_t size,void *** cache)636 __kmpc_threadprivate_cached(ident_t *id, kmp_int32 tn, void *data, size_t size,
637 void ***cache)
638 {
639 return (void *)0;
640 }
641
642 void *
__kmpc_threadprivate_cached_(ident_t * id,kmp_int32 * tn,void * data,size_t * size,void *** cache)643 __kmpc_threadprivate_cached_(ident_t *id, kmp_int32 *tn, void *data,
644 size_t *size, void ***cache)
645 {
646 return (void *)0;
647 }
648
649 void
__kmpc_barrier(ident_t * id,kmp_int32 tn)650 __kmpc_barrier(ident_t *id, kmp_int32 tn)
651 {
652 }
653
654 void
__kmpc_barrier_(ident_t * id,kmp_int32 * tn)655 __kmpc_barrier_(ident_t *id, kmp_int32 *tn)
656 {
657 }
658
659 void *
__kmpc_threadprivate(ident_t * id,kmp_int32 tn,void * data,size_t size)660 __kmpc_threadprivate(ident_t *id, kmp_int32 tn, void *data, size_t size)
661 {
662 return (void *)0;
663 }
664
665 void *
__kmpc_threadprivate_(ident_t * id,kmp_int32 tn,void * data,size_t size)666 __kmpc_threadprivate_(ident_t *id, kmp_int32 tn, void *data, size_t size)
667 {
668 return (void *)0;
669 }
670
671 void
__kmpc_fork_call(ident_t * loc,kmp_int32 argc,void * microtask,...)672 __kmpc_fork_call(ident_t *loc, kmp_int32 argc, void *microtask, ...)
673 {
674 }
675
676 void
__kmpc_for_static_init_8(ident_t * loc,kmp_int32 gtid,kmp_int32 schedtype,kmp_int32 * plastiter,kmp_int64 * plower,kmp_int64 * pupper,kmp_int64 * pstride,kmp_int64 incr,kmp_int64 chunk)677 __kmpc_for_static_init_8(ident_t *loc, kmp_int32 gtid, kmp_int32 schedtype, kmp_int32 *plastiter,
678 kmp_int64 *plower, kmp_int64 *pupper,
679 kmp_int64 *pstride, kmp_int64 incr, kmp_int64 chunk )
680 {
681 }
682
683 void
__kmpc_push_num_threads(ident_t * loc,kmp_int32 global_tid,kmp_int32 num_threads)684 __kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads)
685 {
686 }
687