SkePU 0.7
include/skepu/globals.h
Go to the documentation of this file.
00001 
00005 #include <string>
00006 #include <iostream>
00007 
00008 namespace skepu
00009 {
00010 
00015 #define MAX_GPU_DEVICES 4
00016 
00017 #ifndef SKEPU_NUMGPU
00018     #define SKEPU_NUMGPU 1
00019 #elif defined(SKEPU_CUDA) // Only when CUDA is enabled and multi-GPU is possible
00020     #define USE_PINNED_MEMORY   
00021 #endif
00022 
00023 // used when checking shared memory and overlap exceeding that in mapoverlap_cu.inl
00024 #define SHMEM_SAFITY_BUFFER 30
00025 
00026 class skepu_error
00027 {
00028   private:
00029     std::string message;
00030  
00031   public:
00032     skepu_error(std::string m) { message = m; }
00033     inline std::string getMessage() { return message; };
00034     friend std::ostream& operator<<(std::ostream &os, skepu_error& err)
00035     {
00036       os<<"SKEPU: "<<(err.getMessage())<<"\n";
00037       return os;
00038     }
00039 
00040 };
00041 
00042 #ifndef _NO_EXCEPTION
00043 
00044 #define REPORT_ERROR(ErrormMsg)  throw skepu::skepu_error( ErrormMsg);
00045 
00046 #else
00047 inline void _skepu_error (const char* pErrMsg)
00048 {
00049     cerr << "SKEPU ERROR: " + pErrMsg << endl;
00050     exit(1);
00051 }
00052 
00053 #define REPORT_ERROR(ErrormMsg)  skepu::_matrix_error( ErrormMsg);
00054 
00055 #endif
00056 
00057 }
00058 
 All Classes Namespaces Files Functions Enumerations Friends Defines