Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/marian.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2018-01-16 14:18:00 +0300
committerHieu Hoang <hieuhoang@gmail.com>2018-01-16 14:18:00 +0300
commit8cd291bf30f35887157b9b13327debb63f9025df (patch)
tree61cf504a4aca7ec295e7722186116c638956925f
parent9657479bbfa6a1e4dbf5e51135528ad0671551fd (diff)
delete colMajor arg. Not used anymore
-rw-r--r--src/amun/gpu/mblas/matrix_wrapper.h34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/amun/gpu/mblas/matrix_wrapper.h b/src/amun/gpu/mblas/matrix_wrapper.h
index ab2c6ac0..aecb5729 100644
--- a/src/amun/gpu/mblas/matrix_wrapper.h
+++ b/src/amun/gpu/mblas/matrix_wrapper.h
@@ -21,37 +21,25 @@ public:
dataConst_ = nullptr;
}
- MatrixWrapper(const TMatrix<T> &matrix, bool colMajor = true)
+ MatrixWrapper(const TMatrix<T> &matrix)
{
dim_[0] = matrix.dim(0);
dim_[1] = matrix.dim(1);
dim_[2] = matrix.dim(2);
dim_[3] = matrix.dim(3);
-
- if (colMajor) {
- updateStrides();
- }
- else {
- updateStridesRowMajor();
- }
+ updateStrides();
data_ = nullptr;
dataConst_ = matrix.data();
}
- MatrixWrapper(TMatrix<T> &matrix, bool colMajor = true)
+ MatrixWrapper(TMatrix<T> &matrix)
{
dim_[0] = matrix.dim(0);
dim_[1] = matrix.dim(1);
dim_[2] = matrix.dim(2);
dim_[3] = matrix.dim(3);
-
- if (colMajor) {
- updateStrides();
- }
- else {
- updateStridesRowMajor();
- }
+ updateStrides();
data_ = matrix.data();
dataConst_ = data_;
@@ -64,6 +52,9 @@ public:
dim_[2] = c;
dim_[3] = d;
updateStrides();
+
+ data_ = nullptr;
+ dataConst_ = nullptr;
}
__device__
@@ -106,17 +97,6 @@ public:
size_ = stride_[3] * dim_[3];
}
- __device__ __host__
- void updateStridesRowMajor()
- {
- stride_[0] = 1;
- stride_[1] = dim_[0];
- stride_[2] = dim_[0] * dim_[1];
- stride_[3] = dim_[0] * dim_[1] * dim_[2];
-
- size_ = stride_[3] * dim_[3];
- }
-
__device__
T* data()
{