This is used to either wrap an OpenCL function call, or to explicitly check a variable for an OpenCL error condition. If an error occurs, we throw. Note: std::runtime_error does not take unicode strings as input, so only strings supported
| 129 | // If an error occurs, we throw. |
| 130 | // Note: std::runtime_error does not take unicode strings as input, so only strings supported |
| 131 | inline cl_int OpenCL_V_Throw( cl_int res, const std::string& msg, size_t lineno ) |
| 132 | { |
| 133 | switch( res ) |
| 134 | { |
| 135 | case CL_SUCCESS: /**< No error */ |
| 136 | break; |
| 137 | default: |
| 138 | { |
| 139 | std::stringstream tmp; |
| 140 | tmp << "OPENCL_V_THROWERROR< "; |
| 141 | tmp << prettyPrintClStatus(res) ; |
| 142 | tmp << " > ("; |
| 143 | tmp << lineno; |
| 144 | tmp << "): "; |
| 145 | tmp << msg; |
| 146 | std::string errorm(tmp.str()); |
| 147 | std::cout << errorm<< std::endl; |
| 148 | throw std::runtime_error( errorm ); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | return res; |
| 153 | } |
| 154 | #define OPENCL_V_THROW(_status,_message) OpenCL_V_Throw(_status, _message, __LINE__) |
| 155 | |
| 156 | enum complexity_t { not_complex = 1, yes_complex = 2 }; |
nothing calls this directly
no test coverage detected