Mercurial > hg > Game > Cerium
view TaskManager/Cuda/CudaError.h @ 1925:cd5bbd8ec5d6 draft
fix CudaScheduler
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 31 Jan 2014 05:56:23 +0900 |
parents | bd5152f8fe3a |
children | 007131fd87e8 |
line wrap: on
line source
// enum to string // これ自分で書くのあれだよね const char* convert_error_status(unsigned int status){ static const struct { const unsigned int status; const char* status_string; } Error_Status[] = { {cudaSuccess, "cudaSuccess"}, {cudaErrorMissingConfiguration, "cudaErrorMissingConfiguration"}, {cudaErrorMemoryAllocation, "cudaErrorMemoryAllocation"}, {cudaErrorInitializationError, "cudaErrorInitializationError"}, {cudaErrorLaunchFailure, "cudaErrorLaunchFailure"}, {cudaErrorLaunchTimeout, "cudaErrorLaunchTimeout"}, {cudaErrorLaunchOutOfResources, "cudaErrorLaunchOutOfResources"}, {cudaErrorInvalidDeviceFunction, "cudaErrorInvalidDeviceFunction"}, {cudaErrorInvalidConfiguration, "cudaErrorInvalidConfiguration"}, {cudaErrorInvalidDevice, "cudaErrorInvalidDevice"}, {cudaErrorInvalidValue, "cudaErrorInvalidValue"}, {cudaErrorInvalidPitchValue, "cudaErrorInvalidPitchValue"}, {cudaErrorInvalidSymbol, "cudaErrorInvalidSymbol"}, {cudaErrorUnmapBufferObjectFailed, "cudaErrorUnmapBufferObjectFailed"}, {cudaErrorInvalidHostPointer, "cudaErrorInvalidHostPointer"}, {cudaErrorInvalidDevicePointer, "cudaErrorInvalidDevicePointer"}, {cudaErrorInvalidTexture, "cudaErrorInvalidTexture"}, {cudaErrorInvalidTextureBinding, "cudaErrorInvalidTextureBinding"}, {cudaErrorInvalidChannelDescriptor, "cudaErrorInvalidChannelDescriptor"}, {cudaErrorInvalidMemcpyDirection, "cudaErrorInvalidMemcpyDirection"}, {cudaErrorInvalidFilterSetting, "cudaErrorInvalidFilterSetting"}, {cudaErrorInvalidNormSetting, "cudaErrorInvalidNormSetting"}, {cudaErrorUnknown, "cudaErrorUnknown"}, {cudaErrorInvalidResourceHandle, "cudaErrorInvalidResourceHandle"}, {cudaErrorInsufficientDriver, "cudaErrorInsufficientDriver"}, {cudaErrorSetOnActiveProcess, "cudaErrorSetOnActiveProcess"}, {cudaErrorStartupFailure, "cudaErrorStartupFailure"}, {0, NULL} }; const char* message; for(int i=0; Error_Status[i].status_string != NULL; i++) { if (Error_Status[i].status == status) { message = Error_Status[i].status_string; } } return message; }