Upload
npinto
View
1.125
Download
1
Embed Size (px)
DESCRIPTION
http://cs264.org http://goo.gl/068h1
Citation preview
� �
������������������ �
����������� �����������
�����������
� �
�����������
� ���������������������
� ��������������������������������� �����
� ���� ��!�"�#�$%����!
� ���& #'(�
� ���) ����*������������������������
� ��+� �����,�����������*����������
� ��++ �����������������-���
� �
�������������
� .����������
� /��������������������
� (��������������
� (���������
� �
������*����!�"
� (���0���������������������������
� ��!�"�0���� ���������������������
�1"2#3
� ������ ���������
����� ������ �������� ��� ����������������� ������������
���� ��� ���� ���� � ���� ���������������������������������������������������������������������������� ���������!�!���
����� �������� ����������" #$���%���� �����!���"��!�&����'���" #$���%���� ����'�!���"�'�!�&��������" #$���%���� ������!���"���!�&���(��� )�����*'�+��'�*'�+����*'���
���� � ������� �� !������� "��#��,����-���$������.���
44
$��%�� ��������
&�' ��(������ �' ��(������
"����� ) '��* +,��� -����* �����
��. ) '��. �/�* ���* ��.0
-��1 ) '-��1* '1���1�
�/�* ���* �.��1
����/ ) '��* ��&�� �/�* ���
���#������ ) .��#�� ���* -����* �����
�����#����� ) !�� ���* ���������* +,��"
1������ ) !�� ���* ���������
������ ) !�� ���* ���������* +,��"
1��������� ) 2 ��1�* ���
+,����3����� ) 2 ��1�* ���4
�������� ���,�
) 2 +,����
"��#���3����� ) +,��&� +,��&�
1#(����,���� ) 2 2
1������ ) .��#�� �����������
� �
564
Neuro-imagingGeorgia Tech
74
Video ProcessingGoogle
5 4
Medical DevicesSpencer
Tech
84
Weather ModelingNCAR
984
Power EngineeringIIT India
564
Track Bad GuysBAE
Systems
674
Drug DeliveryGeorgia Tech
984
BioinformaticsLeibniz
Research
74
Bio-ResearchCDC
:84
Radar ImagingSystem
Planning
$��%�� ��� ;<<
5 << ������ ��(����
����� �(=����> �9 * �?:* �9 * �?:* (@* �9 * AA
���,#�� ,���������> �#�* ���* ���* ���* ���* ������* AA
f32 A = f32::rand(n,n); f32 B = sin(A) + 0.3; f32 b = B(span, 4); // specific column
5 �#������ ��(����
��� ,�������
float jkt_sum(int n, float *device_src)
����,��> �������� ,�
// random (x,y) samples
f32 x = f32::rand(n_total,1);
f32 y = f32::rand(n_total,1);
// how many inside unit circle?
f32 dist = sqrt(x*x + y*y);
b8 is_inside = (dist < 1);
// estimate pi
float pi = 4 * sum_vector(is_inside) / n_total;
44
���� ���������� �����
1����
�#(�����
-�� ������
���
�����#� �����#� �����B���,�����C
�(�
����,��> 1�����
-�� ������
�(�
1����
�#(�����
-�� ������
�(�
1����
�#(�����
����,��> 1�����
���������������� �����������
������� ������������� ������� ��������
������������������������� ������
����������������������������������������
������������!���"����������
����> ����#�� ���,� �� ,�������
// multiple FFTs at various powers
gfor (i = 0; i < nfft; ++i)
B(span,i) = fft(pow(A(span,i), i));
5 ���� ��������� �� �� ����,������ D����E
� �A� �� ���� ��,���������
5 �#� ���� ��� ����� �� ,�������
5 !���> ����� �,���� ���� �#���,�� &�'�
����,��> 1����� < ����
����������������� �����������
������� ������������� ������� ��������
������������������������� ������
����������������������������������������
������������!���"����������
,��������
5 �#�� ��#� ���� �� (��� �' ��� &�'
5 0���F� (����� �� ���� ,���� �� ��#� ����
&��,���� < ��,#��
����������������#�������
������������"�$��%��"�� �����
�����$"�����&&�������
5 +,��&� G �����* !"����* ���* �����������* AA
��������� ���� ���,#��
��� ����� ������ ���� ���� �� �� &�' ,������
5 ������ �������� ���� ���� G �� ��������
*���
��(������ ����#��� (�������
5 �#� B���,����C
5 ������
5 �������* $���*H
"��������������
� �
/����������
� 6��������*�����#'(��������
� !�7�����8��*�������������
� %����*��9�/�:�����������8�������0;��������������������� �����������������
� �������������������������������<������
� ���������������8���-��������������;������0�������������
� =������������ ��
� �
#'(��������
� >���������
� �����������������9����:
� #�� �������
� ?��������
� �����������������
� !���������-��
� /�����������������������
� �
� �
!�7�����
� >������������,����� �������������������
� �����������8@��0A��������
� ����������8A0��������
� (�����������������-����-�����������������-��
� ��������������*����������
� #��-���������������9��������������:
� 6����������������������**������
� �������������������
� ���������������
� ?�,�8���������������������-������*���-���
44
� �
�/�
� ��!�"���������
� ��������7�����;����,�������
� ����*����������������
� ������� �������
� �������0;�������������
� ��� ����������� �����
� ?�,�8������*���������������
� �
�0����9�:
5 0��� ���� ��/��������� ��
� �����> ����������� �� ��/� �����01
2
�
�
��� 1
0
!+�@8
� �B�@�B�+C�+�C�D������B�3
� �B�@�B�+C�+���D�����B,3
���B��B�@��+�E��+�C��+��3
� �B�@�B�+C�+�&�D�����B�3
���B�@��+�A��+�E��+�&3
� �B�@�B�+C�+�)�D����B,3
���B��B�@��+�@��+�A��+�)3
� �B�@�B�+C�++��D���B,3
���B�@��+����+�@��++�3
��B�����B�@��+++�
FGGH�>?�!I�>�2�J3
����B��B�@��++���+����+++3
K�++�-��!+�+3
!+��8
��B�����B�@��++@�FGG"'..�>G�2�J3
���B��B�@��++A��+���A'3
���B�@��+����++@��++A3
�� B*@��++C��*@*&�����3
��B�����B-@��++��FGG#%?��G�2�J3
��-B*@��++E��++C��++�3
�� B*@��+�+��++E3
��B���-��B*@�F�+��2�J��+�+3
� #������8� 0���������������� 0L�������� 0L����������������� ���������������� ���� �������������������� ������ � ������������� ��� �
������;���� ���� �,����3���������� ����#� ,�������
�345�
� �
������������
� #�����������,����� �
� �� ������0����� �������
� ���������������������������,�
� ������*��������������������������������
� 6���������8�������������������������������
� '��������8�� ��������
� �� �$����*�������
� ?�,�8*���������
������ ��������> I���� ��A �����
6��7�8������$�����9� ���� ������ ��J#��������
5 .����� ��#��� ,�������
5 ������ ������ ,�������
5 ����2�������
:����8������$�����9� ���� ��� ������������
5 �������2���� ����������
5 ������;�� ������ ������
5 +�2���2��� ���� ����������
5 !���> �#�� ���� �����<�����
�A�A ������#����* �#�#������ �#�* ���#������
�A�A <* 2* ;* K* ����� �����������* �(�* ���
� �
��������������
f32 A(cpu_ptr, n); // push host array to device c64::rand(n); // generate on device
� '���0���������
� >�������� ������������
� ������$*���
� M���������8���� �$��*�������
� ���-�������������
� /����������8������� �
� ����0���0;����8����*������
� >������������8������������� ����,-�**������,������BB
� I��������������������������
� ?�,�8�����0�I'������;����
� �
=�����#��������
� >�������������*�������
� (��N�������������������-��*���
� !�� �������������O��������
� %����!$!��-�������
� (���*��������������
� >�����<����
� I��*������������������ �7
� "���#I'����I' �������
� �
� ��-��������������
� (����������*����������
� ��B-��������*�������������������
� ��������������7�������������������������
fn = gcompile(code_string); fn(A); fn(B); // re-apply
� (����������*�������
� "����������-���*���������������
� ?�,���������������������������������
��-�����#���
����,��> ��,2���#��
�����������������������
������"���������� ��� ����
�������$����
������
�������$��������
���$����������"������������
:����8������ $�����9� ���� ���� (� ���,��� ,�����#���L ������� (� $��%��F� ���,����A 0I���* �+�* ��� ����� ������� ���� ���������� ��� �#,,�����A
6��7�8������ $�����9�� 1������� �� ��� ����������� ���,#������ �� �� �� ���,����� ��� ����#���� ��� ���#�����
%���