… | |
… | |
23 | kernel_arg_info Kernel |
23 | kernel_arg_info Kernel |
24 | command_queue Queue |
24 | command_queue Queue |
25 | ); |
25 | ); |
26 | |
26 | |
27 | my %typemap = ( |
27 | my %typemap = ( |
|
|
28 | # getinfo.txt c type, constructor, pod |
28 | cl_bool => ['cl_bool', 'value [i] ? &PL_sv_yes : &PL_sv_no', 'boolean'], |
29 | cl_bool => ['cl_bool', 'value [i] ? &PL_sv_yes : &PL_sv_no', 'boolean'], |
29 | #char => ['char', 'newSVpvn (value, size)', 'string'], |
30 | #char => ['char', 'newSVpvn (value, size)', 'string'], |
30 | char => ['char', 'newSVpv (value, 0)', 'string'], # all these are 0-terminated strings, and the driver often appends a \0 |
31 | char => ['char', 'newSVpv (value, 0)', 'string'], # all these are 0-terminated strings, and the driver often appends a \0 |
31 | size_t => ['size_t', 'newSVuv (value [i])', 'int'], |
32 | size_t => ['size_t', 'newSVuv (value [i])', 'int'], |
32 | "void*" => ['void *', 'newSVuv ((IV)(intptr_t)value [i])', 'ptr_value'], |
33 | "void*" => ['void *', 'newSVuv ((IV)(intptr_t)value [i])', 'ptr_value'], |
… | |
… | |
36 | cl_device_id => ['cl_device_id', 'OpenCL::Device', 'device'], |
37 | cl_device_id => ['cl_device_id', 'OpenCL::Device', 'device'], |
37 | Memory => ['cl_mem', 'OpenCL::Memory', 'mem'], |
38 | Memory => ['cl_mem', 'OpenCL::Memory', 'mem'], |
38 | Program => ['cl_program', 'OpenCL::Program', 'program'], |
39 | Program => ['cl_program', 'OpenCL::Program', 'program'], |
39 | CommandQueue => ['cl_command_queue', 'OpenCL::Queue', 'queue'], |
40 | CommandQueue => ['cl_command_queue', 'OpenCL::Queue', 'queue'], |
40 | cl_context_properties => ['cl_context_properties', 'newSVuv ((UV)value [i])', 'property_int'], |
41 | cl_context_properties => ['cl_context_properties', 'newSVuv ((UV)value [i])', 'property_int'], |
|
|
42 | cl_program_binary_type => ['cl_program_binary_type', 'newSVuv ((UV)value [i])', 'binary_type'], |
41 | ); |
43 | ); |
42 | |
44 | |
43 | { |
45 | { |
44 | my %tmap = ( |
46 | my %tmap = ( |
45 | T_IV => "newSViv (value [i])", |
47 | T_IV => "newSViv (value [i])", |
… | |
… | |
78 | } |
80 | } |
79 | |
81 | |
80 | rename "$file~", $file; |
82 | rename "$file~", $file; |
81 | } |
83 | } |
82 | |
84 | |
83 | for my $CLASS (qw(platform device context command_queue mem image sampler program program_build kernel kernel_work_group event profiling gl_texture)) { |
85 | for my $CLASS (qw(platform device context command_queue mem image sampler program program_build kernel kernel_work_group kernel_arg event profiling gl_texture)) { |
84 | open my $fh, "<getinfo.txt" |
86 | open my $fh, "<getinfo.txt" |
85 | or die "getinfo.txt: $!"; |
87 | or die "getinfo.txt: $!"; |
86 | |
88 | |
87 | my $POD; |
89 | my $POD; |
88 | my @funcs; |
90 | my @funcs; |
… | |
… | |
107 | $cbase = "EventProfiling" if $cbase eq "Profiling"; |
109 | $cbase = "EventProfiling" if $cbase eq "Profiling"; |
108 | |
110 | |
109 | my $real_class = $CLASS; |
111 | my $real_class = $CLASS; |
110 | $real_class = "program" if $real_class eq "program_build"; |
112 | $real_class = "program" if $real_class eq "program_build"; |
111 | $real_class = "kernel" if $real_class eq "kernel_work_group"; |
113 | $real_class = "kernel" if $real_class eq "kernel_work_group"; |
|
|
114 | $real_class = "kernel" if $real_class eq "kernel_arg"; |
112 | $real_class = "event" if $real_class eq "profiling"; |
115 | $real_class = "event" if $real_class eq "profiling"; |
113 | |
116 | |
114 | my $perl_name = lc $name; |
117 | my $perl_name = lc $name; |
115 | $perl_name =~ s/^cl_//; |
118 | $perl_name =~ s/^cl_//; |
116 | $perl_name =~ s/^$real_class\_//; |
119 | $perl_name =~ s/^$real_class\_//; |