… | |
… | |
105 | for my $platform (OpenCL::platforms) { |
105 | for my $platform (OpenCL::platforms) { |
106 | printf "platform: %s\n", $platform->name; |
106 | printf "platform: %s\n", $platform->name; |
107 | printf "extensions: %s\n", $platform->extensions; |
107 | printf "extensions: %s\n", $platform->extensions; |
108 | for my $device ($platform->devices) { |
108 | for my $device ($platform->devices) { |
109 | printf "+ device: %s\n", $device->name; |
109 | printf "+ device: %s\n", $device->name; |
110 | my $ctx = $device->context; |
110 | my $ctx = $platform->context (undef, [$device]); |
111 | # do stuff |
111 | # do stuff |
112 | } |
112 | } |
113 | } |
113 | } |
114 | |
114 | |
115 | =head2 Get a useful context and a command queue. |
115 | =head2 Get a useful context and a command queue. |
… | |
… | |
286 | |
286 | |
287 | Comverts an error value into a human readable string. |
287 | Comverts an error value into a human readable string. |
288 | |
288 | |
289 | =item $str = OpenCL::enum2str $enum |
289 | =item $str = OpenCL::enum2str $enum |
290 | |
290 | |
291 | Converts most enum values (inof parameter names, image format constants, |
291 | Converts most enum values (of parameter names, image format constants, |
292 | object types, addressing and filter modes, command types etc.) into a |
292 | object types, addressing and filter modes, command types etc.) into a |
293 | human readbale string. When confronted with some random integer it can be |
293 | human readable string. When confronted with some random integer it can be |
294 | very helpful to pass it through this function to maybe get some readable |
294 | very helpful to pass it through this function to maybe get some readable |
295 | string out of it. |
295 | string out of it. |
296 | |
296 | |
297 | =item @platforms = OpenCL::platforms |
297 | =item @platforms = OpenCL::platforms |
298 | |
298 | |
… | |
… | |
326 | |
326 | |
327 | Tries to create a context. Never worked for me, and you need devices explicitly anyway. |
327 | Tries to create a context. Never worked for me, and you need devices explicitly anyway. |
328 | |
328 | |
329 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
329 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContextFromType.html> |
330 | |
330 | |
331 | =item $ctx = $device->context ($properties = undef, @$devices, $notify = undef) |
331 | =item $ctx = $platform->context ($properties = undef, @$devices, $notify = undef) |
332 | |
332 | |
333 | Create a new OpenCL::Context object using the given device object(s)- a |
333 | Create a new OpenCL::Context object using the given device object(s)- a |
334 | CL_CONTEXT_PLATFORM property is supplied automatically. |
334 | CL_CONTEXT_PLATFORM property is supplied automatically. |
335 | |
335 | |
336 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |
336 | L<http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateContext.html> |