--- OpenCL/gengetinfo 2012/04/24 22:45:38 1.11 +++ OpenCL/gengetinfo 2012/05/05 13:30:07 1.17 @@ -20,10 +20,12 @@ program_build Program kernel Kernel kernel_work_group Kernel + kernel_arg_info Kernel command_queue Queue ); my %typemap = ( + # getinfo.txt c type, constructor, pod cl_bool => ['cl_bool', 'value [i] ? &PL_sv_yes : &PL_sv_no', 'boolean'], #char => ['char', 'newSVpvn (value, size)', 'string'], char => ['char', 'newSVpv (value, 0)', 'string'], # all these are 0-terminated strings, and the driver often appends a \0 @@ -37,6 +39,7 @@ Program => ['cl_program', 'OpenCL::Program', 'program'], CommandQueue => ['cl_command_queue', 'OpenCL::Queue', 'queue'], cl_context_properties => ['cl_context_properties', 'newSVuv ((UV)value [i])', 'property_int'], + cl_program_binary_type => ['cl_program_binary_type', 'newSVuv (UV)value [i])', 'binary_type'], ); { @@ -79,7 +82,7 @@ rename "$file~", $file; } -for my $CLASS (qw(platform device context command_queue mem image sampler program program_build kernel kernel_work_group event profiling gl_texture)) { +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)) { open my $fh, "[1]; + $stash =~ s/opencl:://; + $stash =~ s/::/_/g; + $XS2 .= " {\n"; - $XS2 .= " NEED_SUCCESS (Retain$oclass, (value [i]));\n" unless $1 eq "Platform" || $1 eq "Device"; - $XS2 .= " PUSH_CLOBJ (\"$type->[1]\", value [i]);\n"; + $XS2 .= " NEED_SUCCESS (Retain$oclass, (value [i]));\n" unless $oclass eq "Platform" || $oclass eq "Device"; + $XS2 .= " PUSH_CLOBJ (stash_$stash, value [i]);\n"; $XS2 .= " }\n"; } else { $XS2 .= " PUSHs (sv_2mortal ($type->[1]));\n";