… | |
… | |
149 | |
149 | |
150 | =head2 Create and build a program, then create a kernel out of one of its |
150 | =head2 Create and build a program, then create a kernel out of one of its |
151 | functions. |
151 | functions. |
152 | |
152 | |
153 | my $src = ' |
153 | my $src = ' |
154 | __kernel void |
154 | kernel void |
155 | squareit (__global float *input, __global float *output) |
155 | squareit (global float *input, global float *output) |
156 | { |
156 | { |
157 | $id = get_global_id (0); |
157 | $id = get_global_id (0); |
158 | output [id] = input [id] * input [id]; |
158 | output [id] = input [id] * input [id]; |
159 | } |
159 | } |
160 | '; |
160 | '; |
… | |
… | |
1302 | package OpenCL; |
1302 | package OpenCL; |
1303 | |
1303 | |
1304 | use common::sense; |
1304 | use common::sense; |
1305 | |
1305 | |
1306 | BEGIN { |
1306 | BEGIN { |
1307 | our $VERSION = '0.91'; |
1307 | our $VERSION = '0.92'; |
1308 | |
1308 | |
1309 | require XSLoader; |
1309 | require XSLoader; |
1310 | XSLoader::load (__PACKAGE__, $VERSION); |
1310 | XSLoader::load (__PACKAGE__, $VERSION); |
1311 | |
1311 | |
1312 | @OpenCL::Buffer::ISA = |
1312 | @OpenCL::Buffer::ISA = |