Skip to content

Conversation

@reyoung
Copy link
Collaborator

@reyoung reyoung commented May 2, 2018

Clean blas GEMM implementation. Reduce all copy & paste code in GEMM.

@reyoung reyoung requested a review from chengduoZH May 2, 2018 03:59
const half *h_B = reinterpret_cast<const half *>(B);
half *h_C = reinterpret_cast<half *>(C);

CUBlas<platform::float16>(context_.cublas_handle(), cuTransB, cuTransA, N, M,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CUBlas<platform::float16> ==>CUBlas<platform::float16>::GEMM

chengduoZH
chengduoZH previously approved these changes May 2, 2018
Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

context, false, false, m, n, k, paddle::platform::float16(1), a, 3, b + 1,
4, paddle::platform::float16(1), c + 1, 4);
GetBlas<float16>(context).GEMM(false, false, m, n, k, float16(1), a, 3, b + 1,
4, float16(1), c + 1, 4);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float16 => paddle::platform::float16

Copy link
Contributor

@chengduoZH chengduoZH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent

@reyoung reyoung merged commit 2abcf37 into PaddlePaddle:develop May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants