annotate TaskManager/Gpu/GpuError.h @ 1553:21ddbc06dcde draft

fix GpuScheduler
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Sun, 17 Feb 2013 19:42:36 +0900
parents 890cb39418ca
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1543
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 const char* convert_error_status(cl_uint status){
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 static const struct {
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 const cl_uint status;
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 const char *status_string;
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 } Error_Status[] = {
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 {CL_SUCCESS, "CL_SUCCESS"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ,{CL_DEVICE_NOT_FOUND, "CL_DEVICE_NOT_FOUND"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ,{CL_DEVICE_NOT_AVAILABLE, "CL_DEVICE_NOT_AVAILABLE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ,{CL_COMPILER_NOT_AVAILABLE, "CL_COMPILER_NOT_AVAILABLE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ,{CL_MEM_OBJECT_ALLOCATION_FAILURE, "CL_MEM_OBJECT_ALLOCATION_FAILURE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ,{CL_OUT_OF_RESOURCES, "CL_OUT_OF_RESOURCES"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ,{CL_OUT_OF_HOST_MEMORY, "CL_OUT_OF_HOST_MEMORY"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ,{CL_PROFILING_INFO_NOT_AVAILABLE, "CL_PROFILING_INFO_NOT_AVAILABLE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ,{CL_MEM_COPY_OVERLAP, "CL_MEM_COPY_OVERLAP"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ,{CL_IMAGE_FORMAT_MISMATCH, "CL_IMAGE_FORMAT_MISMATCH"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 ,{CL_IMAGE_FORMAT_NOT_SUPPORTED, "CL_IMAGE_FORMAT_NOT_SUPPORTED"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ,{CL_BUILD_PROGRAM_FAILURE, "CL_BUILD_PROGRAM_FAILURE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ,{CL_MAP_FAILURE, "CL_MAP_FAILURE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 ,{CL_INVALID_VALUE, "CL_INVALID_VALUE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 ,{CL_INVALID_DEVICE_TYPE, "CL_INVALID_DEVICE_TYPE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 ,{CL_INVALID_PLATFORM, "CL_INVALID_PLATFORM"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 ,{CL_INVALID_DEVICE, "CL_INVALID_DEVICE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 ,{CL_INVALID_CONTEXT, "CL_INVALID_CONTEXT"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 ,{CL_INVALID_QUEUE_PROPERTIES, "CL_INVALID_QUEUE_PROPERTIES"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 ,{CL_INVALID_COMMAND_QUEUE, "CL_INVALID_COMMAND_QUEUE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 ,{CL_INVALID_HOST_PTR, "CL_INVALID_HOST_PTR"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 ,{CL_INVALID_MEM_OBJECT, "CL_INVALID_MEM_OBJECT"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 ,{CL_INVALID_IMAGE_FORMAT_DESCRIPTOR, "CL_INVALID_IMAGE_FORMAT_DESCRIPTOR"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 ,{CL_INVALID_IMAGE_SIZE, "CL_INVALID_IMAGE_SIZE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 ,{CL_INVALID_SAMPLER, "CL_INVALID_SAMPLER"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 ,{CL_INVALID_BINARY, "CL_INVALID_BINARY"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 ,{CL_INVALID_BUILD_OPTIONS, "CL_INVALID_BUILD_OPTIONS"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 ,{CL_INVALID_PROGRAM, "CL_INVALID_PROGRAM"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 ,{CL_INVALID_PROGRAM_EXECUTABLE, "CL_INVALID_PROGRAM_EXECUTABLE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 ,{CL_INVALID_KERNEL_NAME, "CL_INVALID_KERNEL_NAME"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 ,{CL_INVALID_KERNEL_DEFINITION, "CL_INVALID_KERNEL_DEFINITION"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 ,{CL_INVALID_KERNEL, "CL_INVALID_KERNEL"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 ,{CL_INVALID_ARG_INDEX, "CL_INVALID_ARG_INDEX"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 ,{CL_INVALID_ARG_VALUE, "CL_INVALID_ARG_VALUE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 ,{CL_INVALID_ARG_SIZE, "CL_INVALID_ARG_SIZE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 ,{CL_INVALID_KERNEL_ARGS, "CL_INVALID_KERNEL_ARGS"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 ,{CL_INVALID_WORK_DIMENSION, "CL_INVALID_WORK_DIMENSION"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 ,{CL_INVALID_WORK_GROUP_SIZE, "CL_INVALID_WORK_GROUP_SIZE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 ,{CL_INVALID_WORK_ITEM_SIZE, "CL_INVALID_WORK_ITEM_SIZE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 ,{CL_INVALID_GLOBAL_OFFSET, "CL_INVALID_GLOBAL_OFFSET"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 ,{CL_INVALID_EVENT_WAIT_LIST, "CL_INVALID_EVENT_WAIT_LIST"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 ,{CL_INVALID_EVENT, "CL_INVALID_EVENT"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 ,{CL_INVALID_OPERATION, "CL_INVALID_OPERATION"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 ,{CL_INVALID_GL_OBJECT, "CL_INVALID_GL_OBJECT"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 ,{CL_INVALID_BUFFER_SIZE, "CL_INVALID_BUFFER_SIZE"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 ,{CL_INVALID_MIP_LEVEL, "CL_INVALID_MIP_LEVEL"}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 ,{0, NULL}
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 };
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 const char* message;
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 for(int i=0; Error_Status[i].status_string !=NULL; i++){
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 if (Error_Status[i].status == status) {
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 message = Error_Status[i].status_string;
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 }
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 }
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 return message;
890cb39418ca add error routine
Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 }