|
||||
Warning, file /include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 // This file is part of Eigen, a lightweight C++ template library 0002 // for linear algebra. 0003 // 0004 // Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com> 0005 // 0006 // This Source Code Form is subject to the terms of the Mozilla 0007 // Public License v. 2.0. If a copy of the MPL was not distributed 0008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 0009 0010 #ifndef EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 0011 #define EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H 0012 0013 namespace Eigen { 0014 0015 // This defines an interface that ThreadPoolDevice can take to use 0016 // custom thread pools underneath. 0017 class ThreadPoolInterface { 0018 public: 0019 // Submits a closure to be run by a thread in the pool. 0020 virtual void Schedule(std::function<void()> fn) = 0; 0021 0022 // Submits a closure to be run by threads in the range [start, end) in the 0023 // pool. 0024 virtual void ScheduleWithHint(std::function<void()> fn, int /*start*/, 0025 int /*end*/) { 0026 // Just defer to Schedule in case sub-classes aren't interested in 0027 // overriding this functionality. 0028 Schedule(fn); 0029 } 0030 0031 // If implemented, stop processing the closures that have been enqueued. 0032 // Currently running closures may still be processed. 0033 // If not implemented, does nothing. 0034 virtual void Cancel() {} 0035 0036 // Returns the number of threads in the pool. 0037 virtual int NumThreads() const = 0; 0038 0039 // Returns a logical thread index between 0 and NumThreads() - 1 if called 0040 // from one of the threads in the pool. Returns -1 otherwise. 0041 virtual int CurrentThreadId() const = 0; 0042 0043 virtual ~ThreadPoolInterface() {} 0044 }; 0045 0046 } // namespace Eigen 0047 0048 #endif // EIGEN_CXX11_THREADPOOL_THREAD_POOL_INTERFACE_H
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |