/*
 * oclh_h_base_clapi_strings.c
 *      Author: havock
 */
#include <oclh_h_base_clapi_strings.h>
char* _ghf_CLAPIErrString(const cl_int clErr) {
/* OpenCL 1.2 list */
/*
 * TODO: check OpenCL 2.2 codes
 */
    switch(clErr) {
#ifdef CL_SUCCESS
  case CL_SUCCESS:                  return("CL_SUCCESS");
#endif
#ifdef CL_DEVICE_NOT_FOUND
  case CL_DEVICE_NOT_FOUND:         return("CL_DEVICE_NOT_FOUND");
#endif
#ifdef CL_DEVICE_NOT_AVAILABLE
  case CL_DEVICE_NOT_AVAILABLE:     return("CL_DEVICE_NOT_AVAILABLE");
#endif
#ifdef CL_COMPILER_NOT_AVAILABLE
  case CL_COMPILER_NOT_AVAILABLE:   return("CL_COMPILER_NOT_AVAILABLE");
#endif
#ifdef CL_MEM_OBJECT_ALLOCATION_FAILURE
  case CL_MEM_OBJECT_ALLOCATION_FAILURE:
                                    return("CL_MEM_OBJECT_ALLOCATION_FAILURE");
#endif
#ifdef CL_OUT_OF_RESOURCES
  case CL_OUT_OF_RESOURCES:         return("CL_OUT_OF_RESOURCES");
#endif
#ifdef CL_OUT_OF_HOST_MEMORY
  case CL_OUT_OF_HOST_MEMORY:       return("CL_OUT_OF_HOST_MEMORY");
#endif
#ifdef CL_PROFILING_INFO_NOT_AVAILABLE
  case CL_PROFILING_INFO_NOT_AVAILABLE:
                                    return("CL_PROFILING_INFO_NOT_AVAILABLE");
#endif
#ifdef CL_MEM_COPY_OVERLAP
  case CL_MEM_COPY_OVERLAP:         return("CL_MEM_COPY_OVERLAP");
#endif
#ifdef CL_IMAGE_FORMAT_MISMATCH
  case CL_IMAGE_FORMAT_MISMATCH:    return("CL_IMAGE_FORMAT_MISMATCH");
#endif
#ifdef CL_IMAGE_FORMAT_NOT_SUPPORTED
  case CL_IMAGE_FORMAT_NOT_SUPPORTED:
                                    return("CL_IMAGE_FORMAT_NOT_SUPPORTED");
#endif
#ifdef CL_BUILD_PROGRAM_FAILURE
  case CL_BUILD_PROGRAM_FAILURE:    return("CL_BUILD_PROGRAM_FAILURE");
#endif
#ifdef CL_MAP_FAILURE
  case CL_MAP_FAILURE:              return("CL_MAP_FAILURE");
#endif
#ifdef CL_MISALIGNED_SUB_BUFFER_OFFSET
  case CL_MISALIGNED_SUB_BUFFER_OFFSET:
                                    return("CL_MISALIGNED_SUB_BUFFER_OFFSET");
#endif
#ifdef CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
  case CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST:
                         return("CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST");
#endif
#ifdef CL_COMPILE_PROGRAM_FAILURE
  case CL_COMPILE_PROGRAM_FAILURE:  return("CL_COMPILE_PROGRAM_FAILURE");
#endif
#ifdef CL_LINKER_NOT_AVAILABLE
  case CL_LINKER_NOT_AVAILABLE:     return("CL_LINKER_NOT_AVAILABLE");
#endif
#ifdef CL_LINK_PROGRAM_FAILURE
  case CL_LINK_PROGRAM_FAILURE:     return("CL_LINK_PROGRAM_FAILURE");
#endif
#ifdef CL_DEVICE_PARTITION_FAILED
  case CL_DEVICE_PARTITION_FAILED:  return("CL_DEVICE_PARTITION_FAILED");
#endif
#ifdef CL_KERNEL_ARG_INFO_NOT_AVAILABLE
  case CL_KERNEL_ARG_INFO_NOT_AVAILABLE:
                                    return("CL_KERNEL_ARG_INFO_NOT_AVAILABLE");
#endif
#ifdef CL_INVALID_VALUE
  case CL_INVALID_VALUE:            return("CL_INVALID_VALUE");
#endif
#ifdef CL_INVALID_DEVICE_TYPE
  case CL_INVALID_DEVICE_TYPE:      return("CL_INVALID_DEVICE_TYPE");
#endif
#ifdef CL_INVALID_PLATFORM
  case CL_INVALID_PLATFORM:         return("CL_INVALID_PLATFORM");
#endif
#ifdef CL_INVALID_DEVICE
  case CL_INVALID_DEVICE:           return("CL_INVALID_DEVICE");
#endif
#ifdef CL_INVALID_CONTEXT
  case CL_INVALID_CONTEXT:          return("CL_INVALID_CONTEXT");
#endif
#ifdef CL_INVALID_QUEUE_PROPERTIES
  case CL_INVALID_QUEUE_PROPERTIES: return("CL_INVALID_QUEUE_PROPERTIES");
#endif
#ifdef CL_INVALID_COMMAND_QUEUE
  case CL_INVALID_COMMAND_QUEUE:    return("CL_INVALID_COMMAND_QUEUE");
#endif
#ifdef CL_INVALID_HOST_PTR
  case CL_INVALID_HOST_PTR:         return("CL_INVALID_HOST_PTR");
#endif
#ifdef CL_INVALID_MEM_OBJECT
  case CL_INVALID_MEM_OBJECT:       return("CL_INVALID_MEM_OBJECT");
#endif
#ifdef CL_INVALID_IMAGE_FORMAT_DESCRIPTOR
  case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR:
                                   return("CL_INVALID_IMAGE_FORMAT_DESCRIPTOR");
#endif
#ifdef CL_INVALID_IMAGE_SIZE
  case CL_INVALID_IMAGE_SIZE:       return("CL_INVALID_IMAGE_SIZE");
#endif
#ifdef CL_INVALID_SAMPLER
  case CL_INVALID_SAMPLER:          return("CL_INVALID_SAMPLER");
#endif
#ifdef CL_INVALID_BINARY
  case CL_INVALID_BINARY:           return("CL_INVALID_BINARY");
#endif
#ifdef CL_INVALID_BUILD_OPTIONS
  case CL_INVALID_BUILD_OPTIONS:    return("CL_INVALID_BUILD_OPTIONS");
#endif
#ifdef CL_INVALID_PROGRAM
  case CL_INVALID_PROGRAM:          return("CL_INVALID_PROGRAM");
#endif
#ifdef CL_INVALID_PROGRAM_EXECUTABLE
  case CL_INVALID_PROGRAM_EXECUTABLE:
                                    return("CL_INVALID_PROGRAM_EXECUTABLE");
#endif
#ifdef CL_INVALID_KERNEL_NAME
  case CL_INVALID_KERNEL_NAME:      return("CL_INVALID_KERNEL_NAME");
#endif
#ifdef CL_INVALID_KERNEL_DEFINITION
  case CL_INVALID_KERNEL_DEFINITION:return("CL_INVALID_KERNEL_DEFINITION");
#endif
#ifdef CL_INVALID_KERNEL
  case CL_INVALID_KERNEL:           return("CL_INVALID_KERNEL");
#endif
#ifdef CL_INVALID_ARG_INDEX
  case CL_INVALID_ARG_INDEX:        return("CL_INVALID_ARG_INDEX");
#endif
#ifdef CL_INVALID_ARG_VALUE
  case CL_INVALID_ARG_VALUE:        return("CL_INVALID_ARG_VALUE");
#endif
#ifdef CL_INVALID_ARG_SIZE
  case CL_INVALID_ARG_SIZE:         return("CL_INVALID_ARG_SIZE");
#endif
#ifdef CL_INVALID_KERNEL_ARGS
  case CL_INVALID_KERNEL_ARGS:      return("CL_INVALID_KERNEL_ARGS");
#endif
#ifdef CL_INVALID_WORK_DIMENSION
  case CL_INVALID_WORK_DIMENSION:   return("CL_INVALID_WORK_DIMENSION");
#endif
#ifdef CL_INVALID_WORK_GROUP_SIZE
  case CL_INVALID_WORK_GROUP_SIZE:  return("CL_INVALID_WORK_GROUP_SIZE");
#endif
#ifdef CL_INVALID_WORK_ITEM_SIZE
  case CL_INVALID_WORK_ITEM_SIZE:   return("CL_INVALID_WORK_ITEM_SIZE");
#endif
#ifdef CL_INVALID_GLOBAL_OFFSET
  case CL_INVALID_GLOBAL_OFFSET:    return("CL_INVALID_GLOBAL_OFFSET");
#endif
#ifdef CL_INVALID_EVENT_WAIT_LIST
  case CL_INVALID_EVENT_WAIT_LIST:  return("CL_INVALID_EVENT_WAIT_LIST");
#endif
#ifdef CL_INVALID_EVENT
  case CL_INVALID_EVENT:            return("CL_INVALID_EVENT");
#endif
#ifdef CL_INVALID_OPERATION
  case CL_INVALID_OPERATION:        return("CL_INVALID_OPERATION");
#endif
#ifdef CL_INVALID_GL_OBJECT
  case CL_INVALID_GL_OBJECT:        return("CL_INVALID_GL_OBJECT");
#endif
#ifdef CL_INVALID_BUFFER_SIZE
  case CL_INVALID_BUFFER_SIZE:      return("CL_INVALID_BUFFER_SIZE");
#endif
#ifdef CL_INVALID_MIP_LEVEL
  case CL_INVALID_MIP_LEVEL:        return("CL_INVALID_MIP_LEVEL");
#endif
#ifdef CL_INVALID_GLOBAL_WORK_SIZE
  case CL_INVALID_GLOBAL_WORK_SIZE: return("CL_INVALID_GLOBAL_WORK_SIZE");
#endif
#ifdef CL_INVALID_PROPERTY
  case CL_INVALID_PROPERTY:         return("CL_INVALID_PROPERTY");
#endif
#ifdef CL_INVALID_IMAGE_DESCRIPTOR
  case CL_INVALID_IMAGE_DESCRIPTOR: return("CL_INVALID_IMAGE_DESCRIPTOR");
#endif
#ifdef CL_INVALID_COMPILER_OPTIONS
  case CL_INVALID_COMPILER_OPTIONS: return("CL_INVALID_COMPILER_OPTIONS");
#endif
#ifdef CL_INVALID_LINKER_OPTIONS
  case CL_INVALID_LINKER_OPTIONS:   return("CL_INVALID_LINKER_OPTIONS");
#endif
#ifdef CL_INVALID_DEVICE_PARTITION_COUNT
  case CL_INVALID_DEVICE_PARTITION_COUNT:
                                    return("CL_INVALID_DEVICE_PARTITION_COUNT");
#endif
#ifdef CL_PLATFORM_NOT_FOUND_KHR
  case CL_PLATFORM_NOT_FOUND_KHR:
                                    return("CL_PLATFORM_NOT_FOUND_KHR");
#endif
#ifdef CL_DEVICE_PARTITION_FAILED_EXT
  case CL_DEVICE_PARTITION_FAILED_EXT:
                                    return("CL_DEVICE_PARTITION_FAILED_EXT");
#endif
#ifdef CL_INVALID_PARTITION_COUNT_EXT
  case CL_INVALID_PARTITION_COUNT_EXT:
                                    return("CL_INVALID_PARTITION_COUNT_EXT");
#endif
#ifdef CL_INVALID_PARTITION_NAME_EXT
  case CL_INVALID_PARTITION_NAME_EXT:
                                    return("CL_INVALID_PARTITION_NAME_EXT");
#endif
  case -9999:                       return("NVIDIA_CL_SEGMENTATION_FAULT");
  default:                          return("Unknown OpenCL error");
    }
}

