MPSCoreTypes.h(3) MetalPerformanceShaders.framework MPSCoreTypes.h(3)
NAME
MPSCoreTypes.h
SYNOPSIS
#import <Foundation/NSObject.h>
#import <Metal/Metal.h>
Classes
struct MPSOffset
struct MPSOrigin
struct MPSSize
struct MPSRegion
struct MPSScaleTransform
protocol <MPSDeviceProvider>
Macros
#define __has_attribute(a) 0
#define __has_feature(f) 0
#define __has_extension(e) 0
#define MPS_HIDE_AVAILABILITY 1
#define MPS_ENUM_AVAILABLE_STARTING(...)
#define MPS_ENUM_AVAILABLE_STARTING_BUT_DEPRECATED(...)
#define MPS_CLASS_AVAILABLE_STARTING(...)
#define MPS_AVAILABLE_STARTING(...)
#define MPS_AVAILABLE_STARTING_BUT_DEPRECATED(...)
#define MPS_SWIFT_NAME(...)
Typedefs
typedef enum MPSImageEdgeMode MPSImageEdgeMode
typedef enum MPSImageFeatureChannelFormat MPSImageFeatureChannelFormat
typedef enum MPSDataType MPSDataType
typedef struct MPSOrigin MPSOrigin
typedef struct MPSSize MPSSize
typedef struct MPSRegion MPSRegion
typedef struct MPSScaleTransform MPSScaleTransform
Enumerations
enum MPSKernelOptions { MPSKernelOptionsNone,
MPSKernelOptionsSkipAPIValidation,
MPSKernelOptionsAllowReducedPrecision,
MPSKernelOptionsDisableInternalTiling,
MPSKernelOptionsInsertDebugGroups, MPSKernelOptionsVerbose }
enum MPSImageEdgeMode { MPSImageEdgeModeZero, MPSImageEdgeModeClamp }
enum MPSImageFeatureChannelFormat { MPSImageFeatureChannelFormatNone,
MPSImageFeatureChannelFormatUnorm8,
MPSImageFeatureChannelFormatUnorm16,
MPSImageFeatureChannelFormatFloat16,
MPSImageFeatureChannelFormatFloat32 }
enum MPSDataType { MPSDataTypeInvalid, MPSDataTypeFloatBit,
MPSDataTypeFloat32, MPSDataTypeFloat16, MPSDataTypeSignedBit,
DEPRECATED_ATTRIBUTE = MPSDataTypeSignedBit, MPSDataTypeInt8,
MPSDataTypeInt16, MPSDataTypeUInt8, MPSDataTypeUInt16,
MPSDataTypeUInt32, MPSDataTypeNormalizedBit, MPSDataTypeUnorm1,
MPSDataTypeUnorm8 }
Macro Definition Documentation
#define __has_attribute(a) 0
MPSTypes.h MPSCore
Copyright:
Copyright (c) 2017 Apple Inc. All rights reserved. Types common to
MetalPerformanceShaders.framework
#define __has_extension(e) 0
#define __has_feature(f) 0
#define MPS_AVAILABLE_STARTING( ...)
#define MPS_AVAILABLE_STARTING_BUT_DEPRECATED( ...)
#define MPS_CLASS_AVAILABLE_STARTING( ...)
#define MPS_ENUM_AVAILABLE_STARTING( ...)
#define MPS_ENUM_AVAILABLE_STARTING_BUT_DEPRECATED( ...)
#define MPS_HIDE_AVAILABILITY 1
#define MPS_SWIFT_NAME( ...)
Typedef Documentation
typedef enum MPSDataType
MPSDataType"
typedef enum MPSImageEdgeMode
MPSImageEdgeMode"
typedef enum MPSImageFeatureChannelFormat
MPSImageFeatureChannelFormat"
typedef struct MPSOrigin MPSOrigin
typedef struct MPSRegion MPSRegion
typedef struct MPSScaleTransform MPSScaleTransform
typedef struct MPSSize MPSSize
Enumeration Type Documentation
enum MPSDataType
A value to specify a type of data.
MPSDataTypeFloatBit A common bit for all floating point data types.
Zero for integer types MPSDataTypeNormalizedBit If set, the value of
the shall be interpreted as value / UNORM_TYPE_MAX Normalized values
have range [0, 1.0] if unsigned and [-1,1] if signed. SNORM_TYPE_MIN is
interpreted as SNORM_TYPE_MIN+1 per standard Metal rules.
MSPDataTypeFloat32 32-bit floating point (single-precision).
MSPDataTypeFloat16 16-bit floating point (half-precision).
(IEEE-754-2008 float16 exchange format) MPSDataTypeInt8 Signed 8-bit
integer. MPSDataTypeInt16 Signed 16-bit integer. MPSDataTypeUInt8
Unsigned 8-bit integer. Not normalized MPSDataTypeUInt16 Unsigned
16-bit integer. Not normalized MPSDataTypeUInt32 Unsigned 32-bit
integer. Not normalized MPSDataTypeUnorm1 Unsigned 1-bit normalized
value. MPSDataTypeUnorm8 Unsigned 8-bit normalized value.
Enumerator
MPSDataTypeInvalid
MPSDataTypeFloatBit
MPSDataTypeFloat32
MPSDataTypeFloat16
MPSDataTypeSignedBit
DEPRECATED_ATTRIBUTE
MPSDataTypeInt8
MPSDataTypeInt16
MPSDataTypeUInt8
MPSDataTypeUInt16
MPSDataTypeUInt32
MPSDataTypeNormalizedBit
MPSDataTypeUnorm1
MPSDataTypeUnorm8
enum MPSImageEdgeMode
Options used to control edge behaviour of filter when filter reads
beyond boundary of src image
Enumerator
MPSImageEdgeModeZero
Out of bound pixels are (0,0,0,1) for image with pixel format
without alpha channel and (0,0,0,0) for image with pixel format
that has an alpha channel
MPSImageEdgeModeClamp
Out of bound pixels are clamped to nearest edge pixel
enum MPSImageFeatureChannelFormat
Encodes the representation of a single channel within a MPSImage. A
MPSImage pixel may have many channels in it, sometimes many more than
4, the limit of what MTLPixelFormats encode. The storage format for a
single channel within a pixel can be given by the
MPSImageFeatureChannelFormat. The number of channels is given by the
featureChannels parameter of appropriate MPSImage APIs. The size of the
pixel is size of the channel format multiplied by the number of feature
channels. No padding is allowed, except to round out to a full byte.
Enumerator
MPSImageFeatureChannelFormatNone
No format. This can mean according to context invalid format or
any format. In the latter case, it is an invitation to MPS to
pick a format.
MPSImageFeatureChannelFormatUnorm8
uint8_t with value [0,255] encoding [0,1.0]
MPSImageFeatureChannelFormatUnorm16
uint16_t with value [0,65535] encoding [0,1.0]
MPSImageFeatureChannelFormatFloat16
IEEE-754 16-bit floating-point value. 'half precision'
Representable normal range is +-[2**-14, 65504], 0, Infinity,
NaN. 11 bits of precision + exponent.
MPSImageFeatureChannelFormatFloat32
IEEE-754 32-bit floating-point value. 'single precision'
(standard float type in C) 24 bits of precision + exponent
enum MPSKernelOptions
Options used when creating MPSKernel objects
Enumerator
MPSKernelOptionsNone
Use default options
MPSKernelOptionsSkipAPIValidation
Most MPS functions will sanity check their arguments. This has a
small but non-zero CPU cost. Setting the
MPSKernelOptionsSkipAPIValidation will skip these checks.
MPSKernelOptionsSkipAPIValidation does not skip checks for
memory allocation failure. Caution: turning on
MPSKernelOptionsSkipAPIValidation can result in undefined
behavior if the requested operation can not be completed for
some reason. Most error states will be passed through to Metal
which may do nothing or abort the program if Metal API
validation is turned on.
MPSKernelOptionsAllowReducedPrecision
When possible, MPSKernels use a higher precision data
representation internally than the destination storage format to
avoid excessive accumulation of computational rounding error in
the result. MPSKernelOptionsAllowReducedPrecision advises the
MPSKernel that the destination storage format already has too
much precision for what is ultimately required downstream, and
the MPSKernel may use reduced precision internally when it feels
that a less precise result would yield better performance. The
expected performance win is often small, perhaps 0-20%. When
enabled, the precision of the result may vary by hardware and
operating system.
MPSKernelOptionsDisableInternalTiling
Some MPSKernels may automatically split up the work internally
into multiple tiles. This improves performance on larger
textures and reduces the amount of memory needed by MPS for
temporary storage. However, if you are using your own tiling
scheme to achieve similar results, your tile sizes and MPS's
choice of tile sizes may interfere with one another causing MPS
to subdivide your tiles for its own use inefficiently. Pass
MPSKernelOptionsDisableInternalTiling to force MPS to process
your data tile as a single chunk.
MPSKernelOptionsInsertDebugGroups
Enabling this bit will cause various -encode... methods to call
MTLCommandEncoder push/popDebugGroup. The debug string will be
drawn from MPSKernel.label, if any or the name of the class
otherwise.
MPSKernelOptionsVerbose
Some parts of MPS can provide debug commentary and tuning advice
when run. Setting this bit to 1 will cause the commentary to be
emitted to stderr. Otherwise, the code is silent. This is
especially useful for debugging MPSNNGraph. This option is on by
default when the MPS_LOG_INFO environment variable is defined.
For even more detailed output on a MPS object, you can use the
po command in llvm with MPS objects:
llvm> po <MPS object pointer>
Author
Generated automatically by Doxygen for
MetalPerformanceShaders.framework from the source code.
Version MetalPerformanceShaders-Thu2Jul 13 2017 MPSCoreTypes.h(3)
Mac OS X 10.12.6 - Generated Mon Oct 30 15:38:39 CDT 2017