Mercurial > hg > Game > Cerium
annotate 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 |
rev | line source |
---|---|
1908 | 1 // enum to string |
2 // これ自分で書くのあれだよね | |
3 const char* convert_error_status(unsigned int status){ | |
4 static const struct { | |
5 const unsigned int status; | |
6 const char* status_string; | |
7 } Error_Status[] = { | |
8 {cudaSuccess, "cudaSuccess"}, | |
9 {cudaErrorMissingConfiguration, "cudaErrorMissingConfiguration"}, | |
10 {cudaErrorMemoryAllocation, "cudaErrorMemoryAllocation"}, | |
11 {cudaErrorInitializationError, "cudaErrorInitializationError"}, | |
12 {cudaErrorLaunchFailure, "cudaErrorLaunchFailure"}, | |
13 {cudaErrorLaunchTimeout, "cudaErrorLaunchTimeout"}, | |
14 {cudaErrorLaunchOutOfResources, "cudaErrorLaunchOutOfResources"}, | |
15 {cudaErrorInvalidDeviceFunction, "cudaErrorInvalidDeviceFunction"}, | |
16 {cudaErrorInvalidConfiguration, "cudaErrorInvalidConfiguration"}, | |
17 {cudaErrorInvalidDevice, "cudaErrorInvalidDevice"}, | |
18 {cudaErrorInvalidValue, "cudaErrorInvalidValue"}, | |
19 {cudaErrorInvalidPitchValue, "cudaErrorInvalidPitchValue"}, | |
20 {cudaErrorInvalidSymbol, "cudaErrorInvalidSymbol"}, | |
21 {cudaErrorUnmapBufferObjectFailed, "cudaErrorUnmapBufferObjectFailed"}, | |
22 {cudaErrorInvalidHostPointer, "cudaErrorInvalidHostPointer"}, | |
23 {cudaErrorInvalidDevicePointer, "cudaErrorInvalidDevicePointer"}, | |
24 {cudaErrorInvalidTexture, "cudaErrorInvalidTexture"}, | |
25 {cudaErrorInvalidTextureBinding, "cudaErrorInvalidTextureBinding"}, | |
26 {cudaErrorInvalidChannelDescriptor, "cudaErrorInvalidChannelDescriptor"}, | |
27 {cudaErrorInvalidMemcpyDirection, "cudaErrorInvalidMemcpyDirection"}, | |
28 {cudaErrorInvalidFilterSetting, "cudaErrorInvalidFilterSetting"}, | |
29 {cudaErrorInvalidNormSetting, "cudaErrorInvalidNormSetting"}, | |
30 {cudaErrorUnknown, "cudaErrorUnknown"}, | |
31 {cudaErrorInvalidResourceHandle, "cudaErrorInvalidResourceHandle"}, | |
32 {cudaErrorInsufficientDriver, "cudaErrorInsufficientDriver"}, | |
33 {cudaErrorSetOnActiveProcess, "cudaErrorSetOnActiveProcess"}, | |
34 {cudaErrorStartupFailure, "cudaErrorStartupFailure"}, | |
35 {0, NULL} | |
36 }; | |
37 const char* message; | |
38 | |
39 for(int i=0; Error_Status[i].status_string != NULL; i++) { | |
1925
cd5bbd8ec5d6
fix CudaScheduler
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1908
diff
changeset
|
40 if (Error_Status[i].status == status) { |
1908 | 41 message = Error_Status[i].status_string; |
42 } | |
43 } | |
44 return message; | |
45 } |