[PYTHON] Fixed formatting issue in conv.c
This commit is contained in:
committed by
Philippe Tillet
parent
5ba5a77561
commit
167a2e4b1a
@@ -11,7 +11,8 @@ __global__ void conv(TYPE *A __noalias __readonly,
|
|||||||
// memory strides
|
// memory strides
|
||||||
int lda_z, int lda_ci, int lda_h, int lda_w,
|
int lda_z, int lda_ci, int lda_h, int lda_w,
|
||||||
int ldb_ci, int ldb_r, int ldb_s, int ldb_co,
|
int ldb_ci, int ldb_r, int ldb_s, int ldb_co,
|
||||||
int ldc_z, int ldc_co, int ldc_p, int ldc_q) {
|
int ldc_z, int ldc_co, int ldc_p, int ldc_q)
|
||||||
|
{
|
||||||
// prologue
|
// prologue
|
||||||
int ridx = get_program_id(0);
|
int ridx = get_program_id(0);
|
||||||
int ridy = get_program_id(1);
|
int ridy = get_program_id(1);
|
||||||
@@ -47,19 +48,13 @@ __global__ void conv(TYPE *A __noalias __readonly,
|
|||||||
int rw[TM, TK] = rw_0[:, newaxis] + rs [newaxis, :];
|
int rw[TM, TK] = rw_0[:, newaxis] + rs [newaxis, :];
|
||||||
|
|
||||||
// pointers to lhs
|
// pointers to lhs
|
||||||
int offa[TM, TK] = rz[:, newaxis] * lda_z +
|
int offa[TM, TK] = rz[:, newaxis] * lda_z + rci [newaxis, :] * lda_ci +
|
||||||
rci [newaxis, :] * lda_ci +
|
rh * lda_h + rw * 1;
|
||||||
rh * lda_h +
|
|
||||||
rw * 1;
|
|
||||||
TYPE *pa[TM, TK] = A + offa;
|
TYPE *pa[TM, TK] = A + offa;
|
||||||
int *padelta[TK] = ADELTA + rk;
|
int *padelta[TK] = ADELTA + rk;
|
||||||
// pointers to rhs
|
// pointers to rhs
|
||||||
int offb[TK, TN] = rci[:, newaxis] * ldb_ci +
|
int offb[TK, TN] = rci[:, newaxis] * ldb_ci + rr[:, newaxis] * ldb_r +
|
||||||
rr
|
rs[:, newaxis] * ldb_s + rn [newaxis, :] * 1;
|
||||||
[:, newaxis] * ldb_r +
|
|
||||||
rs
|
|
||||||
[:, newaxis] * ldb_s +
|
|
||||||
rn [newaxis, :] * 1;
|
|
||||||
TYPE *pb[TK, TN] = B + offb;
|
TYPE *pb[TK, TN] = B + offb;
|
||||||
|
|
||||||
// prefetches operands
|
// prefetches operands
|
||||||
@@ -72,7 +67,8 @@ __global__ void conv(TYPE *A __noalias __readonly,
|
|||||||
|
|
||||||
// reduction loop
|
// reduction loop
|
||||||
float acc[TM, TN] = 0;
|
float acc[TM, TN] = 0;
|
||||||
for (int k = K; k > 0; k -= TK) {
|
for (int k = K; k > 0; k -= TK)
|
||||||
|
{
|
||||||
acc += a @b;
|
acc += a @b;
|
||||||
// increment A
|
// increment A
|
||||||
int adelta[TK] = *padelta;
|
int adelta[TK] = *padelta;
|
||||||
@@ -103,12 +99,8 @@ __global__ void conv(TYPE *A __noalias __readonly,
|
|||||||
rzp = rm / QQ;
|
rzp = rm / QQ;
|
||||||
rp = rzp % PP;
|
rp = rzp % PP;
|
||||||
rz = rzp / PP;
|
rz = rzp / PP;
|
||||||
int offc[TM, TN] = rz[:, newaxis] * ldc_z +
|
int offc[TM, TN] = rz[:, newaxis] * ldc_z + rn [newaxis, :] * ldc_co +
|
||||||
rn [newaxis, :] * ldc_co +
|
rp[:, newaxis] * ldc_p + rq[:, newaxis] * 1;
|
||||||
rp
|
|
||||||
[:, newaxis] * ldc_p +
|
|
||||||
rq
|
|
||||||
[:, newaxis] * 1;
|
|
||||||
TYPE *pc[TM, TN] = C + offc;
|
TYPE *pc[TM, TN] = C + offc;
|
||||||
bool checkc[TM, TN] = rm[:, newaxis] < M && rn [newaxis, :] < N;
|
bool checkc[TM, TN] = rm[:, newaxis] < M && rn [newaxis, :] < N;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user