ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/OpenCL.pm
Revision: 1.2
Committed: Tue Nov 15 09:24:40 2011 UTC (12 years, 6 months ago) by root
Branch: MAIN
Changes since 1.1: +3 -1 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 =head1 NAME
2
3 OpenCL - bindings to, well, OpenCL
4
5 =head1 SYNOPSIS
6
7 use OpenCL;
8
9 =head1 DESCRIPTION
10
11 This is an early release which is not useful yet.
12
13 Enumerate all devices and get contexts for them;
14
15 for my $platform (OpenCL::platforms) {
16 warn $platform->info (OpenCL::PLATFORM_NAME);
17 warn $platform->info (OpenCL::PLATFORM_EXTENSIONS);
18 for my $device ($platform->devices) {
19 warn $device->info (OpenCL::DEVICE_NAME);
20 my $ctx = $device->context_simple;
21 # do stuff
22 }
23 }
24
25 Get a useful context and a command queue:
26
27 my $dev = ((OpenCL::platforms)[0]->devices)[0];
28 my $ctx = $dev->context_simple;
29 my $queue = $ctx->command_queue_simple ($dev);
30
31 =over 4
32
33 =cut
34
35 package OpenCL;
36
37 use common::sense;
38
39 BEGIN {
40 our $VERSION = '0.01';
41
42 require XSLoader;
43 XSLoader::load (__PACKAGE__, $VERSION);
44 }
45
46 1;
47
48 =back
49
50 =head1 AUTHOR
51
52 Marc Lehmann <schmorp@schmorp.de>
53 http://home.schmorp.de/
54
55 =cut
56