LAMA
/home/brandes/workspace/LAMA/src/lama/cuda/CUDAHostContextManager.hpp
Go to the documentation of this file.
00001 
00033 #ifndef LAMA_CUDA_HOST_CONTEXT_MANAGER_HPP_
00034 #define LAMA_CUDA_HOST_CONTEXT_MANAGER_HPP_
00035 
00036 // for dll_import
00037 #include <lama/config.hpp>
00038 
00039 // base classes
00040 #include <lama/ContextManager.hpp>
00041 
00042 // boost
00043 #include <boost/weak_ptr.hpp>
00044 
00045 namespace lama
00046 {
00047 
00048 class CUDAHostContext;
00049 
00057 class LAMA_DLL_IMPORTEXPORT CUDAHostContextManager : public ContextManager
00058 {
00059 
00060 public:
00061 
00062     virtual ContextPtr getContext( int contextNr );
00063 
00064     ~CUDAHostContextManager();
00065 
00070     static void setAsCurrent( ContextPtr cudaContext );
00071 
00072 private:
00073 
00074     CUDAHostContextManager();
00075 
00076     static boost::weak_ptr<const class CUDAHostContext> contextInstance;
00077 
00078     static int cudaDeviceNr;   // number of CUDA device for faster transfer
00079 
00080     static CUDAHostContextManager theInstance; // singleton instance of this class
00081 };
00082 
00083 }
00084 
00085 #endif // LAMA_CUDA_HOST_CONTEXT_MANAGER_HPP_