2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
2014-12-25 02:50:24 +01:00
|
|
|
* limitations under the License.
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __UTIL_SYSTEM_H__
|
|
|
|
#define __UTIL_SYSTEM_H__
|
|
|
|
|
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
2017-03-28 20:39:14 +02:00
|
|
|
#include "util/util_string.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
2018-12-27 19:01:19 +01:00
|
|
|
/* Make sure CPU groups / NUMA API is initialized. */
|
|
|
|
bool system_cpu_ensure_initialized();
|
2016-06-04 01:29:13 +02:00
|
|
|
|
2018-12-27 19:01:19 +01:00
|
|
|
/* Get total number of threads in all NUMA nodes / CPU groups. */
|
2011-04-27 11:58:34 +00:00
|
|
|
int system_cpu_thread_count();
|
2016-06-04 01:29:13 +02:00
|
|
|
|
2018-12-27 19:01:19 +01:00
|
|
|
/* Get number of available nodes.
|
|
|
|
*
|
|
|
|
* This is in fact an index of last node plus one and it's not guaranteed
|
|
|
|
* that all nodes up to this one are available. */
|
|
|
|
int system_cpu_num_numa_nodes();
|
|
|
|
|
|
|
|
/* Returns truth if the given node is available for compute. */
|
|
|
|
bool system_cpu_is_numa_node_available(int node);
|
|
|
|
|
|
|
|
/* Get number of available processors on a given node. */
|
|
|
|
int system_cpu_num_numa_node_processors(int node);
|
|
|
|
|
|
|
|
/* Runs the current thread and its children on a specific node.
|
|
|
|
*
|
|
|
|
* Returns truth if affinity has successfully changed. */
|
|
|
|
bool system_cpu_run_thread_on_node(int node);
|
2016-11-22 16:03:16 +01:00
|
|
|
|
2019-01-11 17:55:36 +01:00
|
|
|
/* Number of processors within the current CPU group (or within active thread
|
|
|
|
* thread affinity). */
|
|
|
|
int system_cpu_num_active_group_processors();
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
string system_cpu_brand_string();
|
2011-09-08 18:58:07 +00:00
|
|
|
int system_cpu_bits();
|
2013-02-04 16:12:37 +00:00
|
|
|
bool system_cpu_support_sse2();
|
|
|
|
bool system_cpu_support_sse3();
|
2013-11-22 14:16:47 +01:00
|
|
|
bool system_cpu_support_sse41();
|
2014-01-16 17:04:11 +01:00
|
|
|
bool system_cpu_support_avx();
|
2014-06-13 22:23:58 +02:00
|
|
|
bool system_cpu_support_avx2();
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2017-11-04 00:33:38 +01:00
|
|
|
size_t system_physical_ram();
|
|
|
|
|
2011-04-27 11:58:34 +00:00
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
2018-11-09 11:34:54 +01:00
|
|
|
#endif /* __UTIL_SYSTEM_H__ */
|