ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/OpenCL/OpenCL.pm
(Generate patch)

Comparing OpenCL/OpenCL.pm (file contents):
Revision 1.67 by root, Tue May 1 22:04:56 2012 UTC vs.
Revision 1.68 by root, Tue May 1 22:25:13 2012 UTC

2020 2020
2021Returns the size of the mapped area, in bytes. Same as C<length $$mapped>. 2021Returns the size of the mapped area, in bytes. Same as C<length $$mapped>.
2022 2022
2023=item $ptr = $mapped->ptr 2023=item $ptr = $mapped->ptr
2024 2024
2025Returns the raw memory address of the mapped area - same as C<$mapped+0>. 2025Returns the raw memory address of the mapped area.
2026 2026
2027=item $mapped->set ($offset, $data) 2027=item $mapped->set ($offset, $data)
2028 2028
2029Replaces the data at the given C<$offset> in the memory area by the new 2029Replaces the data at the given C<$offset> in the memory area by the new
2030C<$data>. This method is safer but slower than direct manipulation of 2030C<$data>. This method is safer than direct manipulation of C<$mapped>
2031C<$$mapped> with substr. 2031because it does bounds-checking, but also slower.
2032 2032
2033=item $data = $mapped->get ($offset, $length) 2033=item $data = $mapped->get ($offset, $length)
2034 2034
2035Returns (without copying) a scalar representing the data at the given 2035Returns (without copying) a scalar representing the data at the given
2036C<$offset> and C<$length> in the mapped memory area. This is the same as 2036C<$offset> and C<$length> in the mapped memory area. This is the same as
2037the following substr, except much slower: 2037the following substr, except much slower;
2038 2038
2039 $data = substr $$mapped, $offset, $length 2039 $data = substr $$mapped, $offset, $length
2040 2040
2041#TODO: really?
2042
2043=cut 2041=cut
2044 2042
2045sub get { 2043sub OpenCL::Mapped::get {
2046 substr ${$_[0]}, $_[1], $_[2] 2044 substr ${$_[0]}, $_[1], $_[2]
2047} 2045}
2048 2046
2049=back 2047=back
2050 2048

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines