1/*
2 * Copyright (c) 2014 ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9#include <bomp_internal.h>
10
11#if 0
12
13/**
14 * \brief allocated an initializes a new task ICV set
15 *
16 * \returns pointer to the ICV task struct
17 *
18 * The struct is initialized based on the parent
19 */
20struct omp_icv_task *bomp_icv_new(void)
21{
22    assert(!"NYI");
23    return 0;
24}
25
26/**
27 * \brief Initializes the task specific ICV from the parent task
28 *
29 * \param icv_task  ICV task struct to initialize
30 *
31 * If there is no parent task, then the global ICVs are taken
32 */
33void bomp_icv_init_from_parent(struct omp_icv_task *icv_task)
34{
35    assert(!"NYI");
36}
37
38/**
39 * \brief Initializes the task specific ICV from the environment
40 *
41 * \param icv_task  ICV task struct to initialize
42 *
43 * This function initializes the task ICV based on the values defined in
44 * environment.h.
45 *
46 * The function may only be called to initialize the global task ICV
47 */
48void bomp_icv_init_from_env(struct omp_icv_task *icv_task)
49{
50    icv_task->dynamic = OMP_DYNAMIC;
51    icv_task->nested = OMP_NESTED;
52    icv_task->nthreads = g_thread_limit;
53    icv_task->thread_limit = g_thread_limit;
54    icv_task->place_partition = OMP_PLACES;
55    icv_task->active_levels = 0;
56    icv_task->levels=0;
57    icv_task->run_sched = OMP_SCHEDULE;
58    icv_task->run_sched_modifier = 0;
59#if OMP_VERSION >= OMP_VERSION_40
60    icv_task->bind = OMP_PROC_BIND;
61    icv_task->default_device = OMP_DEFAULT_DEVICE;
62#endif
63}
64
65/**
66 * \brief Initializes the device specific ICV from the environment
67 *
68 * \param icv_dev   ICV task struct to initialize
69 *
70 * This function initializes the device ICV based on the values defined in
71 * environment.h.
72 */
73void bomp_icv_dev_init_from_env(struct omp_icv_device *icv_dev)
74{
75    icv_dev->dev_sched = 0;
76    icv_dev->stack_size = OMP_STACKSIZE;
77    icv_dev->wait_policy = OMP_WAIT_POLICY;
78    icv_dev->max_active_levels = OMP_MAX_ACTIVE_LEVELS;
79#if OMP_VERSION >= OMP_VERSION_40
80    icv_dev->cancel = OMP_CANCELLATION;
81#endif
82}
83#endif
84