GPUOcelot
|
00001 /* \file MulticoreCPUDevice.h 00002 \author Gregory Diamos <gregory.diamos@gatech.edu> 00003 \date Tuesday April 20, 2010 00004 \brief The header file for the MulticoreCPUDevice class. 00005 */ 00006 00007 #ifndef MULTICORE_CPU_DEVICE_H_INCLUDED 00008 #define MULTICORE_CPU_DEVICE_H_INCLUDED 00009 00010 // ocelot includes 00011 #include <ocelot/executive/interface/EmulatorDevice.h> 00012 00013 namespace executive 00014 { 00016 class MulticoreCPUDevice : public EmulatorDevice 00017 { 00018 private: 00020 class Module : public EmulatorDevice::Module 00021 { 00022 public: 00024 Module(const ir::Module* m = 0, Device* d = 0); 00025 00027 ~Module(); 00028 00029 public: 00031 ExecutableKernel* getKernel(const std::string& name); 00032 }; 00033 00034 private: 00036 unsigned int _workerThreads; 00038 translator::Translator::OptimizationLevel _optimizationLevel; 00039 00040 public: 00042 MulticoreCPUDevice(unsigned int flags = 0); 00043 00044 public: 00046 void load(const ir::Module* module); 00048 ExecutableKernel* getKernel(const std::string& module, 00049 const std::string& kernel); 00050 00051 public: 00063 void launch(const std::string& module, 00064 const std::string& kernel, const ir::Dim3& grid, 00065 const ir::Dim3& block, size_t sharedMemory, 00066 const void* argumentBlock, size_t argumentBlockSize, 00067 const trace::TraceGeneratorVector& 00068 traceGenerators = trace::TraceGeneratorVector(), 00069 const ir::ExternalFunctionSet* externals = 0); 00070 00071 public: 00073 void limitWorkerThreads(unsigned int threads); 00075 void setOptimizationLevel( 00076 translator::Translator::OptimizationLevel level); 00077 }; 00078 00079 } 00080 00081 #endif 00082