changeset 21893:0a6f387d18d3

* nproc.cc, oct-fftw.cc: Use octave_num_processors_wrapper.
author John W. Eaton <jwe@octave.org>
date Tue, 14 Jun 2016 10:24:39 -0400
parents 8fcc81df840c
children 67a5cb9cd941
files libinterp/corefcn/nproc.cc liboctave/numeric/oct-fftw.cc
diffstat 2 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/nproc.cc	Tue Jun 14 10:17:32 2016 -0400
+++ b/libinterp/corefcn/nproc.cc	Tue Jun 14 10:24:39 2016 -0400
@@ -25,7 +25,7 @@
 #endif
 
 #include "defun.h"
-#include "nproc.h"
+#include "nproc-wrapper.h"
 
 DEFUN (nproc, args, ,
        "-*- texinfo -*-\n\
@@ -54,7 +54,8 @@
   if (nargin > 1)
     print_usage ();
 
-  nproc_query query = NPROC_CURRENT;
+  octave_nproc_query query = OCTAVE_NPROC_CURRENT;
+
   if (nargin == 1)
     {
       std::string arg = args(0).string_value ();
@@ -62,16 +63,16 @@
       std::transform (arg.begin (), arg.end (), arg.begin (), tolower);
 
       if (arg == "all")
-        query = NPROC_ALL;
+        query = OCTAVE_NPROC_ALL;
       else if (arg == "current")
-        query = NPROC_CURRENT;
+        query = OCTAVE_NPROC_CURRENT;
       else if (arg == "overridable")
-        query = NPROC_CURRENT_OVERRIDABLE;
+        query = OCTAVE_NPROC_CURRENT_OVERRIDABLE;
       else
         error ("nproc: invalid value for QUERY");
     }
 
-  return ovl (num_processors (query));
+  return ovl (octave_num_processors_wrapper (query));
 }
 
 /*
--- a/liboctave/numeric/oct-fftw.cc	Tue Jun 14 10:17:32 2016 -0400
+++ b/liboctave/numeric/oct-fftw.cc	Tue Jun 14 10:24:39 2016 -0400
@@ -40,7 +40,7 @@
 #include "singleton-cleanup.h"
 
 #if defined (HAVE_FFTW3_THREADS) || defined (HAVE_FFTW3F_THREADS)
-#  include "nproc.h"
+#  include "nproc-wrapper.h"
 #endif
 
 #if defined (HAVE_FFTW)
@@ -82,7 +82,7 @@
 
   // Use number of processors available to the current process
   // This can be later changed with fftw ("threads", nthreads).
-  nthreads = num_processors (NPROC_CURRENT);
+  nthreads = octave_num_processors_wrapper (OCTAVE_NPROC_CURRENT);
   fftw_plan_with_nthreads (nthreads);
 #endif
 
@@ -440,7 +440,7 @@
 
   // Use number of processors available to the current process
   // This can be later changed with fftw ("threads", nthreads).
-  nthreads = num_processors (NPROC_CURRENT);
+  nthreads = octave_num_processors_wrapper (OCTAVE_NPROC_CURRENT);
   fftwf_plan_with_nthreads (nthreads);
 #endif