ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/h_extract
Revision: 1.7
Committed: Sat May 5 14:04:25 2012 UTC (12 years ago) by root
Branch: MAIN
Changes since 1.6: +10 -8 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/bin/sh
2    
3     # extracts various bits of data form OpenCL heder files, which are expected to
4     # be in CL/
5    
6 root 1.7 ALL_H="CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL11/cl_d3d9.h CL/cl_d3d10.h CL12/cl_d3d11.h CL/cl_dx9_media_sharing.h"
7    
8 root 1.1 # constants
9 root 1.6 (
10     echo '// autogenerated by h_extract'
11 root 1.7 cat $ALL_H |
12 root 1.6 perl -ne 'print "const_iv($1)\n" if /^#define CL_(\S+)/'
13 root 1.7 ) | sort >constiv.h
14 root 1.1
15     # constants that look like enum values
16 root 1.6 (
17     echo '// autogenerated by h_extract'
18 root 1.7 cat $ALL_H |
19 root 1.6 perl -ne 'print "const_iv($1)\n" if /^#define CL_(\S+)\s+0x[0-9a-fA-F]{4}/'
20 root 1.7 ) | sort >enumstr.h
21 root 1.6
22     # error codes
23     (
24     echo '// autogenerated by h_extract'
25     echo "const_iv(SUCCESS)"
26 root 1.7 cat $ALL_H |
27 root 1.6 perl -ne 'print "const_iv($1)\n" if !/#define CL_BUILD_(?:NONE|ERROR|IN_PROGRESS)/ && /^#define CL_(\S+)\s+-\d+\s*$/'
28 root 1.7 ) | sort >errstr.h
29 root 1.6
30     # default constant values to -1
31     (
32     echo '// autogenerated by h_extract'
33     cat constiv.h enumstr.h errstr.h |
34     perl -ne '/const_iv\((.*)\)/ or next; print "#ifndef CL_$1\n#define CL_$1 -1\n#endif\n"'
35 root 1.7 ) | sort >default.h
36 root 1.1
37     # *glGet*Info
38 root 1.3 (
39     <CL/cl.hpp perl -ne 'print "$1\n" if /^\s*F\((.*)\)\s*\\?\s*$/'
40     # DEVICE_DOUBLE_FP_CONFIG
41     # DEVICE_HALF_FP_CONFIG
42     # PLATFORM_ICD_SUFFIX_KHR
43     # PLATFORM_NOT_FOUND_KHR
44     # DEVICE_COMPUTE_CAPABILITY_MAJOR_NV
45     # DEVICE_COMPUTE_CAPABILITY_MINOR_NV
46     # DEVICE_REGISTERS_PER_BLOCK_NV
47     # DEVICE_WARP_SIZE_NV
48     # DEVICE_GPU_OVERLAP_NV
49     # DEVICE_KERNEL_EXEC_TIMEOUT_NV
50     # DEVICE_INTEGRATED_MEMORY_NV
51     # DEVICE_PROFILING_TIMER_OFFSET_AMD
52    
53     cat <<EOF
54 root 1.5 cl_program_build_info, CL_PROGRAM_BINARY_TYPE, cl_program_binary_type
55 root 1.3 cl_gl_texture_info, CL_GL_TEXTURE_TARGET, cl_GLenum
56     cl_gl_texture_info, CL_GL_MIPMAP_LEVEL, cl_GLint
57 root 1.4 cl_kernel_arg_info, CL_KERNEL_ARG_ADDRESS_QUALIFIER, cl_kernel_arg_address_qualifier
58     cl_kernel_arg_info, CL_KERNEL_ARG_ACCESS_QUALIFIER, cl_kernel_arg_access_qualifier
59     cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_NAME, STRING_CLASS
60     cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier
61     cl_kernel_arg_info, CL_KERNEL_ARG_NAME, STRING_CLASS
62 root 1.3 EOF
63 root 1.7 ) | sort >getinfo.txt
64 root 1.1