diff options
author | Hieu Hoang <hihoan@microsoft.com> | 2021-06-29 07:26:27 +0300 |
---|---|---|
committer | Hieu Hoang <hihoan@microsoft.com> | 2021-06-29 07:26:27 +0300 |
commit | 7e2fce8f09ce00cebf7ff11dedc8fe9c3e886e7f (patch) | |
tree | 7bb2795647d8f9f9836a39e2119714d72e00257b /src | |
parent | 24c644bae0312a5b640b2cda43020fd4b74cdb07 (diff) | |
parent | 8daa0a42559a9bf3e8bed171423b9e1b08c7e000 (diff) |
Merge branch 'hihoan/lsh7' of vs-ssh.visualstudio.com:v3/machinetranslation/Marian/marian-dev into hihoan/lsh7
Diffstat (limited to 'src')
-rwxr-xr-x | src/tensors/cpu/prod.cpp | 34 | ||||
-rwxr-xr-x | src/tensors/gpu/prod.cpp | 22 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/tensors/cpu/prod.cpp b/src/tensors/cpu/prod.cpp index 313e6fbd..8fcca924 100755 --- a/src/tensors/cpu/prod.cpp +++ b/src/tensors/cpu/prod.cpp @@ -117,28 +117,28 @@ void ProdBatched(marian::Tensor C, } cShapeMeta = Shape::broadcast({aShapeMeta, bShapeMeta}); - size_t m = aShape[-2]; - size_t k = aShape[-1]; + int m = aShape[-2]; + int k = aShape[-1]; if(transA) std::swap(m, k); - size_t l = bShape[-2]; - size_t n = bShape[-1]; + int l = bShape[-2]; + int n = bShape[-1]; if(transB) std::swap(l, n); - size_t lda = aShape[-1]; - size_t ldb = bShape[-1]; - size_t ldc = bShape[-1]; + int lda = aShape[-1]; + int ldb = bShape[-1]; + int ldc = bShape[-1]; if(transB) ldc = bShape[-2]; - auto strideA = m * k; - auto strideB = n * k; - auto strideC = n * m; + int strideA = m * k; + int strideB = n * k; + int strideC = n * m; - auto batchC = cShapeMeta.elements(); + int batchC = cShapeMeta.elements(); // Convert to functional shapes to be able to map dimensions. @TODO merge this functional::Shape aShapeMetaF = aShapeMeta; @@ -218,17 +218,17 @@ void ProdBatched(marian::Tensor C, sgemm(transA, transB, - (int)m, - (int)n, - (int)k, + m, + n, + k, alpha, A->data() + aIndex * strideA, - (int)lda, + lda, B->data() + bIndex * strideB, - (int)ldb, + ldb, beta, C->data() + i * strideC, - (int)ldc); + ldc); } #endif #else diff --git a/src/tensors/gpu/prod.cpp b/src/tensors/gpu/prod.cpp index e996f58f..bf0d2395 100755 --- a/src/tensors/gpu/prod.cpp +++ b/src/tensors/gpu/prod.cpp @@ -371,19 +371,19 @@ void ProdBatchedTyped(marian::Tensor C, } cShapeMeta = Shape::broadcast({aShapeMeta, bShapeMeta}); - size_t m = aShape[-2]; - size_t k = aShape[-1]; + int m = aShape[-2]; + int k = aShape[-1]; if(transA) std::swap(m, k); - size_t l = bShape[-2]; - size_t n = bShape[-1]; + int l = bShape[-2]; + int n = bShape[-1]; if(transB) std::swap(l, n); - size_t lda = aShape[-1]; - size_t ldb = bShape[-1]; - size_t ldc = bShape[-1]; + int lda = aShape[-1]; + int ldb = bShape[-1]; + int ldc = bShape[-1]; if(transB) ldc = bShape[-2]; @@ -395,11 +395,11 @@ void ProdBatchedTyped(marian::Tensor C, auto cublasHandle = backend->getCublasHandle(); auto compute = backend->getCudaComputeCapability(); - auto strideA = m * k; - auto strideB = n * k; - auto strideC = n * m; + int strideA = m * k; + int strideB = n * k; + int strideC = n * m; - auto batchC = cShapeMeta.elements(); + int batchC = cShapeMeta.elements(); // Convert to functional shapes to be able to map dimensions. @TODO merge this functional::Shape aShapeMetaF = aShapeMeta; |