14 #if ( SETTING_OPENCL != 0 )
37 Exception::Exception(
char const*
const file,
unsigned int const line, std::string
const& what, cl_int
const code ) {
39 char const* message =
"<unknown error>";
41 case CL_SUCCESS: { message =
"CL_SUCCESS";
break; }
42 case CL_DEVICE_NOT_FOUND: { message =
"CL_DEVICE_NOT_FOUND";
break; }
43 case CL_DEVICE_NOT_AVAILABLE: { message =
"CL_DEVICE_NOT_AVAILABLE";
break; }
44 case CL_COMPILER_NOT_AVAILABLE: { message =
"CL_COMPILER_NOT_AVAILABLE";
break; }
45 case CL_MEM_OBJECT_ALLOCATION_FAILURE: { message =
"CL_MEM_OBJECT_ALLOCATION_FAILURE";
break; }
46 case CL_OUT_OF_RESOURCES: { message =
"CL_OUT_OF_RESOURCES";
break; }
47 case CL_OUT_OF_HOST_MEMORY: { message =
"CL_OUT_OF_HOST_MEMORY";
break; }
48 case CL_PROFILING_INFO_NOT_AVAILABLE: { message =
"CL_PROFILING_INFO_NOT_AVAILABLE";
break; }
49 case CL_MEM_COPY_OVERLAP: { message =
"CL_MEM_COPY_OVERLAP";
break; }
50 case CL_IMAGE_FORMAT_MISMATCH: { message =
"CL_IMAGE_FORMAT_MISMATCH";
break; }
51 case CL_IMAGE_FORMAT_NOT_SUPPORTED: { message =
"CL_IMAGE_FORMAT_NOT_SUPPORTED";
break; }
52 case CL_BUILD_PROGRAM_FAILURE: { message =
"CL_BUILD_PROGRAM_FAILURE";
break; }
53 case CL_MAP_FAILURE: { message =
"CL_MAP_FAILURE";
break; }
54 case CL_MISALIGNED_SUB_BUFFER_OFFSET: { message =
"CL_MISALIGNED_SUB_BUFFER_OFFSET";
break; }
55 case CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST: { message =
"CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST";
break; }
56 case CL_INVALID_VALUE: { message =
"CL_INVALID_VALUE";
break; }
57 case CL_INVALID_DEVICE_TYPE: { message =
"CL_INVALID_DEVICE_TYPE";
break; }
58 case CL_INVALID_PLATFORM: { message =
"CL_INVALID_PLATFORM";
break; }
59 case CL_INVALID_DEVICE: { message =
"CL_INVALID_DEVICE";
break; }
60 case CL_INVALID_CONTEXT: { message =
"CL_INVALID_CONTEXT";
break; }
61 case CL_INVALID_QUEUE_PROPERTIES: { message =
"CL_INVALID_QUEUE_PROPERTIES";
break; }
62 case CL_INVALID_COMMAND_QUEUE: { message =
"CL_INVALID_COMMAND_QUEUE";
break; }
63 case CL_INVALID_HOST_PTR: { message =
"CL_INVALID_HOST_PTR";
break; }
64 case CL_INVALID_MEM_OBJECT: { message =
"CL_INVALID_MEM_OBJECT";
break; }
65 case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR: { message =
"CL_INVALID_IMAGE_FORMAT_DESCRIPTOR";
break; }
66 case CL_INVALID_IMAGE_SIZE: { message =
"CL_INVALID_IMAGE_SIZE";
break; }
67 case CL_INVALID_SAMPLER: { message =
"CL_INVALID_SAMPLER";
break; }
68 case CL_INVALID_BINARY: { message =
"CL_INVALID_BINARY";
break; }
69 case CL_INVALID_BUILD_OPTIONS: { message =
"CL_INVALID_BUILD_OPTIONS";
break; }
70 case CL_INVALID_PROGRAM: { message =
"CL_INVALID_PROGRAM";
break; }
71 case CL_INVALID_PROGRAM_EXECUTABLE: { message =
"CL_INVALID_PROGRAM_EXECUTABLE";
break; }
72 case CL_INVALID_KERNEL_NAME: { message =
"CL_INVALID_KERNEL_NAME";
break; }
73 case CL_INVALID_KERNEL_DEFINITION: { message =
"CL_INVALID_KERNEL_DEFINITION";
break; }
74 case CL_INVALID_KERNEL: { message =
"CL_INVALID_KERNEL";
break; }
75 case CL_INVALID_ARG_INDEX: { message =
"CL_INVALID_ARG_INDEX";
break; }
76 case CL_INVALID_ARG_VALUE: { message =
"CL_INVALID_ARG_VALUE";
break; }
77 case CL_INVALID_ARG_SIZE: { message =
"CL_INVALID_ARG_SIZE";
break; }
78 case CL_INVALID_KERNEL_ARGS: { message =
"CL_INVALID_KERNEL_ARGS";
break; }
79 case CL_INVALID_WORK_DIMENSION: { message =
"CL_INVALID_WORK_DIMENSION";
break; }
80 case CL_INVALID_WORK_GROUP_SIZE: { message =
"CL_INVALID_WORK_GROUP_SIZE";
break; }
81 case CL_INVALID_WORK_ITEM_SIZE: { message =
"CL_INVALID_WORK_ITEM_SIZE";
break; }
82 case CL_INVALID_GLOBAL_OFFSET: { message =
"CL_INVALID_GLOBAL_OFFSET";
break; }
83 case CL_INVALID_EVENT_WAIT_LIST: { message =
"CL_INVALID_EVENT_WAIT_LIST";
break; }
84 case CL_INVALID_EVENT: { message =
"CL_INVALID_EVENT";
break; }
85 case CL_INVALID_OPERATION: { message =
"CL_INVALID_OPERATION";
break; }
86 case CL_INVALID_GL_OBJECT: { message =
"CL_INVALID_GL_OBJECT";
break; }
87 case CL_INVALID_BUFFER_SIZE: { message =
"CL_INVALID_BUFFER_SIZE";
break; }
88 case CL_INVALID_MIP_LEVEL: { message =
"CL_INVALID_MIP_LEVEL";
break; }
89 case CL_INVALID_GLOBAL_WORK_SIZE: { message =
"CL_INVALID_GLOBAL_WORK_SIZE";
break; }
90 case CL_INVALID_PROPERTY: { message =
"CL_INVALID_PROPERTY";
break; }
93 std::stringstream stream;
94 stream << file <<
" - line " << line << std::endl <<
'\t' <<
CollapseWhitespace( what ) << std::endl <<
'\t' << message <<
" (code=" << code <<
')';
95 m_what = stream.str();
99 Exception::~Exception() throw() {
105 return m_what.c_str();
116 #endif // SETTING_OPENCL