ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/h_extract
Revision: 1.6
Committed: Sat May 5 13:30:07 2012 UTC (12 years ago) by root
Branch: MAIN
Changes since 1.5: +25 -11 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     # constants
7 root 1.6 (
8     echo '// autogenerated by h_extract'
9     cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h |
10     perl -ne 'print "const_iv($1)\n" if /^#define CL_(\S+)/'
11     ) >constiv.h
12 root 1.1
13     # constants that look like enum values
14 root 1.6 (
15     echo '// autogenerated by h_extract'
16     cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h |
17     perl -ne 'print "const_iv($1)\n" if /^#define CL_(\S+)\s+0x[0-9a-fA-F]{4}/'
18     ) >enumstr.h
19    
20     # error codes
21     (
22     echo '// autogenerated by h_extract'
23     echo "const_iv(SUCCESS)"
24     cat CL/cl.h CL/cl_ext.h CL/cl_gl.h CL/cl_gl_ext.h CL/cl_d3d10.h |
25     perl -ne 'print "const_iv($1)\n" if !/#define CL_BUILD_(?:NONE|ERROR|IN_PROGRESS)/ && /^#define CL_(\S+)\s+-\d+\s*$/'
26     ) >errstr.h
27    
28     # default constant values to -1
29     (
30     echo '// autogenerated by h_extract'
31     cat constiv.h enumstr.h errstr.h |
32     perl -ne '/const_iv\((.*)\)/ or next; print "#ifndef CL_$1\n#define CL_$1 -1\n#endif\n"'
33     ) >default.h
34 root 1.1
35     # *glGet*Info
36 root 1.3 (
37     <CL/cl.hpp perl -ne 'print "$1\n" if /^\s*F\((.*)\)\s*\\?\s*$/'
38     # DEVICE_DOUBLE_FP_CONFIG
39     # DEVICE_HALF_FP_CONFIG
40     # PLATFORM_ICD_SUFFIX_KHR
41     # PLATFORM_NOT_FOUND_KHR
42     # DEVICE_COMPUTE_CAPABILITY_MAJOR_NV
43     # DEVICE_COMPUTE_CAPABILITY_MINOR_NV
44     # DEVICE_REGISTERS_PER_BLOCK_NV
45     # DEVICE_WARP_SIZE_NV
46     # DEVICE_GPU_OVERLAP_NV
47     # DEVICE_KERNEL_EXEC_TIMEOUT_NV
48     # DEVICE_INTEGRATED_MEMORY_NV
49     # DEVICE_PROFILING_TIMER_OFFSET_AMD
50    
51     cat <<EOF
52 root 1.5 cl_program_build_info, CL_PROGRAM_BINARY_TYPE, cl_program_binary_type
53 root 1.3 cl_gl_texture_info, CL_GL_TEXTURE_TARGET, cl_GLenum
54     cl_gl_texture_info, CL_GL_MIPMAP_LEVEL, cl_GLint
55 root 1.4 cl_kernel_arg_info, CL_KERNEL_ARG_ADDRESS_QUALIFIER, cl_kernel_arg_address_qualifier
56     cl_kernel_arg_info, CL_KERNEL_ARG_ACCESS_QUALIFIER, cl_kernel_arg_access_qualifier
57     cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_NAME, STRING_CLASS
58     cl_kernel_arg_info, CL_KERNEL_ARG_TYPE_QUALIFIER, cl_kernel_arg_type_qualifier
59     cl_kernel_arg_info, CL_KERNEL_ARG_NAME, STRING_CLASS
60 root 1.3 EOF
61     ) >getinfo.txt
62 root 1.1