OpenCL Extended Instruction Set Specification
|
|
- Brook Willis
- 5 years ago
- Views:
Transcription
1 OpenCL Etended Instruction Set Specification Boaz Ouriel, Intel Version 1., Revision 2 Ma 15, 217
2 OpenCL Etended Instruction Set Specification Copright The Khronos Group Inc. All Rights Reserved. This specification is protected b copright laws and contains material proprietar to the Khronos Group, Inc. It or an components ma not be reproduced, republished, distributed, transmitted, displaed, broadcast, or otherwise eploited in an manner without the epress prior written permission of Khronos Group. You ma use this specification for implementing the functionalit therein, without altering or removing an trademark, copright or other notice from the specification, but the receipt or possession of this specification does not conve an rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anthing that it ma describe, in whole or in part. Khronos Group grants epress permission to an current Promoter, Contributor or Adopter member of Khronos to cop and redistribute UNMODIFIED versions of this specification in an fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for an version of the API is used whenever possible. Such distributed specification ma be reformatted AS LONG AS the contents of the specification are not changed in an wa. The specification ma be incorporated into a product that is sold as long as such product includes significant independent work developed b the seller. A link to the current version of this specification on the Khronos Group website should be included whenever possible with specification distributions. Khronos Group makes no, and epressl disclaims an, representations or warranties, epress or implied, regarding this specification, including, without limitation, an implied warranties of merchantabilit or fitness for a particular purpose or non-infringement of an intellectual propert. Khronos Group makes no, and epressl disclaims an, warranties, epress or implied, regarding the correctness, accurac, completeness, timeliness, and reliabilit of the specification. Under no circumstances will the Khronos Group, or an of its Promoters, Contributors or Members or their respective partners, officers, directors, emploees, agents, or representatives be liable for an damages, whether direct, indirect, special or consequential damages for lost revenues, lost profits, or otherwise, arising from or in connection with these materials. Khronos, SYCL, SPIR, WebGL, EGL, COLLADA, StreamInput, OpenVX, OpenKCam, gltf, OpenKODE, OpenVG, OpenWF, OpenSL ES, OpenMAX, OpenMAX AL, OpenMAX IL and OpenMAX DL are trademarks and WebCL is a certification mark of the Khronos Group Inc. OpenCL is a trademark of Apple Inc. and OpenGL and OpenML are registered trademarks and the OpenGL ES and OpenGL SC logos are trademarks of Silicon Graphics International used under license b Khronos. All other product names, trademarks, and/or compan names are used solel for identification and belong to their respective owners. 2
3 OpenCL Etended Instruction Set Specification Contents 1 Introduction 4 2 Binar Form Math Integer Common Geometric Relational Vector Data Load and Store Miscellaneous Vector Misc Image encoding Sampler encoding A Changes and TBD 63 A.1 Changes from Version.99, Revision A.2 Changes from Version.99, Revision A.3 Changes from Version.99, Revision A.4 Changes from Version 1., Revision A.5 Changes from Version 1., Revision
4 OpenCL Etended Instruction Set Specification Contributors and Acknowledgments Brian Sumner, AMD Mandana Baregheh, AMD Mart Johnson, AMD Yaun Liu, AMD Andrew Richards, Codepla Alee Bader, Intel Ben Ashbaugh, Intel Gu Benei, Intel Raun Krisch, Intel Yuan Lin, NVIDIA Ben Gaster, Qualcomm Chihong Zang, Qualcomm Jack Liu, Qualcomm Lee Howes, Qualcomm 1 Introduction This is the specification of OpenCL.std instruction set. The librar is imported into a SPIR-V module in the following manner: <et-inst-id> OpEtInstImport "OpenCL.std" The librar can onl be imported when Memor Model is set to OpenCL 2 Binar Form This section contains the semantics and eact form of eecution of OpenCL using the OpEtInst instruction. In this section we use the following naming conventions: void denote an OpTpeVoid. half, float and double denote an OpTpeFloat with a width of 16, 32 and 64 bits respectivel. i8, i16, i32 and i64 denote an OpTpeInt with a width of 8, 16, 32 and 64 bits respectivel. bool denotes an OpTpeBool. size_t denotes an i32 when the Addressing Model is Phsical32 and i64 when the Addressing Model is Phsical64. 4
5 OpenCL Etended Instruction Set Specification vector(n) denotes an OpTpeVector where n indicates the component count. vector(n 1, n 2,..., n i ) abbreviates vector(n 1 ), vector(n 2 ),... or vector(n i ). integer denotes i8, i16, i32 or i64. floating-point denotes half, float, double. pointer(storage) denotes an OpTpePointer which points to storage Storage Class. pointer(constant) denotes an OpTpePointer with UniformConstant Storage Class. pointer(generic) denotes an OpTpePointer with Generic Storage Class. pointer(global) denotes an OpTpePointer with CrossWorkgroup Storage Class. pointer(local) denotes an OpTpePointer with Workgroup Storage Class. pointer(private) denotes an OpTpePointer with Function Storage Class. pointer(s 1, s 2,..., s i ) abbreviates pointer(s 1 ), pointer(s 2 ),... or pointer(s i ). image defines all tpes of image memor objects (See image encoding section). sampler a SPIR-V sampler object (See sampler encoding section). 5
6 OpenCL Etended Instruction Set Specification 2.1 Math This section describes the list of eternal math. The eternal math are categorized into the following: A list of that have scalar or vector argument versions, and, A list of that onl take scalar float arguments. The vector versions of the math operate component-wise. The description is per-component. The math are not affected b the prevailing rounding mode in the calling environment, and alwas return the same value as the would if called with the round to nearest even rounding mode. acos Compute the arc cosine of. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe acosh Compute the inverse hperbolic cosine of. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
7 OpenCL Etended Instruction Set Specification acospi Compute acos() / π. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe asin Compute the arc sine of. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe asinh Compute the inverse hperbolic sine of. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
8 OpenCL Etended Instruction Set Specification asinpi Compute asin() / π. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe atan Compute the arc tangent of. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe atan2 Compute the arc tangent of /. Result is an angle in radians, and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
9 OpenCL Etended Instruction Set Specification atanh Compute the hperbolic arc tangent of. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe atanpi Compute atan() / π. Result is an angle in radians and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe atan2pi Compute atan2(, ) / π. Result is an angle in radians, and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
10 OpenCL Etended Instruction Set Specification cbrt Compute the cube-root of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe ceil Round to integral value using the round to positive infinit rounding mode. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe copsign Returns with its sign changed to match the sign of., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe cos Compute the cosine of radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
11 OpenCL Etended Instruction Set Specification cosh Compute the hperbolic cosine of radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe cospi Compute cos() / π radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe erfc Complementar error function of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe erf Error function of encountered in integrating the normal distribution. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
12 OpenCL Etended Instruction Set Specification ep Compute the base-e eponential of. (i.e. e ) and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe ep2 Computes 2 raised to the power of. (i.e. 2 ) and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe ep1 Computes 1 raised to the power of. (i.e. 1 ) and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe epm1 Computes e and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
13 OpenCL Etended Instruction Set Specification fabs Compute the absolute value of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe fdim Compute - if >, + if is less than or equal to., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe floor Round to the integral value using the round to negative infinit rounding mode. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe fma Compute the correctl rounded floating-point representation of the sum of c with the infinitel precise product of a and b.rounding of intermediate products shall not occur. Edge case behavior is per the IEEE standard., a, b and c must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe a b c 13
14 OpenCL Etended Instruction Set Specification fma Returns if <, otherwise it returns. If one argument is a NaN, Fma returns the other argument. If both arguments are NaNs, Fma returns a NaN., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe. Note: fma behave as defined b C99 and ma not match the IEEE definition for manum with regard to signaling NaNs.Specificall, signaling NaNs ma behave as quiet NaNs fmin Returns if <, otherwise it returns. If one argument is a NaN, Fmin returns the other argument. If both arguments are NaNs, Fmin returns a NaN., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe. Note: fmin behave as defined b C99 and ma not match the IEEE definition for minnum with regard to signaling NaNs.Specificall, signaling NaNs ma behave as quiet NaNs fmod Modulus. Returns - * trunc (/)., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
15 OpenCL Etended Instruction Set Specification fract Returns fmin( - floor(), 1.fffffep-1f. floor() is returned in ptr. and must be floating-point or vector(2,3,4,8,16) of floating-point values. ptr must be a pointer(global, local, private, generic) to floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe, or must be a pointer to the same tpe ptr frep Etract the mantissa and eponent from. The holds the mantissa, and ep points to the eponent. For each component the mantissa returned is a floating-point with magnitude in the interval [1/2, 1) or. Each component of equals mantissa returned * 2 ep. and must be floating-point or vector(2,3,4,8,16) of floating-point values. ep must be a pointer(global, local, private, generic) to i32 or vector(2,3,4,8,16) of i32 values. and operands must be of the same tpe. ep operand must point to an i32 with the same component count as and operands ep hpot Compute the value of the square root of without undue overflow or underflow., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
16 OpenCL Etended Instruction Set Specification ilogb Return the eponent of as an i32 value. must be i32 or vector(2,3,4,8,16) of i32 values. must be floating-point or vector(2,3,4,8,16) of floating-point values. and operands must have the same component count ldep Multipl b 2 to the power k. k must be i32 or vector(2,3,4,8,16) of i32 values. and must be floating-point or vector(2,3,4,8,16) of floating-point values. and operands must be of the same tpe. ep operand must have the same component count as and operands k lgamma Log gamma function of. Returns the natural logarithm of the absolute value of the gamma function. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
17 OpenCL Etended Instruction Set Specification lgamma_r Log gamma function of. Returns the natural logarithm of the absolute value of the gamma function. The sign of the gamma function is returned in the signp operand and must be floating-point or vector(2,3,4,8,16) of floating-point values. signp must be a pointer(global, local, private, generic) to i32 or vector(2,3,4,8,16) of i32 values. and operands must be of the same tpe. signp operand must point to an i32 with the same component count as and operands signp log Compute natural logarithm of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe log2 Compute a base 2 logarithm of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe log1 Compute a base 1 logarithm of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
18 OpenCL Etended Instruction Set Specification log1p Compute log e (1. + ). and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe logb Compute the eponent of, which is the integral part of log r. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe mad mad approimates a * b + c. Whether or how the product of a * b is rounded and how supernormal or subnormal intermediate products are handled is not defined. mad is intended to be used where speed is preferred over accurac, a, b and c must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe. Note: For some usages, e.g.mad(a, b, -a*b), the definition of mad() is loose enough that almost an result is allowed from mad() for some values of a and b a b c mamag Returns if >, if >, otherwise fma(, )., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
19 OpenCL Etended Instruction Set Specification minmag Returns if <, if <, otherwise fmin(, )., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe modf Decompose a floating-point number. The modf function breaks the argument into integral and fractional parts, each of which has the same sign as the argument. It stores the integral part in the object pointed to b iptr and must be floating-point or vector(2,3,4,8,16) of floating-point values. iptr must be a pointer(global, local, private, generic) to floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe, or must be a pointer to the same tpe iptr nan Returns a quiet NaN. The nancode ma be placed in the significand of the resulting NaN. must be floating-point or vector(2,3,4,8,16) of floating-point values. nancode must be integer or vector(2,3,4,8,16) of integer values. and nancode operands must have the same component count. The primitve data tpe size of nancode and Reuslt Tpe must be equal nancode 19
20 OpenCL Etended Instruction Set Specification netafter Computes the net representable floating-point value following in the direction of. Thus, if is less than, netafter() returns the largest representable floating-point number less than., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe pow Compute to the power., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe pown Compute to the power, where is an i32 integer. must be i32 or vector(2,3,4,8,16) of i32 values. and must be floating-point or vector(2,3,4,8,16) of floating-point values. and operands must be of the same tpe. operand must have the same component count as Result Tpe and operands powr Compute to the power, where is >=., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
21 OpenCL Etended Instruction Set Specification remainder Compute the value r such that r = - n*, where n is the integer nearest the eact value of /. If there are two integers closest to /, n shall be the even one. If r is zero, it is given the same sign as., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe remquo The remquo function computes the value r such that r = - k*, where k is the integer nearest the eact value of /. If there are two integers closest to /, k shall be the even one. If r is zero, it is given the same sign as. This is the same value that is returned b the remainder function. remquo also calculates the lower seven bits of the integral quotient /, and gives that value the same sign as /. It stores this signed value in the object pointed to b quo., and must be floating-point or vector(2,3,4,8,16) of floating-point values. quo must be a pointer(global, local, private, generic) to i32 or vector(2,3,4,8,16) of i32 values., and operands must be of the same tpe. quo operand must point to an i32 with the same component count as, and operands quo rint Round to integral value (using round to nearest even rounding mode) in floating-point format. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
22 OpenCL Etended Instruction Set Specification rootn Compute to the power 1/. must be i32 or vector(2,3,4,8,16) of i32 values. and must be floating-point or vector(2,3,4,8,16) of floating-point values. and operands must be of the same tpe. operand must have the same component count as Result Tpe and operands round Return the integral value nearest to rounding halfwa cases awa from zero, regardless of the current rounding direction. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe rsqrt Compute inverse square root of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe sin Compute sine of radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
23 OpenCL Etended Instruction Set Specification sincos Compute sine and cosine of radians. The computed sine is the return value and computed cosine is returned in cosval. and must be floating-point or vector(2,3,4,8,16) of floating-point values. cosval must be a pointer(global, local, private, generic) to floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe, or must be a pointer to the same tpe cosval sinh Compute hperbolic sine of radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe sinpi Compute sin (π ) radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
24 OpenCL Etended Instruction Set Specification sqrt Compute square root of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe tan Compute tangent of radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe tanh Compute hperbolic tangent of radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe tanpi Compute tan (π ) radians. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
25 OpenCL Etended Instruction Set Specification tgamma Compute the gamma function of. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe trunc Round to integral value using the round to zero rounding mode. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe half_cos Compute cosine of radians, where must be in the range ha and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_divide Compute /., and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe
26 OpenCL Etended Instruction Set Specification half_ep Compute the base-e eponential of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_ep2 Compute the base- 2 eponential of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_ep1 Compute the base- 1 eponential of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_log Compute natural logarithm of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe
27 OpenCL Etended Instruction Set Specification half_log2 Compute a base 2 logarithm of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_log1 Compute a base 1 logarithm of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_powr Compute to the power, where is >=., and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_recip Compute reciprocal of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe
28 OpenCL Etended Instruction Set Specification half_rsqrt Compute inverse square root of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_sin Compute sine of radians, where must be in the range and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_sqrt Compute the square root of. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe half_tan Compute tangent value of radians, where must be in the range and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe
29 OpenCL Etended Instruction Set Specification native_cos Compute cosine of radians over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_divide Compute / over an implementation-defined range. The maimum error is implementation-defined., and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_ep Compute the base-e eponential of over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function
30 OpenCL Etended Instruction Set Specification native_ep2 Compute the base- 2 eponential of over an implementation-defined range. The maimum error is implementation-defined.. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_ep1 Compute the base- 1 eponential of over an implementation-defined range. The maimum error is implementation-defined.. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_log Compute natural logarithm of over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function
31 OpenCL Etended Instruction Set Specification native_log2 Compute a base 2 logarithm of over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_log1 Compute a base 1 logarithm of over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_powr Compute to the power, where is >=., and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function
32 OpenCL Etended Instruction Set Specification native_recip Compute reciprocal of over an implementation-defined range. The range of and are implementation-defined. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_rsqrt Compute inverse square root of over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_sin Compute sine of radians over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function
33 OpenCL Etended Instruction Set Specification native_sqrt Compute the square root of over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function native_tan Compute tangent value of radians over an implementation-defined range. The maimum error is implementation-defined. and must be float or vector(2,3,4,8,16) of float values. All of the operands, including the operand, must be of the same tpe. The function ma map to one or more native device and will tpicall have better performance compared to the non native corresponding functions. Support for denormal values is implementation-defined for this function
34 OpenCL Etended Instruction Set Specification 2.2 Integer This section describes the list of integer that take scalar or vector arguments. The vector versions of the integer functions operate component-wise. The description is per-component. s_abs Returns, where is treated as signed integer. and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_abs_diff Returns - without modulo overflow, where and are treated as signed integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_add_sat Returns the saturated value of +, where and are treated as signed integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
35 OpenCL Etended Instruction Set Specification u_add_sat Returns the saturated value of +, where and are treated as unsigned integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_hadd Returns the value of ( + ) >> 1, where and are treated as signed integers. The intermediate sum does not modulo overflow., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe u_hadd Returns the value of ( + ) >> 1, where and are treated as unsigned integers. The intermediate sum does not modulo overflow., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_rhadd Returns the value of ( + + 1) >> 1, where and are treated as signed integers. The intermediate sum does not modulo overflow., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
36 OpenCL Etended Instruction Set Specification u_rhadd Returns the value of ( + + 1) >> 1, where and are treated as unsigned integers. The intermediate sum does not modulo overflow., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_clamp Returns s_min(s_ma(,minval),maval), where, minval, and maval are treated as signed integers. Results are undefined if minval > maval.,, minval and maval must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe minval maval u_clamp Returns u_min(u_ma(,minval),maval), where, minval, and maval are treated as unsigned integers. Results are undefined if minval > maval.,, minval and maval must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe minval maval clz Returns the number of leading bits in, starting at the most significant bit position. If is, returns the size in bits of the tpe of or component tpe of, if is a vector. and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
37 OpenCL Etended Instruction Set Specification ctz Returns the count of trailing bits in. If is, returns the size in bits of the tpe of or component tpe of, if is a vector. and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_mad_hi Returns mul_hi(a, b) + c, where a,b and c are treated as signed integers., a, b and c must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe a b c u_mad_sat Returns * + z and sautrates the result where, and z are treated as unsigned integers.,, and z must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe z s_mad_sat Returns * + z and sautrates the result where, and z are treated as signed integers.,, and z must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe z 37
38 OpenCL Etended Instruction Set Specification s_ma Returns if <, otherwise it returns, where and are treated as signed integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe u_ma Returns if <, otherwise it returns, where and are treated as unsigned integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe s_min Returns if <, otherwise it returns, where and are treated as signed integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe u_min Returns if <, otherwise it returns, where and are treated as unsigned integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
39 OpenCL Etended Instruction Set Specification s_mul_hi Computes * and returns the high half of the product of and, where and are treated as signed integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe rotate For each element in v, the bits are shifted left b the number of bits given b the corresponding element in i. Bits shifted off the left side of the element are shifted back in from the right., v and i must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe v i s_sub_sat Returns the saturated value of -, where and are treated as signed integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe u_sub_sat Returns the saturated value of -, where and are treated as unsigned integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
40 OpenCL Etended Instruction Set Specification u_upsample When hi and lo component tpe is i8: Result = ((upcast... to i16)hi << 8) lo When hi and lo component tpe is i16: Result = ((upcast... to i32)hi << 8) lo When hi and lo component i32: Result = ((upcast... to i64)hi << 8) lo hi and lo are treated as unsigned integers. hi and lo must be i8, i16 or i32 or vector(2,3,4,8,16) of i8, i16 or i32 values. must be i16, i32 or i64 or vector(2,3,4,8,16) of i16, i32 or i64 values. hi and lo operands must be of the same tpe. When hi and lo component tpe is i8, the component tpe must be i16. When hi and lo component tpe is i16, the component tpe must be i32. When hi and lo component tpe is i32, the component tpe must be i64. must have the same component count as hi and lo operands hi lo 4
41 OpenCL Etended Instruction Set Specification s_upsample When hi and lo component tpe is i8: Result = ((upcast... to i16)hi << 8) lo When hi and lo component tpe is i16: Result = ((upcast... to i32)hi << 8) lo When hi and lo component i32: Result = ((upcast... to i64)hi << 8) lo hi and lo are treated as signed integers. hi and lo must be i8, i16 or i32 or vector(2,3,4,8,16) of i8, i16 or i32 values. must be i16, i32 or i64 or vector(2,3,4,8,16) of i16, i32 or i64 values. hi and lo operands must be of the same tpe. When hi and lo component tpe is i8, the component tpe must be i16. When hi and lo component tpe is i16, the component tpe must be i32. When hi and lo component tpe is i32, the component tpe must be i64. must have the same component count as hi and lo operands hi lo popcount Returns the number of non-zero bits in. and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
42 OpenCL Etended Instruction Set Specification s_mad24 Multip two 24-bit integer values and and add the 32-bit integer result to the 32-bit integer z. Refer to definition of s_mul24 to see how the 24-bit integer multiplication is performed.,, and z must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe z u_mad24 Multip two 24-bit integer values and and add the 32-bit integer result to the 32-bit integer z. Refer to definition of u_mul24 to see how the 24-bit integer multiplication is performed.,, and z must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe z s_mul24 Multipl two 24-bit integer values and, where and are treated as signed integers. and are 32-bit integers but onl the low-order 24 bits are used to perform the multiplication. s_mul24 should onl be used when values in and are in the range [-2 23, ]. If and are not in this range, the multiplication result is implementation-defined., and must be i32 or vector(2,3,4,8,16) of i32 values. All of the operands, including the operand, must be of the same tpe
43 OpenCL Etended Instruction Set Specification u_mul24 Multipl two 24-bit integer values and, where and are treated as unsigned integers. and are 32-bit integers but onl the low-order 24 bits are used to perform the multiplication. u_mul24 should onl be used when values in and are in the range [, ]. If and are not in this range, the multiplication result is implementation-defined., and must be i32 or vector(2,3,4,8,16) of i32 values. All of the operands, including the operand, must be of the same tpe u_abs Returns, where is treated as unsigned integer. and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe u_abs_diff Returns - without modulo overflow, where and are treated as unsigned integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe u_mul_hi Computes * and returns the high half of the product of and, where and are treated as unsigned integers., and must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe
44 OpenCL Etended Instruction Set Specification u_mad_hi Returns mul_hi(a, b) + c, where a,b and c are treated as unsigned integers., a, b and c must be integer or vector(2,3,4,8,16) of integer values. All of the operands, including the operand, must be of the same tpe a b c 44
45 OpenCL Etended Instruction Set Specification 2.3 Common This section describes the list of common that take scalar or vector arguments. The vector versions of the integer functions operate component-wise. The description is per-component. The common are implemented using the round to nearest even rounding mode. fclamp Returns fmin(fma(, minval), maval). Results are undefined if minval > maval.,, minval and maval must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe minval maval degrees Converts radians to degrees, i.e. (18 / π) * radians. and radians must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe radians fma_common Returns if <, otherwise it returns. If or are infinite or NaN, the return values are undefined., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
46 OpenCL Etended Instruction Set Specification fmin_common Returns if <, otherwise it returns. If or are infinite or NaN, the return values are undefined., and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe mi Returns the linear blend of & implemented as: + ( - ) * a,, and a must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe. Note: This function can be implemented using contractions such as mad or fma a radians Converts degrees to radians, i.e. (π / 18) * degrees. and degrees must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe degrees step Returns. if < edge, otherwise it returns 1.., edge and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe edge 46
47 OpenCL Etended Instruction Set Specification smoothstep Returns. if edge and 1. if >= edge 1 and performs smooth Hermite interpolation between and 1, when edge < < edge 1. This is equivalent to : t = fclamp(( - edge ) / (edge 1 - edge ),, 1); return t * t * (3-2 * t); Results are undefined if edge >= edge 1 or if, edge or edge 1 is a NaN., edge, edge 1 and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe. Note: This function can be implemented using contractions such as mad or fma edge edge 1 sign Returns 1. if >, -. if = -., +. if = +., or -1. if <. Returns. if is a NaN. and must be floating-point or vector(2,3,4,8,16) of floating-point values. All of the operands, including the operand, must be of the same tpe
48 OpenCL Etended Instruction Set Specification 2.4 Geometric This section describes the list of geometric. In this section,,z and w denote the first, second, third and fourth component respecitivel, of vectors with 3 and four components.the geometric are implemented using the round to nearest even rounding mode. Note: The geometric functions can be implemented using contractions such as mad or fma cross Returns the cross product of p.z and p 1.z. When the vector component count is 4, the w component returned will be.., p and p 1 must be vector(3,4) of floating-point values. All of the operands, including the operand, must be of the same tpe p p 1 distance Returns the distance between p and p 1. This is calculated as length(p - p 1 ). must be floating-point. p and p 1 must be floating-point or vector(2,3,4) of floating-point values. p and p 1 operands must have the same tpe., p and p 1 operands must have the same component tpe p p 1 length Return the length of vector p, i.e. sqrt( p. 2 + p ) must be floating-point. p must be vector(2,3,4) of floating-point values. and p operands must have the same component tpe p 48
49 OpenCL Etended Instruction Set Specification normalize Returns a vector in the same direction as p but with a length of 1. and p must be floating-point or vector(2,3,4) of floating-point values. All of the operands, including the operand, must be of the same tpe p fast_distance Returns fast_length(p - p 1 ). must be floating-point. p and p 1 must be floating-point or vector(2,3,4) of floating-point values. p and p 1 operands must have the same tpe., p and p 1 operands must have the same component tpe p p 1 fast_length Return the length of vector p computed as: half_sqrt( p. 2 + p ) must be floating-point. p must be vector(2,3,4) of floating-point values. and p operands must have the same component tpe p 49
OpenCL 2.1 Extended Instruction Set Specification (Provisional)
OpenCL 2.1 Etended Instruction Set Specification (Provisional) Boaz Ouriel, Intel Version 0.99, Revision 30 April 2, 2015 OpenCL 2.1 Etended Instruction Set Specification (Provisional) ii Copright 2014-2015
More informationSPIR-V Extended Instructions for GLSL
SPIR-V Etended Instructions for GLSL John Kessenich, Google Version 1.00, Revision 7 August 8, 2018 SPIR-V Etended Instructions for GLSL Copyright 2014-2018 The Khronos Group Inc. All Rights Reserved.
More informationOpenCL ICD Installation Guidelines. Khronos OpenCL Working Group. Version 2.2-7, Sat, 12 May :21:
OpenCL ICD Installation Guidelines Khronos OpenCL Working Group Version 2.2-7, Sat, 12 May 2018 13:21:25 +0000 Table of Contents 1. Introduction..............................................................................
More informationThe OpenCL SPIR-V Environment Specification. Khronos OpenCL Working Group. Version 2.2-7, Sat, 12 May :21:
The OpenCL SPIR-V Environment Specification Khronos OpenCL Working Group Version 2.2-7, Sat, 12 May 2018 13:21:25 +0000 Table of Contents 1. Introduction..............................................................................
More informationEGLStream DataLocator Extension Specification
1 EGLStream DataLocator Extension Specification Version 1.0 Copyright 2011 The Khronos Group Inc. September 21, 2011 2 Copyright 2011 The Khronos Group Inc. All Rights Reserved. This specification is protected
More informationOpenCL Overview. Tim Mattson Intel Labs. Copyright Khronos Group, Page 1
OpenCL Overview Tim Mattson Intel Labs Copyright Khronos Group, 2009 - Page 1 Programming Heterogeneous Platforms CPUs Multiple cores driving performance increases Emerging Intersection GPUs Increasingly
More informationBuilt-in Types of Data
Built-in Types of Data Types A data type is set of values and a set of operations defined on those values Python supports several built-in data types: int (for integers), float (for floating-point numbers),
More informationThe OpenVX Classifier Extension. The Khronos OpenVX Working Group, Editors: Tomer Schwartz, Radhakrishna Giduthuri
The OpenVX Classifier Extension The Khronos OpenVX Working Group, Editors: Tomer Schwartz, Radhakrishna Giduthuri Version 1.2.1 (provisional), Wed, 15 Aug 2018 06:03:09 +0000 Table of Contents 1. Classifiers
More informationArithmetic and Logic Blocks
Arithmetic and Logic Blocks The Addition Block The block performs addition and subtractions on its inputs. This block can add or subtract scalar, vector, or matrix inputs. We can specify the operation
More informationThe OpenVX User Data Object Extension
The OpenVX User Data Object Extension The Khronos OpenVX Working Group, Editor: Jesse Villarreal Version 1.0 (provisional), Wed, 13 Feb 2019 16:07:15 +0000 Table of Contents 1. Introduction.............................................................................................
More informationThe OpenVX Buffer Aliasing Extension
The OpenVX Buffer Aliasing Extension The Khronos OpenVX Working Group, Editor: Jesse Villarreal Version 1.0 (provisional), Wed, 13 Feb 2019 16:07:12 +0000 Table of Contents 1. Introduction.............................................................................................
More informationSingle row numeric functions
Single row numeric functions Oracle provides a lot of standard numeric functions for single rows. Here is a list of all the single row numeric functions (in version 10.2). Function Description ABS(n) ABS
More information1001ICT Introduction To Programming Lecture Notes
1001ICT Introduction To Programming Lecture Notes School of Information and Communication Technology Griffith University Semester 1, 2015 1 M Environment console M.1 Purpose This environment supports programming
More informationThe OpenVX Export and Import Extension
The OpenVX Export and Import Extension The Khronos OpenVX Working Group, Editors: Steve Ramm, Radhakrishna Giduthuri Version 1.1.1, Wed, 15 Aug 2018 06:03:12 +0000 Table of Contents 1. Export and Import
More informationSecondary Math 3- Honors. 7-4 Inverse Trigonometric Functions
Secondary Math 3- Honors 7-4 Inverse Trigonometric Functions Warm Up Fill in the Unit What You Will Learn How to restrict the domain of trigonometric functions so that the inverse can be constructed. How
More informationUsing the um-fpu with the Javelin Stamp
Using the um-fpu with the Javelin Stamp Introduction The um-fpu is a 32-bit floating point coprocessor that can be easily interfaced with the Javelin Stamp to provide support for 32-bit IEEE 754 floating
More informationSum and Difference Identities. Cosine Sum and Difference Identities: cos A B. does NOT equal cos A. Cosine of a Sum or Difference. cos B.
7.3 Sum and Difference Identities 7-1 Cosine Sum and Difference Identities: cos A B Cosine of a Sum or Difference cos cos does NOT equal cos A cos B. AB AB EXAMPLE 1 Finding Eact Cosine Function Values
More informationHow to Design Programs Languages
How to Design Programs Languages Version 4.1 August 12, 2008 The languages documented in this manual are provided by DrScheme to be used with the How to Design Programs book. 1 Contents 1 Beginning Student
More informationScript started on Thu 25 Aug :00:40 PM CDT
Script started on Thu 25 Aug 2016 02:00:40 PM CDT < M A T L A B (R) > Copyright 1984-2014 The MathWorks, Inc. R2014a (8.3.0.532) 64-bit (glnxa64) February 11, 2014 To get started, type one of these: helpwin,
More informationMacro Programming Reference Guide. Copyright 2005 Scott Martinez
Macro Programming Reference Guide Copyright 2005 Scott Martinez Section 1. Section 2. Section 3. Section 4. Section 5. Section 6. Section 7. What is macro programming What are Variables What are Expressions
More informationUnit 4 Trigonometry. Study Notes 1 Right Triangle Trigonometry (Section 8.1)
Unit 4 Trigonometr Stud Notes 1 Right Triangle Trigonometr (Section 8.1) Objective: Evaluate trigonometric functions of acute angles. Use a calculator to evaluate trigonometric functions. Use trigonometric
More informationTaipei Embedded Outreach OpenCL DSP Profile Proposals
Copyright 2018 The Khronos Group Inc. Page 1 Taipei Embedded Outreach OpenCL DSP Profile Proposals Prof. Jenq-Kuen Lee, NTHU Taipei, January 2018 Copyright 2018 The Khronos Group Inc. Page 2 Outline Speaker
More informationC++, How to Program. Spring 2016 CISC1600 Yanjun Li 1
Chapter 6 Function C++, How to Program Deitel & Deitel Spring 2016 CISC1600 Yanjun Li 1 Function A function is a collection of statements that performs a specific task - a single, well-defined task. Divide
More informationALTERA_CORDIC IP Core User Guide
UG-20017 2017.05.08 Subscribe Send Feedback Contents Contents 1... 3 1.1 ALTERA_CORDIC IP Core Features... 3 1.2 DSP IP Core Device Famil Support...3 1.3 ALTERA_CORDIC IP Core Functional Description...4
More informationFunctions. Systems Programming Concepts
Functions Systems Programming Concepts Functions Simple Function Example Function Prototype and Declaration Math Library Functions Function Definition Header Files Random Number Generator Call by Value
More informationFloating-Point Arithmetic
ENEE446---Lectures-4/10-15/08 A. Yavuz Oruç Professor, UMD, College Park Copyright 2007 A. Yavuz Oruç. All rights reserved. Floating-Point Arithmetic Integer or fixed-point arithmetic provides a complete
More informationMaths Functions User Manual
Professional Electronics for Automotive and Motorsport 6 Repton Close Basildon Essex SS13 1LE United Kingdom +44 (0) 1268 904124 info@liferacing.com www.liferacing.com Maths Functions User Manual Document
More informationThe Sine and Cosine Functions
Lesson -5 Lesson -5 The Sine and Cosine Functions Vocabular BIG IDEA The values of cos and sin determine functions with equations = sin and = cos whose domain is the set of all real numbers. From the eact
More informationDr Richard Greenaway
SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how
More informationIntroduction to GPGPUs and to CUDA programming model: CUDA Libraries
Introduction to GPGPUs and to CUDA programming model: CUDA Libraries www.cineca.it Marzia Rivi m.rivi@cineca.it NVIDIA CUDA Libraries http://developer.nvidia.com/technologies/libraries CUDA Toolkit includes
More informationCUDA Toolkit 5.0 Performance Report. January 2013
CUDA Toolkit 5.0 Performance Report January 2013 CUDA Math Libraries High performance math routines for your applications: cufft Fast Fourier Transforms Library cublas Complete BLAS Library cusparse Sparse
More information1. The Pythagorean Theorem
. The Pythagorean Theorem The Pythagorean theorem states that in any right triangle, the sum of the squares of the side lengths is the square of the hypotenuse length. c 2 = a 2 b 2 This theorem can be
More informationLecture 14. Daily Puzzle. Math in C. Rearrange the letters of eleven plus two to make this mathematical statement true. Eleven plus two =?
Lecture 14 Math in C Daily Puzzle Rearrange the letters of eleven plus two to make this mathematical statement true. Eleven plus two =? Daily Puzzle SOLUTION Eleven plus two = twelve plus one Announcements
More informationProgramming for Engineers in Python. Recitation 2
Programming for Engineers in Python Recitation 2 Plan Range For loop While loop Lists Modules Operations Arithmetic Operations: + plus - minus * multiply / divide (int / float) % modulo (remainder) **
More informationC Functions. 5.2 Program Modules in C
1 5 C Functions 5.2 Program Modules in C 2 Functions Modules in C Programs combine user-defined functions with library functions - C standard library has a wide variety of functions Function calls Invoking
More informationMentor Graphics Predefined Packages
Mentor Graphics Predefined Packages Mentor Graphics has created packages that define various types and subprograms that make it possible to write and simulate a VHDL model within the Mentor Graphics environment.
More informationGRAPH 4.4. Megha K. Raman APRIL 22, 2015
GRAPH 4.4 By Megha K. Raman APRIL 22, 2015 1. Preface... 4 2. Introduction:... 4 3. Plotting a function... 5 Sample funtions:... 9 List of Functions:... 10 Constants:... 10 Operators:... 11 Functions:...
More informationFloating Point Puzzles The course that gives CMU its Zip! Floating Point Jan 22, IEEE Floating Point. Fractional Binary Numbers.
class04.ppt 15-213 The course that gives CMU its Zip! Topics Floating Point Jan 22, 2004 IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Floating Point Puzzles For
More informationCUDA Toolkit 4.0 Performance Report. June, 2011
CUDA Toolkit 4. Performance Report June, 211 CUDA Math Libraries High performance math routines for your applications: cufft Fast Fourier Transforms Library cublas Complete BLAS Library cusparse Sparse
More informationINSIDE MACINTOSH. Addison-Wesley Publishing Company
apple INSIDE MACINTOSH PowerPC Numerics Addison-Wesley Publishing Company Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo
More informationLAB 1 General MATLAB Information 1
LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by
More informationThe OpenCL Extension Specification
The OpenCL Extension Specification Version: 2.0 Document Revision: 34 Khronos OpenCL Working Group Editor: Lee Howes and Aaftab Munshi Last Revision Date: February 13, 2018 Page 1 9. OPTIONAL EXTENSIONS...
More informationSPIR-V Specification. John Kessenich, Google and Boaz Ouriel, Intel. Version 1.00, Revision 12
John Kessenich, Google and Boaz Ouriel, Intel Version 1.00, Revision 12 January 16, 2018 Copyright 2014-2017 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws
More informationMYSQL NUMERIC FUNCTIONS
MYSQL NUMERIC FUNCTIONS http://www.tutorialspoint.com/mysql/mysql-numeric-functions.htm Copyright tutorialspoint.com MySQL numeric functions are used primarily for numeric manipulation and/or mathematical
More informationFloating Point Considerations
Chapter 6 Floating Point Considerations In the early days of computing, floating point arithmetic capability was found only in mainframes and supercomputers. Although many microprocessors designed in the
More informationFloating point. Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties. Next time. !
Floating point Today! IEEE Floating Point Standard! Rounding! Floating Point Operations! Mathematical properties Next time! The machine model Chris Riesbeck, Fall 2011 Checkpoint IEEE Floating point Floating
More informationECET 264 C Programming Language with Applications
ECET 264 C Programming Language with Applications Lecture 10 C Standard Library Functions Paul I. Lin Professor of Electrical & Computer Engineering Technology http://www.etcs.ipfw.edu/~lin Lecture 10
More informationLesson #3. Variables, Operators, and Expressions. 3. Variables, Operators and Expressions - Copyright Denis Hamelin - Ryerson University
Lesson #3 Variables, Operators, and Expressions Variables We already know the three main types of variables in C: int, char, and double. There is also the float type which is similar to double with only
More informationChapter 3 - Functions
Chapter 3 - Functions 1 Outline 3.1 Introduction 3.2 Program Components in C++ 3.3 Math Library Functions 3.4 Functions 3.5 Function Definitions 3.6 Function Prototypes 3.7 Header Files 3.8 Random Number
More information6-1 (Function). (Function) !*+!"#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x
(Function) -1.1 Math Library Function!"#! $%&!'(#) preprocessor directive #include !*+!"#!, Function Description Example sqrt(x) square root of x sqrt(900.0) is 30.0 sqrt(9.0) is 3.0 exp(x) log(x)
More informationGPU Floating Point Features
CSE 591: GPU Programming Floating Point Considerations Klaus Mueller Computer Science Department Stony Brook University Objective To understand the fundamentals of floating-point representation To know
More informationChap 6 Function Define a function, which can reuse a piece of code, just with a few different values.
Chap 6 Function Define a function, which can reuse a piece of code, just with a few different values. def tax(bill): """Adds 8% tax to a restaurant bill.""" bill *= 1.08 print "With tax: %f" % bill return
More informationA. Matrix-wise and element-wise operations
USC GSBME MATLAB CLASS Reviewing previous session Second session A. Matrix-wise and element-wise operations A.1. Matrix-wise operations So far we learned how to define variables and how to extract data
More informationUNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666
UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering Digital Computer Arithmetic ECE 666 Part 4-C Floating-Point Arithmetic - III Israel Koren ECE666/Koren Part.4c.1 Floating-Point Adders
More informationWhat is a Function? How to find the domain of a function (algebraically) Domain hiccups happen in 2 major cases (rational functions and radicals)
What is a Function? Proving a Function Vertical Line Test Mapping Provide definition for function Provide sketch/rule for vertical line test Provide sketch/rule for mapping (notes #-3) How to find the
More informationSystems I. Floating Point. Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties
Systems I Floating Point Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties IEEE Floating Point IEEE Standard 754 Established in 1985 as uniform standard for
More informationTABLE OF CONTENTS CHAPTER 1 LIMIT AND CONTINUITY... 26
TABLE OF CONTENTS CHAPTER LIMIT AND CONTINUITY... LECTURE 0- BASIC ALGEBRAIC EXPRESSIONS AND SOLVING EQUATIONS... LECTURE 0- INTRODUCTION TO FUNCTIONS... 9 LECTURE 0- EXPONENTIAL AND LOGARITHMIC FUNCTIONS...
More informationtag 220 tan[f l] struct { int i; double d; } sa, sb; struct { int i; double d; } s1, s2;
tag 220 T tag The identifier that may optionally follow the keyword struct, union, or enum in a structure, union, or enumerated type definition, respectively. The tag is used later to refer to that particular
More informationMATLAB Constants, Variables & Expression. 9/12/2015 By: Nafees Ahmed
MATLAB Constants, Variables & Expression Introduction MATLAB can be used as a powerful programming language. It do have IF, WHILE, FOR lops similar to other programming languages. It has its own vocabulary
More informationOutline. Introduction Intel Vector Math Library (VML) o Features and performance VML in Finance Useful links
Outline Introduction Intel Vector Math Library (VML) o Features and performance VML in Finance Useful links 2 Introduction VML is one component of Intel MKL Support HPC applications: o o Scientific & engineering
More information3.9 Differentials. Tangent Line Approximations. Exploration. Using a Tangent Line Approximation
3.9 Differentials 3 3.9 Differentials Understand the concept of a tangent line approimation. Compare the value of the differential, d, with the actual change in,. Estimate a propagated error using a differential.
More informationIntroduction to Programming
Introduction to Programming session 9 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2010 These slides are created using Deitel s slides Sahrif University of Technology Outlines
More informationComputational Physics
Computational Physics Python Programming Basics Prof. Paul Eugenio Department of Physics Florida State University Jan 17, 2019 http://hadron.physics.fsu.edu/~eugenio/comphy/ Announcements Exercise 0 due
More informationSection 1.4 Limits involving infinity
Section. Limits involving infinit (/3/08) Overview: In later chapters we will need notation and terminolog to describe the behavior of functions in cases where the variable or the value of the function
More informationOpenGL R SC Version (Full Specification) (April 19, 2016) Editors (version 2.0): Aidan Fabius, Steve Viggers
OpenGL R SC Version 2.0.0 (Full Specification) (April 19, 2016) Editors (version 2.0): Aidan Fabius, Steve Viggers Copyright c 2016 The Khronos Group Inc. All Rights Reserved. This specification is protected
More informationFloating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754
Floating Point Puzzles Topics Lecture 3B Floating Point IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties For each of the following C expressions, either: Argue that
More informationFloating Point Puzzles. Lecture 3B Floating Point. IEEE Floating Point. Fractional Binary Numbers. Topics. IEEE Standard 754
Floating Point Puzzles Topics Lecture 3B Floating Point IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties For each of the following C expressions, either: Argue that
More informationBasic types and definitions. Chapter 3 of Thompson
Basic types and definitions Chapter 3 of Thompson Booleans [named after logician George Boole] Boolean values True and False are the result of tests are two numbers equal is one smaller than the other
More informationRequest for Quotations
Request for Quotations OpenCL 2.2 CTS September 2016 Notice ALL KHRONOS SPECIFICATIONS AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, MATERIALS ) ARE BEING PROVIDED AS IS. KHRONOS MAKES NO WARRANTIES, EXPRESSED,
More informationISO/IEC INTERNATIONAL STANDARD. Information technology Language independent arithmetic Part 2: Elementary numerical functions
INTERNATIONAL STANDARD ISO/IEC 10967-2 First edition 2001-08-15 Information technology Language independent arithmetic Part 2: Elementary numerical functions Technologies de l'information Arithmétique
More informationPackage cgraph. March 11, 2019
Type Package Title Computational Graphs Version 4.0.1 Author Maintainer URL https://cgraph.org/ Package cgraph March 11, 2019 BugReports https://github.com/triepels/cgraph/issues Allows
More information4.7 INVERSE TRIGONOMETRIC FUNCTIONS
Section 4.7 Inverse Trigonometric Functions 4 4.7 INVERSE TRIGONOMETRIC FUNCTIONS NASA What ou should learn Evaluate and graph the inverse sine function. Evaluate and graph the other inverse trigonometric
More informationIB SL REVIEW and PRACTICE
IB SL REVIEW and PRACTICE Topic: CALCULUS Here are sample problems that deal with calculus. You ma use the formula sheet for all problems. Chapters 16 in our Tet can help ou review. NO CALCULATOR Problems
More informationSystem Programming CISC 360. Floating Point September 16, 2008
System Programming CISC 360 Floating Point September 16, 2008 Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Powerpoint Lecture Notes for Computer Systems:
More information5-2 Verifying Trigonometric Identities
Verify each identity 1 (sec 1) cos = sin sec (1 cos ) = tan 3 sin sin cos 3 = sin 4 csc cos cot = sin 4 5 = cot Page 1 4 5 = cot 6 tan θ csc tan = cot 7 = cot 8 + = csc Page 8 = csc + 9 + tan = sec 10
More informationNAN propagation versus fault trapping in floating point code
NAN propagation versus fault trapping in floating point code By Agner Fog. Technical University of Denmark. Copyright 2018. Last updated 2018-05-24. Contents 1 Introduction... 1 2 Fault trapping... 1 3
More informationIntroduction to Scientific and Engineering Computing, BIL108E. Karaman
USING MATLAB INTRODUCTION TO SCIENTIFIC & ENGINEERING COMPUTING BIL 108E, CRN24023 To start from Windows, Double click the Matlab icon. To start from UNIX, Dr. S. Gökhan type matlab at the shell prompt.
More informationJulia Calculator ( Introduction)
Julia Calculator ( Introduction) Julia can replicate the basics of a calculator with the standard notations. Binary operators Symbol Example Addition + 2+2 = 4 Substraction 2*3 = 6 Multify * 3*3 = 9 Division
More information(Type your answer in radians. Round to the nearest hundredth as needed.)
1. Find the exact value of the following expression within the interval (Simplify your answer. Type an exact answer, using as needed. Use integers or fractions for any numbers in the expression. Type N
More informationFunction Example. Function Definition. C Programming. Syntax. A small program(subroutine) that performs a particular task. Modular programming design
What is a Function? C Programming Lecture 8-1 : Function (Basic) A small program(subroutine) that performs a particular task Input : parameter / argument Perform what? : function body Output t : return
More informationLab 7: Reading Files, Importing, Bigram Function. Ling 1330/2330: Computational Linguistics Na-Rae Han
Lab 7: Reading Files, Importing, Bigram Function Ling 1330/2330: Computational Linguistics Na-Rae Han Objectives Importing Reading text files range() Bigram function More sorting with sorted() sorted()
More informationFloating point. Today. IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time.
Floating point Today IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties Next time The machine model Fabián E. Bustamante, Spring 2010 IEEE Floating point Floating point
More informationChapter 2 Float Point Arithmetic. Real Numbers in Decimal Notation. Real Numbers in Decimal Notation
Chapter 2 Float Point Arithmetic Topics IEEE Floating Point Standard Fractional Binary Numbers Rounding Floating Point Operations Mathematical properties Real Numbers in Decimal Notation Representation
More informationISO/IEC INTERNATIONAL STANDARD
INTERNATIONAL STANDARD ISO/IEC 10967-3 First edition 2006-05-01 Information technology Language independent arithmetic Part 3: Complex integer and floating point arithmetic and complex elementary numerical
More informationFloating Point January 24, 2008
15-213 The course that gives CMU its Zip! Floating Point January 24, 2008 Topics IEEE Floating Point Standard Rounding Floating Point Operations Mathematical properties class04.ppt 15-213, S 08 Floating
More informationDM550/DM857 Introduction to Programming. Peter Schneider-Kamp
DM550/DM857 Introduction to Programming Peter Schneider-Kamp petersk@imada.sdu.dk http://imada.sdu.dk/~petersk/dm550/ http://imada.sdu.dk/~petersk/dm857/ Operator Precedence expressions are evaluated left-to-right
More informationFunctions and Recursion
Functions and Recursion 1 Outline Introduction Program Components in C++ Math Library Functions Functions Function Definitions Function Prototypes Header Files Random Number Generation Example: A Game
More informationEbooks Chemical Engineering
Uploaded by: Ebooks Chemical Engineering https://www.facebook.com/pages/ebooks-chemical-engineering/238197077030 For More Books, softwares & tutorials Related to Chemical Engineering Join Us @facebook:
More informationFinite arithmetic and error analysis
Finite arithmetic and error analysis Escuela de Ingeniería Informática de Oviedo (Dpto de Matemáticas-UniOvi) Numerical Computation Finite arithmetic and error analysis 1 / 45 Outline 1 Number representation:
More informationGiving credit where credit is due
CSCE 230J Computer Organization Floating Point Dr. Steve Goddard goddard@cse.unl.edu http://cse.unl.edu/~goddard/courses/csce230j Giving credit where credit is due Most of slides for this lecture are based
More information2.2 Absolute Value Functions
. Absolute Value Functions 7. Absolute Value Functions There are a few was to describe what is meant b the absolute value of a real number. You ma have been taught that is the distance from the real number
More information4.1 Angles and Angle Measure. 1, multiply by
4.1 Angles and Angle Measure Angles can be measured in degrees or radians. Angle measures without units are considered to be in radians. Radian: One radian is the measure of the central angle subtended
More informationPOLYMATH POLYMATH. for IBM and Compatible Personal Computers. for IBM and Compatible Personal Computers
POLYMATH VERSION 4.1 Provides System Printing from Windows 3.X, 95, 98 and NT USER-FRIENDLY NUMERICAL ANALYSIS PROGRAMS - SIMULTANEOUS DIFFERENTIAL EQUATIONS - SIMULTANEOUS ALGEBRAIC EQUATIONS - SIMULTANEOUS
More informationGiving credit where credit is due
JDEP 284H Foundations of Computer Systems Floating Point Dr. Steve Goddard goddard@cse.unl.edu Giving credit where credit is due Most of slides for this lecture are based on slides created by Drs. Bryant
More informationCSCI 402: Computer Architectures. Arithmetic for Computers (3) Fengguang Song Department of Computer & Information Science IUPUI.
CSCI 402: Computer Architectures Arithmetic for Computers (3) Fengguang Song Department of Computer & Information Science IUPUI 3.5 Today s Contents Floating point numbers: 2.5, 10.1, 100.2, etc.. How
More informationMatlab Workshop I. Niloufer Mackey and Lixin Shen
Matlab Workshop I Niloufer Mackey and Lixin Shen Western Michigan University/ Syracuse University Email: nil.mackey@wmich.edu, lshen03@syr.edu@wmich.edu p.1/13 What is Matlab? Matlab is a commercial Matrix
More informationGeneral MATLAB Information 1
Introduction to MATLAB General MATLAB Information 1 Once you initiate the MATLAB software, you will see the MATLAB logo appear and then the MATLAB prompt >>. The prompt >> indicates that MATLAB is awaiting
More informationGREENWOOD PUBLIC SCHOOL DISTRICT Algebra III Pacing Guide FIRST NINE WEEKS
GREENWOOD PUBLIC SCHOOL DISTRICT Algebra III FIRST NINE WEEKS Framework/ 1 Aug. 6 10 5 1 Sequences Express sequences and series using recursive and explicit formulas. 2 Aug. 13 17 5 1 Sequences Express
More informationTEST AND TEST ANSWER KEYS
PART II TEST AND TEST ANSWER KEYS Houghton Mifflin Compan. All rights reserved. Test Bank.................................................... 6 Chapter P Preparation for Calculus............................
More informationFloating-Point Mathematical Co-Processor for a Single-Chip On-Board Computer
Floating-Point Mathematical Co-Processor for a Single-Chip On-Board Computer Tana Vladimirova, David Eame, Sven Keller and Prof Sir Martin Sweeting Surre Space Centre School of Electronics and Phsical
More information