Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
global_control.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005-2018 Intel Corporation
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 */
20 
21 #ifndef __TBB_global_control_H
22 #define __TBB_global_control_H
23 
24 #if !TBB_PREVIEW_GLOBAL_CONTROL && !__TBB_BUILD
25 #error Set TBB_PREVIEW_GLOBAL_CONTROL before including global_control.h
26 #endif
27 
28 #include "tbb_stddef.h"
29 
30 namespace tbb {
31 namespace interface9 {
32 
34 public:
35  enum parameter {
38  parameter_max // insert new parameters above this point
39  };
40 
42  my_value(value), my_next(NULL), my_param(p) {
43  __TBB_ASSERT(my_param < parameter_max, "Invalid parameter");
44 #if __TBB_WIN8UI_SUPPORT
45  // For Windows Store* apps it's impossible to set stack size
46  if (p==thread_stack_size)
47  return;
48 #elif __TBB_x86_64 && (_WIN32 || _WIN64)
49  if (p==thread_stack_size)
50  __TBB_ASSERT_RELEASE((unsigned)value == value, "Stack size is limited to unsigned int range");
51 #endif
53  __TBB_ASSERT_RELEASE(my_value>0, "max_allowed_parallelism cannot be 0.");
55  }
56 
58  __TBB_ASSERT(my_param < parameter_max, "Invalid parameter. Probably the object was corrupted.");
59 #if __TBB_WIN8UI_SUPPORT
60  // For Windows Store* apps it's impossible to set stack size
62  return;
63 #endif
65  }
66 
67  static size_t active_value(parameter p) {
68  __TBB_ASSERT(p < parameter_max, "Invalid parameter");
69  return active_value((int)p);
70  }
71 private:
72  size_t my_value;
75 
78  static size_t __TBB_EXPORTED_FUNC active_value(int param);
79 };
80 } // namespace interface9
81 
83 
84 } // tbb
85 
86 #endif // __TBB_global_control_H
#define __TBB_EXPORTED_FUNC
void __TBB_EXPORTED_METHOD internal_destroy()
Definition: tbb_main.cpp:519
#define __TBB_EXPORTED_METHOD
Definition: tbb_stddef.h:102
#define __TBB_ASSERT(predicate, comment)
No-op version of __TBB_ASSERT.
Definition: tbb_stddef.h:169
void const char const char int ITT_FORMAT __itt_group_sync p
void __TBB_EXPORTED_METHOD internal_create()
Definition: tbb_main.cpp:503
#define __TBB_ASSERT_RELEASE(predicate, message)
Definition: tbb_stddef.h:138
The graph class.
static size_t active_value(parameter p)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
global_control(parameter p, size_t value)

Copyright © 2005-2018 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.