Intel Integrated
Performance Primitives
How to Optimize Software Applications
Using Intel IPP
Stewart Taylor
Intel Integrated
Performance Primitives
How to Optimize Software Applications
®
Using Intel IPP
®
Stewart Taylor
INTEL
PRESS
Copyright © 2004 Intel Corporation. All rights reserved.
ISBN 0-9717861-3-5
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
either the prior written permission of the Publisher, or authorization through payment of the
appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 750-4744. Requests to the Publisher for permission
should be addressed to the Publisher, Intel Press, Intel Corporation, 2111 NE 25
th
Avenue, JF3-
330, Hillsboro, OR 97124-5961. E-Mail: intelpress@intel.com.
This publication is designed to provide accurate and authoritative information in regard to the
subject matter covered. It is sold with the understanding that the publisher is not engaged in
professional services. If professional advice or other expert assistance is required, the services
of a competent professional person should be sought.
Intel Corporation may have patents or pending patent applications, trademarks, copyrights, or
other intellectual property rights that relate to the presented subject matter. The furnishing of
documents and other materials and information does not provide any license, express or
implied, by estoppel or otherwise, to any such patents, trademarks, copyrights, or other
intellectual property rights.
Intel may make changes to specifications, product descriptions, and plans at any time, without
notice.
Fictitious names of companies, products, people, characters, and/or data mentioned herein are
not intended to represent any real individual, company, product, or event.
Intel products are not intended for use in medical, life saving, life sustaining, critical control or
safety systems, or in nuclear facility applications.
Intel and Pentium are trademarks or registered trademark of Intel Corporation.
†
Other names and brands may be claimed as the property of others.
This book is printed on acid-free paper.
Publisher: Richard Bowles
Editor: David Clark
Managing Editor: David B. Spencer
Content Manager: Stuart Goldstein
Text Design & Composition: TBD
Graphic Art: TBD (illustrations), Ted Cyrek (cover)
Library of Congress Cataloging in Publication Data:
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
Contents
Chapter
1
Introduction
1
What Are the Intel Integrated Performance Primitives? 2
A Broad Multimedia and Computational Library (“Integrated”) 2
A Software Optimization Layer (“Performance”) 2
An Extensive Set of Low-Level Operations (“Primitives”) 4
A Cross-Platform API 5
Why This Book? 6
Target Audience 6
Content Review 7
CD-ROM 8
Chapter 2
Using IPP
9
Linkage Options Overview 9
Dynamic Linkage 12
Usage 14
Distribution 15
Static Linkage with Dispatching 15
Usage 17
Distribution 18
Custom Dynamic Linkage 18
Usage 19
Distribution 22
Static Linkage Without Dispatching 22
Usage 23
Distribution 25
Linkage Model Comparison 25
Linkage Features Summary 27
iii
iv
Intel
®
Integrated Performance Primitives
Chapter 3
Architecture and Interface
The Three Input Types 29
Fundamental Data Types 31
Signals and Arrays 32
Images 34
Matrices 38
Objects 38
Sizes 39
Descriptors 39
Core Functions 42
Domains 42
Multi-step Operations 43
Init Sequence 44
InitAlloc Sequence 45
Return Values 46
Arguments 47
Structures 48
Fundamental Type Structures 48
Basic Structures 49
Multi-step Operation Structures 49
29
Chapter 4
Basic Techniques
51
Measuring Performance with GetCpuClocks 51
Copying Data 54
Converting Types and Layouts 55
Converting Data Types with Convert 56
Rearranging Data with Real, Imag, RealToCplx and CplxToReal
58
Initializing Arrays 60
Initializing One-Dimensional Arrays with ippsVectorRamp 61
Initializing Two-dimensional Arrays with ippiRamp 63
Removing Loops and Branches 64
Removing Branches with Threshold 64
Removing Loops with Compare and Logical Operations 69
Removing Loops with Compare and Copy with Mask 73
Performing Arithmetic Efficiently 74
Performing Arithmetic Between Integers and Floating Point Values
with AddWeighted and AddProduct 74
Performing Linear Combinations of Two Sources with Alpha
Composition 75
评论