提交 8b9af710 编写于 作者: C chengtbf

add namespace {} in kernel_test oneflow::test::

上级 c90db228
......@@ -5,6 +5,8 @@ namespace oneflow {
namespace test {
namespace {
template<typename FloatingPointType>
BoxingKernel<DeviceType::kCPU, FloatingPointType>* BuildBoxingKernel(
int32_t in_num, int32_t out_num, int kernel_name,
......@@ -262,6 +264,8 @@ void TestBoxingKernelAddClone() {
}
}
} // namespace
} // namespace test
TEST(boxingkernel, boxing_add_clone_box) {
......
......@@ -8,6 +8,8 @@ namespace oneflow {
namespace test {
namespace {
template<DeviceType device_type, typename FloatingPointType>
Kernel* BuildCloneKernel(int out_num) {
OperatorConf op_conf;
......@@ -64,6 +66,8 @@ void TestCloneKernel() {
KTCommon::CheckResult(BnInOp2BlobPtr, "in_diff", "in_diff_expected");
}
} // namespace
} // namespace test
TEST(CloneKernel, clone_cpu) {
......
......@@ -6,6 +6,8 @@ namespace oneflow {
namespace test {
namespace {
template<typename FloatingPointType>
std::function<Blob*(const std::string&)> BuildBnInOp2BlobPtr(
CopyHdOpConf::Type hd_type) {
......@@ -69,6 +71,9 @@ void TestCopyHdKernel(CopyHdOpConf::Type hd_type) {
KTCommonGpu::CheckResult(BnInOp2BlobPtr, "in", "in_diff");
}
}
} // namespace
} // namespace test
TEST(CopyHdKernel, copy_d2h) {
......
......@@ -7,6 +7,8 @@ namespace oneflow {
namespace test {
namespace {
template<DeviceType device_type, typename FloatingPointType>
std::function<Blob*(const std::string&)> BuildBnInOp2BlobPtr(
bool has_bias_term) {
......@@ -115,6 +117,8 @@ void TestInnerProductKernel(bool has_bias_term) {
}
}
} // namespace
} // namespace test
TEST(InnerProductKernel, inner_product_kernel_cpu_with_bias) {
......
......@@ -8,6 +8,8 @@ namespace oneflow {
namespace test {
namespace {
template<DeviceType device_type, typename FloatingPointType>
std::function<Blob*(const std::string&)> BuildBnInOp2BlobPtr() {
using KTCommon = KernelTestCommon<device_type, FloatingPointType>;
......@@ -62,6 +64,9 @@ void TestMdDiffAccKernel() {
KTCommon::CheckResult(BnInOp2BlobPtr, "model_diff_acc", "expected_acc");
}
} // namespace
} // namespace test
TEST(MdDiffAccKernel, model_diff_acc_kernel_cpu) {
......
......@@ -7,6 +7,8 @@ namespace oneflow {
namespace test {
namespace {
template<DeviceType device_type, typename FloatingPointType>
std::function<Blob*(const std::string&)> BuildBnInOp2BlobPtr() {
using KTCommon = KernelTestCommon<device_type, FloatingPointType>;
......@@ -59,6 +61,9 @@ void TestReluKernel() {
KTCommon::CheckResult(BnInOp2BlobPtr, "out", "expected_out");
KTCommon::CheckResult(BnInOp2BlobPtr, "in_diff", "expected_in_diff");
}
} // namespace
} // namespace test
TEST(ReluKernel, relu_kernel_cpu) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册