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

Comparing OpenCL/OpenCL.xs (file contents):
Revision 1.16 by root, Tue Nov 22 10:29:18 2011 UTC vs.
Revision 1.17 by root, Tue Nov 22 10:39:47 2011 UTC

720 720
721 if (ev) 721 if (ev)
722 XPUSH_NEW_OBJ ("OpenCL::Event", ev); 722 XPUSH_NEW_OBJ ("OpenCL::Event", ev);
723 723
724void 724void
725enqueue_read_buffer_rect (OpenCL::Queue this, OpenCL::Memory buf, cl_bool blocking, size_t buf_x, size_t buf_y, size_t buf_z, size_t host_x, size_t host_y, size_t host_z, size_t width, size_t height, size_t depth, size_t buf_row_pitch, size_t buf_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, SV *data, ...)
726 PPCODE:
727 cl_event ev = 0;
728 const size_t buf_origin [3] = { buf_x , buf_y , buf_z };
729 const size_t host_origin[3] = { host_x, host_y, host_z };
730 const size_t region[3] = { width, height, depth };
731 EVENT_LIST (17, items - 17);
732
733 if (!buf_row_pitch)
734 buf_row_pitch = region [0];
735
736 if (!buf_slice_pitch)
737 buf_slice_pitch = region [1] * buf_row_pitch;
738
739 if (!host_row_pitch)
740 host_row_pitch = region [0];
741
742 if (!host_slice_pitch)
743 host_slice_pitch = region [1] * host_row_pitch;
744
745 size_t len = host_row_pitch * host_slice_pitch * region [2];
746
747 SvUPGRADE (data, SVt_PV);
748 SvGROW (data, len);
749 SvPOK_only (data);
750 SvCUR_set (data, len);
751 NEED_SUCCESS (EnqueueReadBufferRect, (this, buf, blocking, buf_origin, host_origin, region, buf_row_pitch, buf_slice_pitch, host_row_pitch, host_slice_pitch, SvPVX (data), event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0));
752
753 if (ev)
754 XPUSH_NEW_OBJ ("OpenCL::Event", ev);
755
756void
757enqueue_write_buffer_rect (OpenCL::Queue this, OpenCL::Memory buf, cl_bool blocking, size_t buf_x, size_t buf_y, size_t buf_z, size_t host_x, size_t host_y, size_t host_z, size_t width, size_t height, size_t depth, size_t buf_row_pitch, size_t buf_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, SV *data, ...)
758 PPCODE:
759 cl_event ev = 0;
760 const size_t buf_origin [3] = { buf_x , buf_y , buf_z };
761 const size_t host_origin[3] = { host_x, host_y, host_z };
762 const size_t region[3] = { width, height, depth };
763 STRLEN len;
764 char *ptr = SvPVbyte (data, len);
765 EVENT_LIST (17, items - 17);
766
767 if (!buf_row_pitch)
768 buf_row_pitch = region [0];
769
770 if (!buf_slice_pitch)
771 buf_slice_pitch = region [1] * buf_row_pitch;
772
773 if (!host_row_pitch)
774 host_row_pitch = region [0];
775
776 if (!host_slice_pitch)
777 host_slice_pitch = region [1] * host_row_pitch;
778
779 size_t min_len = host_row_pitch * host_slice_pitch * region [2];
780
781 if (len < min_len)
782 croak ("clEnqueueWriteImage: data string is shorter than what would be transferred");
783
784 NEED_SUCCESS (EnqueueWriteBufferRect, (this, buf, blocking, buf_origin, host_origin, region, buf_row_pitch, buf_slice_pitch, host_row_pitch, host_slice_pitch, SvPVX (data), event_list_count, event_list_ptr, GIMME_V != G_VOID ? &ev : 0));
785
786 if (ev)
787 XPUSH_NEW_OBJ ("OpenCL::Event", ev);
788
789void
725enqueue_read_image (OpenCL::Queue this, OpenCL::Image src, cl_bool blocking, size_t src_x, size_t src_y, size_t src_z, size_t width, size_t height, size_t depth, size_t row_pitch, size_t slice_pitch, SV *data, ...) 790enqueue_read_image (OpenCL::Queue this, OpenCL::Image src, cl_bool blocking, size_t src_x, size_t src_y, size_t src_z, size_t width, size_t height, size_t depth, size_t row_pitch, size_t slice_pitch, SV *data, ...)
726 PPCODE: 791 PPCODE:
727 cl_event ev = 0; 792 cl_event ev = 0;
728 const size_t src_origin[3] = { src_x, src_y, src_z }; 793 const size_t src_origin[3] = { src_x, src_y, src_z };
729 const size_t region[3] = { width, height, depth }; 794 const size_t region[3] = { width, height, depth };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines