gpu_resource.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00033 #ifndef __gpu_resource__header__
00034 #define __gpu_resource__header__
00035
00036
00037 #include "gpucalc/object.h"
00038
00039 namespace gpucalc
00040 {
00041
00042 class GPUResource: virtual public Object
00043 {
00044
00045
00046 OBJ_DISABLE_COPY(GPUResource)
00047
00048
00049
00050 public:
00051 GPUResource(const std::string & ClassName, const std::string & ObjectName): Object(ClassName, ObjectName),
00052 mNumberOfComponents(0), mSizeX(0), mSizeY(0), mSizeZ(0), mDimension(0), mTypeSize(0), mComponentSize(0),
00053 mActualLengthGPU(0)
00054 {
00055 }
00056
00057
00058 virtual ~GPUResource()
00059 {
00060 }
00061
00062
00063 virtual size_t getNumberOfComponents() const
00064 {
00065 return mNumberOfComponents;
00066 }
00067
00068
00069 virtual int getSizeX() const
00070 {
00071 return mSizeX;
00072 }
00073
00074
00075 virtual int getSizeY() const
00076 {
00077 return mSizeY;
00078 }
00079
00080
00081 virtual int getSizeZ() const
00082 {
00083 return mSizeZ;
00084 }
00085
00086
00087 virtual int getDimension() const
00088 {
00089 return mDimension;
00090 }
00091
00092
00093 virtual size_t getTypeSize() const
00094 {
00095 return mTypeSize;
00096 }
00097
00098
00099 virtual size_t getComponentSize() const
00100 {
00101 return mComponentSize;
00102 }
00103
00104
00105 virtual size_t getActualLengthGPU() const
00106 {
00107 return mActualLengthGPU;
00108 }
00109
00110
00111 virtual void uploadToGPU() = 0;
00112
00113
00114 virtual bool isUploadedToGPU() const = 0;
00115
00116
00117 virtual void initialize() = 0;
00118
00119
00120 virtual bool isInitialized() const = 0;
00121
00122
00123
00124 protected:
00125 size_t mNumberOfComponents;
00126 size_t mSizeX;
00127 size_t mSizeY;
00128 size_t mSizeZ;
00129 size_t mDimension;
00130 size_t mTypeSize;
00131 size_t mComponentSize;
00132 size_t mActualLengthGPU;
00133 };
00134
00135
00136 }
00137
00138 #endif