Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NiuTrans.Tensor
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
Emmay
NiuTrans.Tensor
Commits
a027f72e
Commit
a027f72e
authored
Jul 27, 2018
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better code of MatrixMul batched
parent
5c0d8bfd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
31 行增加
和
399 行删除
+31
-399
source/tensor/XUtility.cpp
+8
-4
source/tensor/core/CHeader.h
+0
-1
source/tensor/core/arithmetic/MatrixMULBatchedCPU.cpp
+0
-86
source/tensor/core/arithmetic/MatrixMULBatchedCPU.h
+0
-36
source/tensor/core/arithmetic/MatrixMul.cpp
+4
-4
source/tensor/core/arithmetic/MatrixMulBatched.cpp
+0
-0
source/tensor/core/arithmetic/MatrixMulBatched.h
+15
-1
source/tensor/core/shape/Split.cpp
+4
-4
source/tensor/test/TMatrixMULBatchedCPU.cpp
+0
-227
source/tensor/test/TMatrixMULBatchedCPU.h
+0
-34
source/tensor/test/Test.cpp
+0
-1
source/tensor/test/Test.h
+0
-1
没有找到文件。
source/tensor/XUtility.cpp
查看文件 @
a027f72e
...
...
@@ -262,12 +262,16 @@ void XMemCopy2D(void * t, size_t tPitch, int devIDT, const void * s, size_t sPit
}
#ifdef USE_CUDA
else
if
(
devIDT
>=
0
&&
devIDS
<
0
)
{
CheckNTErrors
((
cudaMemcpy2D
(
t
,
tPitch
,
s
,
sPitch
,
mSize
,
n
,
cudaMemcpyHostToDevice
)
==
cudaSuccess
),
"cudaMemcpy2D error (cudaMemcpyHostToDevice)"
);
cudaError_t
error
=
cudaMemcpy2D
(
t
,
tPitch
,
s
,
sPitch
,
mSize
,
n
,
cudaMemcpyHostToDevice
);
if
(
error
!=
cudaSuccess
){
ShowNTErrors
(
"cudaMemcpy2D error (cudaMemcpyHostToDevice)"
);
}
}
else
if
(
devIDT
<
0
&&
devIDS
>=
0
)
{
CheckNTErrors
((
cudaMemcpy2D
(
t
,
tPitch
,
s
,
sPitch
,
mSize
,
n
,
cudaMemcpyDeviceToHost
)
==
cudaSuccess
),
"cudaMemcpy error (cudaMemcpyDeviceToHost)"
);
cudaError_t
error
=
cudaMemcpy2D
(
t
,
tPitch
,
s
,
sPitch
,
mSize
,
n
,
cudaMemcpyDeviceToHost
);
if
(
error
!=
cudaSuccess
){
ShowNTErrors
(
"cudaMemcpy error (cudaMemcpyDeviceToHost)"
);
}
}
else
{
cudaError_t
error
=
cudaMemcpy2D
(
t
,
tPitch
,
s
,
sPitch
,
mSize
,
n
,
cudaMemcpyDeviceToDevice
);
...
...
source/tensor/core/CHeader.h
查看文件 @
a027f72e
...
...
@@ -43,7 +43,6 @@
#include "arithmetic/MatrixMul2DMultiTheading.h"
#include "arithmetic/MatrixMul2DParallel.h"
#include "arithmetic/MatrixMulBatched.h"
#include "arithmetic/MatrixMULBatchedCPU.h"
#include "shape/Merge.h"
#include "shape/MergeBlockLists.h"
#include "arithmetic/Multiply.h"
...
...
source/tensor/core/arithmetic/MatrixMULBatchedCPU.cpp
deleted
100644 → 0
查看文件 @
5c0d8bfd
/* NiuTrans.Tensor - an open-source tensor library
* Copyright (C) 2017, Natural Language Processing Lab, Northestern University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Created by: XIAO Tong (email: xiaotong@mail.neu.edu.cn) 2018-04-24
*/
#include "../../XTensor.h"
#include "MatrixMULBatchedCPU.h"
#include "MatrixMul2D.h"
#include "XTensorBLAS.h"
namespace
nts
{
// namespace nts(NiuTrans.Tensor)
/*
matrix multiplication in batch mode (BLAS)
c_i = trans(a_i) * trans(b_i) * \alpha + c_i * \beta for each i in [0,count-1]
>> a - list of input matrices (2d tensors)
>> transposedA - indicate whether the matrix a is transposed
>> b - another list of input matrices (2d tensors)
>> transposedB - indicate whether the matrix b is transposed
>> c - output matrix (2d tensor)
>> alpha - scalar
>> beta - scalar
*/
void
_MatrixMULBatchedCPU
(
const
XList
*
a
,
MATRIX_TRANS_TYPE
transposedA
,
const
XList
*
b
,
MATRIX_TRANS_TYPE
transposedB
,
XList
*
c
,
DTYPE
alpha
,
DTYPE
beta
)
{
CheckNTErrors
(
a
&&
b
&&
c
,
"Empty input lists!"
);
CheckNTErrors
(
a
->
count
==
b
->
count
&&
a
->
count
==
c
->
count
,
"Input lists must be of the same size!"
);
if
(
a
->
count
==
0
)
return
;
bool
isUniform
=
true
;
for
(
int
i
=
1
;
i
<
a
->
count
;
i
++
)
{
XTensor
*
aim
=
(
XTensor
*
)
a
->
GetItem
(
i
-
1
);
XTensor
*
bim
=
(
XTensor
*
)
b
->
GetItem
(
i
-
1
);
XTensor
*
cim
=
(
XTensor
*
)
c
->
GetItem
(
i
-
1
);
XTensor
*
ai
=
(
XTensor
*
)
a
->
GetItem
(
i
);
XTensor
*
bi
=
(
XTensor
*
)
b
->
GetItem
(
i
);
XTensor
*
ci
=
(
XTensor
*
)
c
->
GetItem
(
i
);
if
(
!
XTensor
::
IsSameShaped
(
aim
,
ai
)
||
!
XTensor
::
IsSameShaped
(
bim
,
bi
)
||
!
XTensor
::
IsSameShaped
(
cim
,
ci
))
{
isUniform
=
false
;
break
;
}
}
for
(
int
i
=
0
;
i
<
a
->
count
;
i
++
)
{
XTensor
*
ai
=
(
XTensor
*
)
a
->
GetItem
(
i
);
XTensor
*
bi
=
(
XTensor
*
)
b
->
GetItem
(
i
);
XTensor
*
ci
=
(
XTensor
*
)
c
->
GetItem
(
i
);
CheckNTErrors
((
ai
->
order
==
2
),
"2d tensor (i.e., matrix) is required!"
);
CheckNTErrors
((
bi
->
order
==
2
),
"2d tensor (i.e., matrix) is required!"
);
CheckNTErrors
((
ci
->
order
==
2
),
"2d tensor (i.e., matrix) is required!"
);
#ifdef USE_BLAS
if
(
useBLAS
)
_MatrixMULCPU
(
ai
,
transposedA
,
bi
,
transposedB
,
ci
,
alpha
,
beta
);
else
_MatrixMul2D
(
ai
,
transposedA
,
bi
,
transposedB
,
ci
,
alpha
,
beta
);
#else
_MatrixMul2D
(
ai
,
transposedA
,
bi
,
transposedB
,
ci
,
alpha
,
beta
);
#endif
}
//}
}
}
//
namespace
nts
(
NiuTrans
.
Tensor
)
\ No newline at end of file
source/tensor/core/arithmetic/MatrixMULBatchedCPU.h
deleted
100644 → 0
查看文件 @
5c0d8bfd
/* NiuTrans.Tensor - an open-source tensor library
* Copyright (C) 2017, Natural Language Processing Lab, Northestern University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Created by: XIAO Tong (email: xiaotong@mail.neu.edu.cn) 2018-04-24
*/
#ifndef __MATRIXMULBATCHEDCPU_H__
#define __MATRIXMULBATCHEDCPU_H__
#include "../../XTensor.h"
namespace
nts
{
// namespace nts(NiuTrans.Tensor)
/* matrix multiplication in batch mode (CPU code) */
void
_MatrixMULBatchedCPU
(
const
XList
*
a
,
MATRIX_TRANS_TYPE
transposedA
,
const
XList
*
b
,
MATRIX_TRANS_TYPE
transposedB
,
XList
*
c
,
DTYPE
alpha
=
(
DTYPE
)
1
.
0
,
DTYPE
beta
=
0
);
}
// namespace nts(NiuTrans.Tensor)
#endif // __MATRIXMULBATCHEDCPU_H__
\ No newline at end of file
source/tensor/core/arithmetic/MatrixMul.cpp
查看文件 @
a027f72e
...
...
@@ -24,8 +24,8 @@
#include "../../XName.h"
#include "MatrixMul.h"
#include "MatrixMul2D.h"
#include "MatrixMULBatchedCPU.h"
#include "XTensorBLAS.h"
#include "MatrixMulBatched.h"
namespace
nts
{
// namespace nts(NiuTrans.Tensor)
...
...
@@ -156,9 +156,9 @@ void _MatrixMul(const XTensor * a, MATRIX_TRANS_TYPE transposedA,
}
else
{
CheckNTErrors
((
a
->
dataType
==
DEFAULT_DTYPE
),
"TODO!"
);
_MatrixM
UL
BatchedCPU
(
aList
,
transposedA
,
bList
,
transposedB
,
cList
,
alpha
,
beta
);
_MatrixM
ul
BatchedCPU
(
aList
,
transposedA
,
bList
,
transposedB
,
cList
,
alpha
,
beta
);
}
for
(
int
i
=
0
;
i
<
aList
->
count
;
i
++
)
{
...
...
source/tensor/core/arithmetic/MatrixMulBatched.cpp
查看文件 @
a027f72e
差异被折叠。
点击展开。
source/tensor/core/arithmetic/MatrixMulBatched.h
查看文件 @
a027f72e
...
...
@@ -43,7 +43,21 @@ matrix multiplication of the two tensors c = trans(a) * trans(b) * alpha + c * b
optimized for GPU
*/
void
_MatrixMulBatchedGPU
(
const
XTensor
*
a
,
MATRIX_TRANS_TYPE
transposedA
,
const
XTensor
*
b
,
MATRIX_TRANS_TYPE
transposedB
,
XTensor
*
c
,
DTYPE
alpha
=
(
DTYPE
)
1
.
0
,
DTYPE
beta
=
0
,
XPRunner
*
parallelRunner
=
NULL
);
XTensor
*
c
,
DTYPE
alpha
=
(
DTYPE
)
1
.
0
,
DTYPE
beta
=
0
);
/*
matrix multiplication of the two tensors c = trans(a) * trans(b) * alpha + c * beta
optimized for GPU
*/
void
_MatrixMulBatchedCPU
(
const
XTensor
*
a
,
MATRIX_TRANS_TYPE
transposedA
,
const
XTensor
*
b
,
MATRIX_TRANS_TYPE
transposedB
,
XTensor
*
c
,
DTYPE
alpha
=
(
DTYPE
)
1
.
0
,
DTYPE
beta
=
0
);
/*
matrix multiplication of the two tensors c = trans(a) * trans(b) * alpha + c * beta (for list inputs)
optimized for GPU
*/
void
_MatrixMulBatchedCPU
(
const
XList
*
a
,
MATRIX_TRANS_TYPE
transposedA
,
const
XList
*
b
,
MATRIX_TRANS_TYPE
transposedB
,
XList
*
c
,
DTYPE
alpha
=
(
DTYPE
)
1
.
0
,
DTYPE
beta
=
0
);
/*
matrix multiplication of the two tensors (return a XTensor structure) c = trans(a) * trans(b) * alpha
...
...
source/tensor/core/shape/Split.cpp
查看文件 @
a027f72e
...
...
@@ -90,8 +90,8 @@ void _Split(const XTensor * s, XTensor * t, int whereToSplit, int splitNum)
int
tStep
=
n
*
tPitch
;
for
(
int
k
=
0
;
k
<
splitNum
;
k
++
)
{
XMemCopy2D
((
char
*
)
t
->
data
+
k
*
tStep
,
tPitch
,
t
->
devID
,
(
char
*
)
s
->
data
+
k
*
sStep
,
sPitch
,
s
->
devID
,
mSize
,
n
);
(
char
*
)
s
->
data
+
k
*
sStep
,
sPitch
,
s
->
devID
,
mSize
,
n
);
}
}
else
{
...
...
@@ -229,8 +229,8 @@ void _Split(const XTensor * big, XList * smalls, int whereToSplit, int splitNum)
for
(
int
k
=
0
;
k
<
splitNum
;
k
++
)
{
XTensor
*
t
=
(
XTensor
*
)
smalls
->
GetItem
(
k
);
XMemCopy2D
((
char
*
)
t
->
data
+
k
*
tStep
,
tPitch
,
t
->
devID
,
(
char
*
)
big
->
data
+
k
*
sStep
,
sPitch
,
big
->
devID
,
mSize
,
n
);
(
char
*
)
big
->
data
+
k
*
sStep
,
sPitch
,
big
->
devID
,
mSize
,
n
);
}
}
/* splitting with fewer kernel/api calls??? (i'm not sure about it!! may remove this later) */
...
...
source/tensor/test/TMatrixMULBatchedCPU.cpp
deleted
100644 → 0
查看文件 @
5c0d8bfd
/* NiuTrans.Tensor - an open-source tensor library
* Copyright (C) 2017, Natural Language Processing Lab, Northestern University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Created by: Xu Chen (email: hello_master1954@163.com) 2018-06-15
*/
#include "TMatrixMULBatchedCPU.h"
namespace
nts
{
// namespace nts(NiuTrans.Tensor)
/*
case 1: matrix multiplication in batch mode (CPU code).
In this case, aList=2*(2, 3), bList=2*(3, 2) -> c=2*(2, 2), transposedA=X_NOTRANS, transposedB=X_NOTRANS.
*/
bool
TestMatrixMulBatchedCPU1
()
{
/* create list */
XList
*
aList
=
new
XList
();
XList
*
bList
=
new
XList
();
XList
*
cList
=
new
XList
();
/* a source tensor of size (2, 3) */
int
aOrder
=
2
;
int
*
aDimSize
=
new
int
[
aOrder
];
aDimSize
[
0
]
=
2
;
aDimSize
[
1
]
=
3
;
int
aUnitNum
=
1
;
for
(
int
i
=
0
;
i
<
aOrder
;
i
++
)
aUnitNum
*=
aDimSize
[
i
];
/* a source tensor of size (3, 2) */
int
bOrder
=
2
;
int
*
bDimSize
=
new
int
[
bOrder
];
bDimSize
[
0
]
=
3
;
bDimSize
[
1
]
=
2
;
int
bUnitNum
=
1
;
for
(
int
i
=
0
;
i
<
bOrder
;
i
++
)
bUnitNum
*=
bDimSize
[
i
];
/* a target tensor of size (2, 2) */
int
cOrder
=
2
;
int
*
cDimSize
=
new
int
[
cOrder
];
cDimSize
[
0
]
=
2
;
cDimSize
[
1
]
=
2
;
int
cUnitNum
=
1
;
for
(
int
i
=
0
;
i
<
cOrder
;
i
++
)
cUnitNum
*=
cDimSize
[
i
];
DTYPE
aData1
[
2
][
3
]
=
{
{
1.0
F
,
2.0
F
,
3.0
F
},
{
-
4.0
F
,
5.0
F
,
6.0
F
}
};
DTYPE
aData2
[
2
][
3
]
=
{
{
1.0
F
,
-
2.0
F
,
-
3.0
F
},
{
-
4.0
F
,
3.0
F
,
2.0
F
}
};
DTYPE
bData1
[
3
][
2
]
=
{
{
0.0
F
,
-
1.0
F
},
{
1.0
F
,
2.0
F
},
{
2.0
F
,
1.0
F
}
};
DTYPE
bData2
[
3
][
2
]
=
{
{
0.0
F
,
1.0
F
},
{
3.0
F
,
2.0
F
},
{
2.0
F
,
1.0
F
}
};
DTYPE
answer1
[
2
][
2
]
=
{
{
8.0
F
,
6.0
F
},
{
17.0
F
,
20.0
F
}
};
DTYPE
answer2
[
2
][
2
]
=
{
{
-
12.0
F
,
-
6.0
F
},
{
13.0
F
,
4.0
F
}
};
/* CPU test */
bool
cpuTest
=
true
;
/* create tensors */
XTensor
*
a1
=
NewTensor
(
aOrder
,
aDimSize
);
XTensor
*
a2
=
NewTensor
(
aOrder
,
aDimSize
);
XTensor
*
b1
=
NewTensor
(
bOrder
,
bDimSize
);
XTensor
*
b2
=
NewTensor
(
bOrder
,
bDimSize
);
XTensor
*
c1
=
NewTensor
(
cOrder
,
cDimSize
);
XTensor
*
c2
=
NewTensor
(
cOrder
,
cDimSize
);
/* initialize variables */
a1
->
SetData
(
aData1
,
aUnitNum
);
a2
->
SetData
(
aData2
,
aUnitNum
);
b1
->
SetData
(
bData1
,
aUnitNum
);
b2
->
SetData
(
bData2
,
aUnitNum
);
c1
->
SetZeroAll
();
c2
->
SetZeroAll
();
/* add tensors to list */
aList
->
Add
(
a1
);
aList
->
Add
(
a2
);
bList
->
Add
(
b1
);
bList
->
Add
(
b2
);
cList
->
Add
(
c1
);
cList
->
Add
(
c2
);
/* call MatrixMULBatchedCPU function */
_MatrixMULBatchedCPU
(
aList
,
X_NOTRANS
,
bList
,
X_NOTRANS
,
cList
);
/* check results */
cpuTest
=
c1
->
CheckData
(
answer1
,
cUnitNum
)
&&
c2
->
CheckData
(
answer2
,
cUnitNum
);
#ifdef USE_CUDA
/* GPU test */
bool
gpuTest
=
true
;
/* create tensors */
XTensor
*
aGPU1
=
NewTensor
(
aOrder
,
aDimSize
,
X_FLOAT
,
1.0
F
,
0
);
XTensor
*
aGPU2
=
NewTensor
(
aOrder
,
aDimSize
,
X_FLOAT
,
1.0
F
,
0
);
XTensor
*
bGPU1
=
NewTensor
(
bOrder
,
bDimSize
,
X_FLOAT
,
1.0
F
,
0
);
XTensor
*
bGPU2
=
NewTensor
(
bOrder
,
bDimSize
,
X_FLOAT
,
1.0
F
,
0
);
XTensor
*
cGPU1
=
NewTensor
(
cOrder
,
cDimSize
,
X_FLOAT
,
1.0
F
,
0
);
XTensor
*
cGPU2
=
NewTensor
(
cOrder
,
cDimSize
,
X_FLOAT
,
1.0
F
,
0
);
/* initialize variables */
aGPU1
->
SetData
(
aData1
,
aUnitNum
);
aGPU2
->
SetData
(
aData2
,
aUnitNum
);
bGPU1
->
SetData
(
bData1
,
aUnitNum
);
bGPU2
->
SetData
(
bData2
,
aUnitNum
);
cGPU1
->
SetZeroAll
();
cGPU2
->
SetZeroAll
();
/* clear list */
aList
->
Clear
();
bList
->
Clear
();
cList
->
Clear
();
/* add tensors to list */
aList
->
Add
(
aGPU1
);
aList
->
Add
(
aGPU2
);
bList
->
Add
(
bGPU1
);
bList
->
Add
(
bGPU2
);
cList
->
Add
(
cGPU1
);
cList
->
Add
(
cGPU2
);
/* call MatrixMULBatchedCPU function */
_MatrixMULBatchedCPU
(
aList
,
X_NOTRANS
,
bList
,
X_NOTRANS
,
cList
);
/* check results */
gpuTest
=
cGPU1
->
CheckData
(
answer1
,
cUnitNum
)
&&
gpuTest
;
gpuTest
=
cGPU2
->
CheckData
(
answer2
,
cUnitNum
)
&&
gpuTest
;
/* destroy variables */
delete
a1
;
delete
a2
;
delete
b1
;
delete
b2
;
delete
c1
;
delete
c2
;
delete
aGPU1
;
delete
aGPU2
;
delete
bGPU1
;
delete
bGPU2
;
delete
cGPU1
;
delete
cGPU2
;
delete
[]
aDimSize
;
delete
[]
bDimSize
;
delete
[]
cDimSize
;
return
cpuTest
&&
gpuTest
;
#else
/* destroy variables */
delete
a1
;
delete
a2
;
delete
b1
;
delete
b2
;
delete
c1
;
delete
c2
;
delete
[]
aDimSize
;
delete
[]
bDimSize
;
delete
[]
cDimSize
;
return
cpuTest
;
#endif // USE_CUDA
}
/* other cases */
/*
TODO!!
*/
/* test for MatrixMulBatchedCPU Function */
extern
"C"
bool
TestMatrixMulBatchedCPU
()
{
XPRINT
(
0
,
stdout
,
"[TEST MATRIXMULBATCHEDCPU] matrix multiplication in batch mode (CPU code)
\n
"
);
bool
returnFlag
=
true
,
caseFlag
=
true
;
/* case 1 test */
caseFlag
=
TestMatrixMulBatchedCPU1
();
if
(
!
caseFlag
)
{
returnFlag
=
false
;
XPRINT
(
0
,
stdout
,
">> case 1 failed!
\n
"
);
}
else
XPRINT
(
0
,
stdout
,
">> case 1 passed!
\n
"
);
/* other cases test */
/*
TODO!!
*/
if
(
returnFlag
)
{
XPRINT
(
0
,
stdout
,
">> All Passed!
\n
"
);
}
else
XPRINT
(
0
,
stdout
,
">> Failed!
\n
"
);
XPRINT
(
0
,
stdout
,
"
\n
"
);
return
returnFlag
;
}
}
// namespace nts(NiuTrans.Tensor)
source/tensor/test/TMatrixMULBatchedCPU.h
deleted
100644 → 0
查看文件 @
5c0d8bfd
/* NiuTrans.Tensor - an open-source tensor library
* Copyright (C) 2017, Natural Language Processing Lab, Northestern University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Created by: Xu Chen (email: hello_master1954@163.com) 2018-06-15
*/
#ifndef __TEST_MATRIXMULBATCHEDCPU_H__
#define __TEST_MATRIXMULBATCHEDCPU_H__
#include "../core/arithmetic/MatrixMULBatchedCPU.h"
namespace
nts
{
// namespace nts(NiuTrans.Tensor)
/* test for MatrixMulBatchedCPU Function */
extern
"C"
bool
TestMatrixMulBatchedCPU
();
}
// namespace nts(NiuTrans.Tensor)
#endif // __TEST_MATRIXMULBATCHEDCPU_H__
source/tensor/test/Test.cpp
查看文件 @
a027f72e
...
...
@@ -40,7 +40,6 @@ bool Test()
wrong
=
!
TestMatrixMul2D
()
||
wrong
;
wrong
=
!
TestMatrixMul2DParallel
()
||
wrong
;
wrong
=
!
TestMatrixMulBatched
()
||
wrong
;
wrong
=
!
TestMatrixMulBatchedCPU
()
||
wrong
;
wrong
=
!
TestMerge
()
||
wrong
;
wrong
=
!
TestMultiply
()
||
wrong
;
wrong
=
!
TestNegate
()
||
wrong
;
...
...
source/tensor/test/Test.h
查看文件 @
a027f72e
...
...
@@ -33,7 +33,6 @@
#include "TMatrixMul2D.h"
#include "TMatrixMul2DParallel.h"
#include "TMatrixMulBatched.h"
#include "TMatrixMULBatchedCPU.h"
#include "TMerge.h"
#include "TMultiply.h"
#include "TNegate.h"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论