I am studying Apple Metal , trying to do some GPU computing.
I checked the matrix multiplication example given by Apple. I can’t understand there.
In the file MetalMatrixMult.h
// Number of rows in matrices A and C. @property (nonatomic) uint16_t m; // Number of columns in matrix A; number of rows in matrix B. @property (nonatomic) uint16_t n; // Number of columns in matrices B and C. @property (nonatomic) uint16_t k; // Output matrix (padded) C row count @property (nonatomic, readonly) uint16_t M; // Output matrix (padded) C column count @property (nonatomic, readonly) uint16_t K; // Output matrix C = A x B @property (nonatomic, readonly) float* output;
It says that matrix C is full. I do not quite understand what it means pad. Is this some kind of alignment? The reason I know there is a type specification in the shader language specification, but I don't know why we need to impose a buffer herer.
pad
Thank.
. , ( ), . GPU, .
, 3 (A, B C) , , "" . , C , 8 x 8 : Threadgroup 1 , . Threadgroup 1 8 A 8 B C. , Threadgroup 1, .
A
B
C
, , , C . 12 x 18, - 8 x 8, , C 1,5 x 2,25 . , - 2 x 3 16 x 24 . .
Source: https://habr.com/ru/post/1673436/More articles:Display onChange error messages in redux-form - reactjsHow to create a two-dimensional array in Haskell? - multidimensional-arrayBackground outside the bottom border of CSS - htmlИзвлечение полей из форм с различной структурой - pythonOverridden types with std :: aligned_storage - c ++Reasonably remove points in Python list - pythonElasticSearch - Depth gain in recursive structure - spring-bootCan I preload multiple streams with Exoplayer and play multiple videos at the same time? - androidCall cover symbol in all languages in application - jsonLocalDate in form - javaAll Articles