Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:15:50

0001 /*
0002     Copyright (c) 2019-2020 Intel Corporation
0003 
0004     Licensed under the Apache License, Version 2.0 (the "License");
0005     you may not use this file except in compliance with the License.
0006     You may obtain a copy of the License at
0007 
0008         http://www.apache.org/licenses/LICENSE-2.0
0009 
0010     Unless required by applicable law or agreed to in writing, software
0011     distributed under the License is distributed on an "AS IS" BASIS,
0012     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013     See the License for the specific language governing permissions and
0014     limitations under the License.
0015 */
0016 
0017 #ifndef __TBB_info_H
0018 #define __TBB_info_H
0019 
0020 #include "tbb_config.h"
0021 
0022 #if __TBB_NUMA_SUPPORT
0023 
0024 #include <vector>
0025 
0026 namespace tbb {
0027     namespace internal {
0028         namespace numa_topology {
0029             unsigned nodes_count();
0030             void fill(int* indexes_array);
0031             int default_concurrency(int node_id);
0032         } //namespace numa_topology
0033     } // namespace internal
0034 
0035     typedef int numa_node_id;
0036 
0037     namespace info {
0038         inline std::vector<numa_node_id> numa_nodes() {
0039             std::vector<numa_node_id> nodes_indexes(tbb::internal::numa_topology::nodes_count());
0040             internal::numa_topology::fill(&nodes_indexes.front());
0041             return nodes_indexes;
0042         }
0043 
0044         inline int default_concurrency(numa_node_id id = -1) {
0045             return internal::numa_topology::default_concurrency(id);
0046         }
0047     } // namespace info
0048 } // namespace tbb
0049 
0050 #endif /*__TBB_NUMA_SUPPORT*/
0051 
0052 #endif /*__TBB_info_H*/