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__
void setFrequency(double f)
void setThreadPerBlock(size_t val)
const char * getCompCompatibility()
bool satisfy(GenericResource *resource) override
Capacity getGlobalMemory()
void setOverlap(bool flag)
void setCompCompatibility(const char *cap)
Capacity getSharedMemory()
void setConstantMemory(Capacity c)
Capacity getConstantMemory()
Node * clone() override
size_t getThreadPerBlock()
void setSharedMemory(Capacity c)
void setCores(size_t n)
void setResgisterPerBlock(size_t val)
void setGlobalMemory(Capacity c)
size_t getRegisterPerBlock()
a Node of a Graph
Definition: node.h:68
size_t Capacity
Definition: primresource.h:22
The main, catch-all namespace for YARP.
Definition: environment.h:18