char* _ghf_PlatfPropString(const cl_uint clProp) {
/* OpenCL 2.2 list */
    switch(clProp) {
#ifdef CL_PLATFORM_PROFILE
  case CL_PLATFORM_PROFILE:    return("Profile");
#endif
#ifdef CL_PLATFORM_VERSION
  case CL_PLATFORM_VERSION:    return("Version");
#endif
#ifdef CL_PLATFORM_NAME
  case CL_PLATFORM_NAME:       return("Name");
#endif
#ifdef CL_PLATFORM_VENDOR
  case CL_PLATFORM_VENDOR:     return("Vendor");
#endif
#ifdef CL_PLATFORM_EXTENSIONS
  case CL_PLATFORM_EXTENSIONS: return("Extensions");
#endif
#ifdef CL_PLATFORM_HOST_TIMER_RESOLUTION
  case CL_PLATFORM_HOST_TIMER_RESOLUTION:
      return("The resolution of the host timer");
#endif
        default: return("Unknown OpenCL platform property!");
    }
}

char* _ghf_DevPropSuffixString(const cl_device_info clDevInf,
                               const _GHE_RECTYPE   rt) {
/* OpenCL 2.2 list */
    switch(clDevInf) {
#ifdef CL_DEVICE_TYPE
        case CL_DEVICE_TYPE: return(rt?"Type:":"");
#endif
#ifdef CL_DEVICE_VENDOR_ID
        case CL_DEVICE_VENDOR_ID: return(rt?"Vendor ID:":"");
#endif
#ifdef CL_DEVICE_MAX_COMPUTE_UNITS
  case CL_DEVICE_MAX_COMPUTE_UNITS:
      return(rt?"Max compute units (work-groups):":"");
#endif
#ifdef CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
  case CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS:
      return(rt?"Max work-item dimensions:":"");
#endif
#ifdef CL_DEVICE_MAX_WORK_ITEM_SIZES
  case CL_DEVICE_MAX_WORK_ITEM_SIZES: return(rt?"Max work-item sizes:":"");
#endif
#ifdef CL_DEVICE_MAX_WORK_GROUP_SIZE
  case CL_DEVICE_MAX_WORK_GROUP_SIZE:
      return(rt?"Max work-group size:":"work-items");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR:
      return(rt?" Preferred vector size | char  :":"");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT:
      return(rt?" Preferred vector size | short :":"");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT:
      return(rt?" Preferred vector size | int   :":"");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG:
      return(rt?" Preferred vector size | long  :":"");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT:
      return(rt?" Preferred vector size | float :":"");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE:
      return(rt?" Preferred vector size | double:":"");
#endif
#ifdef CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF
  case CL_DEVICE_PREFERRED_VECTOR_WIDTH_HALF:
      return(rt?" Preferred vector size | half  :":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR:
      return(rt?" Native vector size | char  :":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_SHORT:
      return(rt?" Native vector size | short :":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_INT
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_INT:
      return(rt?" Native vector size | int   :":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG:
      return(rt?" Native vector size | long  :":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT:
      return(rt?" Native vector size | float :":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE:
      return(rt?" Native vector size | double:":"");
#endif
#ifdef CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF
  case CL_DEVICE_NATIVE_VECTOR_WIDTH_HALF:
      return(rt?" Native vector size | half  :":"");
#endif
#ifdef CL_DEVICE_MAX_CLOCK_FREQUENCY
  case CL_DEVICE_MAX_CLOCK_FREQUENCY: return(rt?"Max clock frequency:":"MHz");
#endif
#ifdef CL_DEVICE_ADDRESS_BITS
  case CL_DEVICE_ADDRESS_BITS:        return(rt?"Address space size:":"bits");
#endif
#ifdef CL_DEVICE_MAX_MEM_ALLOC_SIZE
  case CL_DEVICE_MAX_MEM_ALLOC_SIZE:return(rt?"Max memory allocation:":"bytes");
#endif
#ifdef CL_DEVICE_IMAGE_SUPPORT
  case CL_DEVICE_IMAGE_SUPPORT:     return(rt?"Image support:":"");
#endif
#ifdef CL_DEVICE_MAX_READ_IMAGE_ARGS
  case CL_DEVICE_MAX_READ_IMAGE_ARGS:
      return(rt?" Image support | "
                "Max number of image objects arguments for reading:":"");
#endif
#ifdef CL_DEVICE_MAX_WRITE_IMAGE_ARGS
  case CL_DEVICE_MAX_WRITE_IMAGE_ARGS:
      return(rt?" Image support | "
                "Max number of image objects arguments for writing:":"");
#endif
#ifdef CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS
  case CL_DEVICE_MAX_READ_WRITE_IMAGE_ARGS:
      return(rt?" Image support | "
                "Max number of image objects arguments for reading and writing:"
                :"");
#endif
#ifdef CL_DEVICE_IMAGE2D_MAX_WIDTH
  case CL_DEVICE_IMAGE2D_MAX_WIDTH:
      return(rt?" Image support | Max 2D-image width:":"pixels");
#endif
#ifdef CL_DEVICE_IMAGE2D_MAX_HEIGHT
  case CL_DEVICE_IMAGE2D_MAX_HEIGHT:
      return(rt?" Image support | Max 2D-image height:":"pixels");
#endif
#ifdef CL_DEVICE_IMAGE3D_MAX_WIDTH
  case CL_DEVICE_IMAGE3D_MAX_WIDTH:
      return(rt?" Image support | Max 3D-image width:":"pixels");
#endif
#ifdef CL_DEVICE_IMAGE3D_MAX_HEIGHT
  case CL_DEVICE_IMAGE3D_MAX_HEIGHT:
      return(rt?" Image support | Max 3D-image height:":"pixels");
#endif
#ifdef CL_DEVICE_IMAGE3D_MAX_DEPTH
  case CL_DEVICE_IMAGE3D_MAX_DEPTH:
      return(rt?" Image support | Max 3D-image depth:":"pixels");
#endif
#ifdef CL_DEVICE_IMAGE_MAX_BUFFER_SIZE
  case CL_DEVICE_IMAGE_MAX_BUFFER_SIZE:
      return(rt?" Image support | "
                "Max number of pixels for 1D-image from buffer:":"pixels");
#endif
#ifdef CL_DEVICE_IMAGE_MAX_ARRAY_SIZE
  case CL_DEVICE_IMAGE_MAX_ARRAY_SIZE:
      return(rt?" Image support | "
                "Max number of images in 1D or 2D image array:":"images");
#endif
#ifdef CL_DEVICE_MAX_SAMPLERS
  case CL_DEVICE_MAX_SAMPLERS:
      return(rt?" Image support | "
                "Max number of samplers used in a kernel:":"samplers");
#endif
#ifdef CL_DEVICE_IMAGE_PITCH_ALIGNMENT
  case CL_DEVICE_IMAGE_PITCH_ALIGNMENT:
      return(rt?" Image support | "
                "The row pitch alignment size for 2D images from a buffer:"
                :"pixels");
#endif
#ifdef CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT
  case CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT:
      return(rt?" Image support | Min alignment of the host_ptr:":"pixels");
#endif
#ifdef CL_DEVICE_MAX_PIPE_ARGS
  case CL_DEVICE_MAX_PIPE_ARGS:
      return(rt?"Max number of pipes passed as arguments to a kernel:":"");
#endif
#ifdef CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS
  case CL_DEVICE_PIPE_MAX_ACTIVE_RESERVATIONS:
      return(rt?"Max number of active reservations for a pipe "
                "per work-item in a kernel:":"");
#endif
#ifdef CL_DEVICE_PIPE_MAX_PACKET_SIZE
  case CL_DEVICE_PIPE_MAX_PACKET_SIZE: return(rt?"Max size of pipe packet:"
                                                 :"bytes");
#endif
#ifdef CL_DEVICE_MAX_PARAMETER_SIZE
  case CL_DEVICE_MAX_PARAMETER_SIZE:
      return(rt?"Max size of all arguments passed to a kernel:":"bytes");
#endif
#ifdef CL_DEVICE_MEM_BASE_ADDR_ALIGN
  case CL_DEVICE_MEM_BASE_ADDR_ALIGN:
      return(rt?"Alignment for sub-buffer offsets:":"bits");
#endif
#ifdef CL_DEVICE_SINGLE_FP_CONFIG
  case CL_DEVICE_SINGLE_FP_CONFIG:
      return(rt?"Supported single precision floating-point capabilities:":"");
#endif
#ifdef CL_DEVICE_DOUBLE_FP_CONFIG
  case CL_DEVICE_DOUBLE_FP_CONFIG:
      return(rt?"Supported double precision floating-point capabilities:":"");
#endif
#ifdef CL_DEVICE_GLOBAL_MEM_CACHE_TYPE
  case CL_DEVICE_GLOBAL_MEM_CACHE_TYPE:
      return(rt?"Global memory cache support:":"");
#endif
#ifdef CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE
  case CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE:
      return(rt?"Size of global memory cache line:":"bytes");
#endif
#ifdef CL_DEVICE_GLOBAL_MEM_CACHE_SIZE
  case CL_DEVICE_GLOBAL_MEM_CACHE_SIZE:
      return(rt?"Size of global memory cache:":"bytes");
#endif
#ifdef CL_DEVICE_GLOBAL_MEM_SIZE
  case CL_DEVICE_GLOBAL_MEM_SIZE:
      return(rt?"Size of global device memory:":"bytes");
#endif
#ifdef CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
  case CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE:
      return(rt?"Max size of a constant buffer allocation:":"bytes");
#endif
#ifdef CL_DEVICE_MAX_CONSTANT_ARGS
  case CL_DEVICE_MAX_CONSTANT_ARGS:
      return(rt?"Max number of arguments declared with "
                "the __constant qualifier in a kernel:":"arguments");
#endif
#ifdef CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE
  case CL_DEVICE_MAX_GLOBAL_VARIABLE_SIZE:
      return(rt?"Max size of storage that may be allocated for any single "
                "variable in program scope or inside a function in OpenCL C "
                "declared in the global address space:":"bytes");
#endif
#ifdef CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE
  case CL_DEVICE_GLOBAL_VARIABLE_PREFERRED_TOTAL_SIZE:
      return(rt?"Maximum preferred total size of all program variables "
                "in the global address space:":"bytes");
#endif
#ifdef CL_DEVICE_LOCAL_MEM_TYPE
  case CL_DEVICE_LOCAL_MEM_TYPE:return(rt?"Type of local memory supported:":"");
#endif
#ifdef CL_DEVICE_LOCAL_MEM_SIZE
  case CL_DEVICE_LOCAL_MEM_SIZE: return(rt?"Size of local memory region:":
                                           "bytes");
#endif
#ifdef CL_DEVICE_ERROR_CORRECTION_SUPPORT
  case CL_DEVICE_ERROR_CORRECTION_SUPPORT:
      return(rt?"Error correction support:":"");
#endif
#ifdef CL_DEVICE_PROFILING_TIMER_RESOLUTION
  case CL_DEVICE_PROFILING_TIMER_RESOLUTION:
      return(rt?"Resolution of device timer:":"nanoseconds");
#endif
#ifdef CL_DEVICE_ENDIAN_LITTLE
  case CL_DEVICE_ENDIAN_LITTLE: return(rt?"Endianness:":"");
#endif
#ifdef CL_DEVICE_AVAILABLE
  case CL_DEVICE_AVAILABLE: return(rt?"Is device available:":"");
#endif
#ifdef CL_DEVICE_COMPILER_AVAILABLE
  case CL_DEVICE_COMPILER_AVAILABLE:
      return(rt?"Is device compiler available:":"");
#endif
#ifdef CL_DEVICE_LINKER_AVAILABLE
  case CL_DEVICE_LINKER_AVAILABLE: return(rt?"Is device linker available:":"");
#endif
  /*
   * TODO: CL_DEVICE_IL_VERSION
   */
#ifdef CL_DEVICE_EXECUTION_CAPABILITIES
  case CL_DEVICE_EXECUTION_CAPABILITIES:
      return(rt?"Execution capabilities of the device:":"");
#endif
#ifdef CL_DEVICE_QUEUE_PROPERTIES /* 2.2 abs */
  case CL_DEVICE_QUEUE_PROPERTIES:
      return(rt?"Command-queue properties supported by the device:":"");
#endif
#ifdef CL_DEVICE_QUEUE_ON_HOST_PROPERTIES
  case CL_DEVICE_QUEUE_ON_HOST_PROPERTIES:
      return(rt?"Host command-queue properties supported by the device:":"");
#endif
#ifdef CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES
  case CL_DEVICE_QUEUE_ON_DEVICE_PROPERTIES:
      return(rt?"Device command-queue properties supported by the device":"");
#endif
#ifdef CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE
  case CL_DEVICE_QUEUE_ON_DEVICE_PREFERRED_SIZE:
      return(rt?"The preferred size of the device queue:":"bytes");
#endif
#ifdef CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE
  case CL_DEVICE_QUEUE_ON_DEVICE_MAX_SIZE:
      return(rt?"The max size of the device queue:":"bytes");
#endif
#ifdef CL_DEVICE_MAX_ON_DEVICE_QUEUES
  case CL_DEVICE_MAX_ON_DEVICE_QUEUES:
      return(rt?"The maximum number of device queues per context:":"queues");
#endif
#ifdef CL_DEVICE_MAX_ON_DEVICE_EVENTS
  case CL_DEVICE_MAX_ON_DEVICE_EVENTS:
      return(rt?"The maximum number of events in use by a device queue:"
                :"events");
#endif
#ifdef CL_DEVICE_BUILT_IN_KERNELS
  case CL_DEVICE_BUILT_IN_KERNELS: return(rt?"Built-in kernels:":"");
#endif
#ifdef CL_DEVICE_PLATFORM
  case CL_DEVICE_PLATFORM: return(rt?"Platform:":"");
#endif
#ifdef CL_DEVICE_NAME
  case CL_DEVICE_NAME: return(rt?"Device name:":"");
#endif
#ifdef CL_DEVICE_VENDOR
  case CL_DEVICE_VENDOR: return(rt?"Device vendor:":"");
#endif
#ifdef CL_DRIVER_VERSION
  case CL_DRIVER_VERSION: return(rt?"Driver version:":"");
#endif
#ifdef CL_DEVICE_PROFILE
  case CL_DEVICE_PROFILE: return(rt?"Device profile:":"");
#endif
#ifdef CL_DEVICE_VERSION
  case CL_DEVICE_VERSION: return(rt?"Device version:":"");
#endif
#ifdef CL_DEVICE_OPENCL_C_VERSION
  case CL_DEVICE_OPENCL_C_VERSION: return(rt?"Device OpenCL C version:":"");
#endif
#ifdef CL_DEVICE_EXTENSIONS
  case CL_DEVICE_EXTENSIONS: return(rt?"Extensions:":"");
#endif
#ifdef CL_DEVICE_PRINTF_BUFFER_SIZE
  case CL_DEVICE_PRINTF_BUFFER_SIZE:
      return(rt?"Maximum size of the internal printf() buffer:":"bytes");
#endif
#ifdef CL_DEVICE_PREFERRED_INTEROP_USER_SYNC
  case CL_DEVICE_PREFERRED_INTEROP_USER_SYNC:
      return(rt?"Is device preferred for the user's responsibility for sync:"
                :"");
#endif
#ifdef CL_DEVICE_PARENT_DEVICE
  case CL_DEVICE_PARENT_DEVICE: return(rt?"The parent device:":"");
#endif
#ifdef CL_DEVICE_PARTITION_MAX_SUB_DEVICES
  case CL_DEVICE_PARTITION_MAX_SUB_DEVICES:
      return(rt?"Max number of sub-devices:":"");
#endif
    /*
     * TODO: CL_DEVICE_PARTITION_PROPERTIES
     * TODO: CL_DEVICE_PARTITION_AFFINITY_DOMAIN
     * TODO: CL_DEVICE_PARTITION_TYPE
     */
#ifdef CL_DEVICE_REFERENCE_COUNT
  case CL_DEVICE_REFERENCE_COUNT: return(rt?"Device reference count:":"");
#endif
#ifdef CL_DEVICE_SVM_CAPABILITIES
  case CL_DEVICE_SVM_CAPABILITIES:
      return(rt?"Shared virtual memory allocation types the device supports:"
                :"");
#endif
#ifdef CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT
  case CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT:
      return(rt?"Preferred alignment for atomic types:":"bytes");
#endif
#ifdef CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT
  case CL_DEVICE_PREFERRED_GLOBAL_ATOMIC_ALIGNMENT:
      return(rt?"Preferred alignment for atomic types to global memory:"
                :"bytes");
#endif
#ifdef CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT
  case CL_DEVICE_PREFERRED_LOCAL_ATOMIC_ALIGNMENT:
      return(rt?"Preferred alignment for atomic types to local memory:"
                :"bytes");
#endif
#ifdef CL_DEVICE_MAX_NUM_SUB_GROUPS
  case CL_DEVICE_MAX_NUM_SUB_GROUPS:
      return(rt?"Maximum number of sub-groups in a work-group that a device is "
                "capable of executing on a single compute unit, for any given "
                "kernel-instance running on the device:":"sub-groups");
#endif
#ifdef CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS
  case CL_DEVICE_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS:
      return(rt?"Does the device support "
                "independent forward progress of sub-groups:":"");
#endif
        default: return(rt?"Unknown OpenCL device property!"
                           :"Unknown measure!");
    }
}
