Convenient way to show OpenCL error codes? -



Convenient way to show OpenCL error codes? -

as per title, there convenient way show readable opencl error codes?

being able convert codes '-1000' name save lot of time browsing through error codes.

this do. believe error list finish opencl 1.2.

cl_int result = clsomefunction(); if(result != cl_success) std::cerr << geterrorstring(result) << std::endl;

and geterrorstring defined follows:

const char *geterrorstring(cl_int error) { switch(error){ // run-time , jit compiler errors case 0: homecoming "cl_success"; case -1: homecoming "cl_device_not_found"; case -2: homecoming "cl_device_not_available"; case -3: homecoming "cl_compiler_not_available"; case -4: homecoming "cl_mem_object_allocation_failure"; case -5: homecoming "cl_out_of_resources"; case -6: homecoming "cl_out_of_host_memory"; case -7: homecoming "cl_profiling_info_not_available"; case -8: homecoming "cl_mem_copy_overlap"; case -9: homecoming "cl_image_format_mismatch"; case -10: homecoming "cl_image_format_not_supported"; case -11: homecoming "cl_build_program_failure"; case -12: homecoming "cl_map_failure"; case -13: homecoming "cl_misaligned_sub_buffer_offset"; case -14: homecoming "cl_exec_status_error_for_events_in_wait_list"; case -15: homecoming "cl_compile_program_failure"; case -16: homecoming "cl_linker_not_available"; case -17: homecoming "cl_link_program_failure"; case -18: homecoming "cl_device_partition_failed"; case -19: homecoming "cl_kernel_arg_info_not_available"; // compile-time errors case -30: homecoming "cl_invalid_value"; case -31: homecoming "cl_invalid_device_type"; case -32: homecoming "cl_invalid_platform"; case -33: homecoming "cl_invalid_device"; case -34: homecoming "cl_invalid_context"; case -35: homecoming "cl_invalid_queue_properties"; case -36: homecoming "cl_invalid_command_queue"; case -37: homecoming "cl_invalid_host_ptr"; case -38: homecoming "cl_invalid_mem_object"; case -39: homecoming "cl_invalid_image_format_descriptor"; case -40: homecoming "cl_invalid_image_size"; case -41: homecoming "cl_invalid_sampler"; case -42: homecoming "cl_invalid_binary"; case -43: homecoming "cl_invalid_build_options"; case -44: homecoming "cl_invalid_program"; case -45: homecoming "cl_invalid_program_executable"; case -46: homecoming "cl_invalid_kernel_name"; case -47: homecoming "cl_invalid_kernel_definition"; case -48: homecoming "cl_invalid_kernel"; case -49: homecoming "cl_invalid_arg_index"; case -50: homecoming "cl_invalid_arg_value"; case -51: homecoming "cl_invalid_arg_size"; case -52: homecoming "cl_invalid_kernel_args"; case -53: homecoming "cl_invalid_work_dimension"; case -54: homecoming "cl_invalid_work_group_size"; case -55: homecoming "cl_invalid_work_item_size"; case -56: homecoming "cl_invalid_global_offset"; case -57: homecoming "cl_invalid_event_wait_list"; case -58: homecoming "cl_invalid_event"; case -59: homecoming "cl_invalid_operation"; case -60: homecoming "cl_invalid_gl_object"; case -61: homecoming "cl_invalid_buffer_size"; case -62: homecoming "cl_invalid_mip_level"; case -63: homecoming "cl_invalid_global_work_size"; case -64: homecoming "cl_invalid_property"; case -65: homecoming "cl_invalid_image_descriptor"; case -66: homecoming "cl_invalid_compiler_options"; case -67: homecoming "cl_invalid_linker_options"; case -68: homecoming "cl_invalid_device_partition_count"; // extension errors case -1000: homecoming "cl_invalid_gl_sharegroup_reference_khr"; case -1001: homecoming "cl_platform_not_found_khr"; case -1002: homecoming "cl_invalid_d3d10_device_khr"; case -1003: homecoming "cl_invalid_d3d10_resource_khr"; case -1004: homecoming "cl_d3d10_resource_already_acquired_khr"; case -1005: homecoming "cl_d3d10_resource_not_acquired_khr"; default: homecoming "unknown opencl error"; } }

opencl error-code

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -