Go to the documentation of this file.00001
00005 #ifndef DEVICE_H
00006 #define DEVICE_H
00007
00008 #ifndef SKEPU_NUMGPU
00009 #define SKEPU_NUMGPU 0
00010 #endif
00011
00012 #include <vector>
00013
00014 #ifdef SKEPU_OPENCL
00015 #include "device_cl.h"
00016 #include "device_mem_pointer_cl.h"
00017 #endif
00018
00019 #ifdef SKEPU_CUDA
00020 #include "device_cu.h"
00021 #include "device_mem_pointer_cu.h"
00022 #endif
00023
00024 namespace skepu
00025 {
00026
00042 template <typename T>
00043 class Environment
00044 {
00045
00046 public:
00047 static Environment* getInstance();
00048
00049 #ifdef SKEPU_OPENCL
00050 void finishAll_CL();
00051 std::vector<Device_CL*> m_devices_CL;
00052 #endif
00053
00054 #ifdef SKEPU_CUDA
00055 void finishAll_CU();
00056 std::vector<Device_CU*> m_devices_CU;
00057 #endif
00058
00059 void finishAll();
00060
00061 private:
00062 Environment();
00063 ~Environment();
00064
00065 void init();
00066
00067 #ifdef SKEPU_OPENCL
00068 void init_CL();
00069 #endif
00070
00071 #ifdef SKEPU_CUDA
00072 void init_CU();
00073 #endif
00074
00075
00076
00077 private:
00078 static Environment* instance;
00079
00080 };
00081
00082 }
00083
00084 #include "environment.inl"
00085
00086 #endif