MCPcopy Create free account
hub / github.com/clMathLibraries/clBLAS / OpenCL_V_Throw

Function OpenCL_V_Throw

src/client/clGemm.h:131–153  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

129// If an error occurs, we throw.
130// Note: std::runtime_error does not take unicode strings as input, so only strings supported
131inline 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
156enum complexity_t { not_complex = 1, yes_complex = 2 };

Callers

nothing calls this directly

Calls 1

prettyPrintClStatusFunction · 0.70

Tested by

no test coverage detected