Skip to content

Add gemm with stride arguments#4238

Merged
guoshengCS merged 1 commit intoPaddlePaddle:developfrom
guoshengCS:add-gemm-with-step
Sep 25, 2017
Merged

Add gemm with stride arguments#4238
guoshengCS merged 1 commit intoPaddlePaddle:developfrom
guoshengCS:add-gemm-with-step

Conversation

@guoshengCS
Copy link
Contributor

Resolves #4159

const int ldc) {
cblas_sgemm(CblasRowMajor, transA == false ? CblasNoTrans : CblasTrans,
transB == false ? CblasNoTrans : CblasTrans, M, N, K, alpha, A,
lda, B, ldb, beta, C, ldc);
Copy link
Contributor

Choose a reason for hiding this comment

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

我觉得可以删掉line 22的gemm,没有必要保留两个接口

Copy link
Contributor Author

Choose a reason for hiding this comment

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

辛苦review~ 感觉可能还是原先line 22中的接口用的多些,不过感觉可以把原先接口中CBLAS_TRANSPOSE类型的参数改成bool类型,另外有看到目前Paddle中提供了带stride不带stride的两种接口。或者使用默认参数可以么,怎样会好些呢

Copy link
Contributor

Choose a reason for hiding this comment

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

那保留两个接口吧~

double* C, const int ldc) {
cblas_dgemm(CblasRowMajor, transA == false ? CblasNoTrans : CblasTrans,
transB == false ? CblasNoTrans : CblasTrans, M, N, K, alpha, A,
lda, B, ldb, beta, C, ldc);
Copy link
Contributor

Choose a reason for hiding this comment

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

同理,可以删掉line 37的gemm

PADDLE_ENFORCE(platform::dynload::cublasDgemm(
reinterpret_cast<const platform::CUDADeviceContext&>(context)
.cublas_handle(),
cuTransB, cuTransA, N, M, K, &alpha, B, ldb, A, lda, &beta, C, ldc));
Copy link
Contributor

Choose a reason for hiding this comment

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

同上~

@guoshengCS guoshengCS merged commit e114aad into PaddlePaddle:develop Sep 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants