diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-06-28 15:57:54 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-06-28 16:01:12 -0600 |
commit | eb4691098767935c1ffd10f7da46796c11eefcfa (patch) | |
tree | cb52c739182961869efc5b41bce68a97f9731807 /libdimension/platform.h | |
parent | 1b77e953067ce43515e96f99ecafa2ea468a60bc (diff) | |
download | dimension-eb4691098767935c1ffd10f7da46796c11eefcfa.tar.xz |
Use sched_getaffinity() rather than sysconf(_SC_NPROCESSORS_ONLN).
Also, abstract cpu counting into dedicated dmnsn_ncpus() function.
Diffstat (limited to 'libdimension/platform.h')
-rw-r--r-- | libdimension/platform.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libdimension/platform.h b/libdimension/platform.h new file mode 100644 index 0000000..bda83dd --- /dev/null +++ b/libdimension/platform.h @@ -0,0 +1,29 @@ +/************************************************************************* + * Copyright (C) 2010 Tavian Barnes <tavianator@gmail.com> * + * * + * This file is part of The Dimension Library. * + * * + * The Dimension Library is free software; you can redistribute it and/ * + * or modify it under the terms of the GNU Lesser General Public License * + * as published by the Free Software Foundation; either version 3 of the * + * License, or (at your option) any later version. * + * * + * The Dimension Library is distributed in the hope that it will be * + * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this program. If not, see * + * <http://www.gnu.org/licenses/>. * + *************************************************************************/ + +#ifndef DIMENSION_IMPL_UTILITIES_H +#define DIMENSION_IMPL_UTILITIES_H + +#include <stddef.h> + +/* Return the number of CPUs available to dimension */ +size_t dmnsn_ncpus(); + +#endif /* DIMENSION_IMPL_UTILITIES_H */ |