YARP
Yet Another Robot Platform
physicresource.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_MANAGER_PHYSICRESOURCE
10 #define YARP_MANAGER_PHYSICRESOURCE
11 
12 #include <yarp/manager/ymm-types.h>
13 #include <yarp/manager/node.h>
14 #include <yarp/manager/utility.h>
16 #include <yarp/manager/resource.h>
17 
18 namespace yarp {
19 namespace manager {
20 
21 
22 class GPU : public GenericResource {
23 
24 public:
25  GPU();
26  GPU(const char* szName);
27  GPU(const GPU &res);
28  ~GPU() override;
29  Node* clone() override;
30  bool satisfy(GenericResource* resource) override;
31 
32  void setCores(size_t n) { cores = n; }
33  void setFrequency(double f) { frequency = f; }
34  void setCompCompatibility(const char* cap) { compCompatibility = cap; }
35  void setGlobalMemory(Capacity c) { globalMemory = c; }
36  void setSharedMemory(Capacity c) { sharedMemory = c; }
37  void setConstantMemory(Capacity c) { constantMemory = c; }
38  void setResgisterPerBlock(size_t val) { registerPerBlock = val; }
39  void setThreadPerBlock(size_t val) { threadPerBlock = val; }
40  void setOverlap(bool flag) { bOverlap = flag;}
41 
42  size_t getCores() { return cores; }
43  double getFrequency() { return frequency; }
44  const char* getCompCompatibility() { return compCompatibility.c_str(); }
45  Capacity getGlobalMemory() { return globalMemory; }
46  Capacity getSharedMemory() { return sharedMemory; }
47  Capacity getConstantMemory() { return constantMemory; }
48  size_t getRegisterPerBlock() { return registerPerBlock; }
49  size_t getThreadPerBlock() { return threadPerBlock; }
50  bool getOverlap() { return bOverlap; }
51 
52 protected:
53 
54 private:
55  size_t cores;
56  double frequency;
57  std::string compCompatibility;
58  Capacity globalMemory;
59  Capacity sharedMemory;
60  Capacity constantMemory;
61  size_t registerPerBlock;
62  size_t threadPerBlock;
63  bool bOverlap;
64 };
65 
66 } // namespace yarp
67 } // namespace manager
68 
69 
70 #endif // __YARP_MANAGER_PHYSICRESOURCE__
yarp::manager::GPU::setFrequency
void setFrequency(double f)
Definition: physicresource.h:33
yarp::manager::GPU::setThreadPerBlock
void setThreadPerBlock(size_t val)
Definition: physicresource.h:39
yarp::manager::GPU::~GPU
~GPU() override
yarp::manager::GPU::GPU
GPU()
Class GPU.
Definition: physicresource.cpp:21
yarp::manager::GPU::getRegisterPerBlock
size_t getRegisterPerBlock()
Definition: physicresource.h:48
yarp::manager::GPU::getGlobalMemory
Capacity getGlobalMemory()
Definition: physicresource.h:45
yarp::manager::GPU::getOverlap
bool getOverlap()
Definition: physicresource.h:50
utility.h
yarp::manager::GPU::satisfy
bool satisfy(GenericResource *resource) override
Definition: physicresource.cpp:69
yarp::manager::GPU::getConstantMemory
Capacity getConstantMemory()
Definition: physicresource.h:47
yarp::manager::GPU
Definition: physicresource.h:22
yarp::manager::GPU::getCores
size_t getCores()
Definition: physicresource.h:42
node.h
yarp::manager::Node
a Node of a Graph
Definition: node.h:68
primresource.h
resource.h
ymm-types.h
yarp::manager::GPU::getThreadPerBlock
size_t getThreadPerBlock()
Definition: physicresource.h:49
yarp::manager::Capacity
size_t Capacity
Definition: primresource.h:22
yarp::manager::GPU::getSharedMemory
Capacity getSharedMemory()
Definition: physicresource.h:46
yarp::manager::GPU::setSharedMemory
void setSharedMemory(Capacity c)
Definition: physicresource.h:36
yarp::manager::GenericResource
Definition: resource.h:21
yarp::manager::GPU::clone
Node * clone() override
Definition: physicresource.cpp:62
yarp::manager::GPU::getFrequency
double getFrequency()
Definition: physicresource.h:43
yarp::manager::GPU::setCompCompatibility
void setCompCompatibility(const char *cap)
Definition: physicresource.h:34
yarp::manager::GPU::getCompCompatibility
const char * getCompCompatibility()
Definition: physicresource.h:44
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::manager::GPU::setCores
void setCores(size_t n)
Definition: physicresource.h:32
yarp::manager::GPU::setGlobalMemory
void setGlobalMemory(Capacity c)
Definition: physicresource.h:35
yarp::manager::GPU::setConstantMemory
void setConstantMemory(Capacity c)
Definition: physicresource.h:37
yarp::manager::GPU::setOverlap
void setOverlap(bool flag)
Definition: physicresource.h:40
yarp::manager::GPU::setResgisterPerBlock
void setResgisterPerBlock(size_t val)
Definition: physicresource.h:38