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