Skip to content

Commit

Permalink
addressed codeflow comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfma61 committed Nov 4, 2015
1 parent c265711 commit a120b15
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Tests/UnitTests/MathTests/CPUMatrixTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "..\..\..\Math\Math\CPUMatrix.h"

#include <array>
#include <boost/test/unit_test.hpp>


using namespace Microsoft::MSR::CNTK;

Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/MathTests/CPUSparseMatrixTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "stdafx.h"
#include <crtdefs.h>
#include "..\..\..\Math\Math\CPUSparseMatrix.h"
#include <boost/test/unit_test.hpp>


using namespace Microsoft::MSR::CNTK;

Expand All @@ -21,9 +21,9 @@ namespace Microsoft
typedef CPUDoubleSparseMatrix SparseMatrix;
typedef CPUDoubleMatrix DenseMatrix;

BOOST_AUTO_TEST_SUITE(CPUSparseMatrixSuite)
BOOST_AUTO_TEST_SUITE(CpuMatrixSuite)

BOOST_AUTO_TEST_CASE(CPUSparseMatrixColumnSlice)
BOOST_AUTO_TEST_CASE(CPUSparseMatrixColumnSlice)
{
const size_t m = 100;
const size_t n = 50;
Expand Down
2 changes: 2 additions & 0 deletions Tests/UnitTests/MathTests/MathTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="constant.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="constant.cpp" />
<ClCompile Include="CPUSparseMatrixTests.cpp" />
<ClCompile Include="DebugUtil.cpp" />
<ClCompile Include="MatrixFileWriteReadTests.cpp" />
Expand Down
28 changes: 13 additions & 15 deletions Tests/UnitTests/MathTests/MatrixFileWriteReadTests.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
//
// <copyright file="CPUMatrixTests.cpp" company="Microsoft">
// <copyright file="MatrixFileWriteReadTests.cpp" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
#include "stdafx.h"
#include "..\..\common\include\Basics.h"
#include "..\..\Math\Math\CPUMatrix.h"
#include "..\..\Math\Math\GPUMatrix.h"
#include "..\..\common\include\fileutil.h"
#include "..\..\common\include\File.h"
#include "..\..\common\File.cpp"
#include "..\..\common\fileutil.cpp"
#include "../../Common/Include/Basics.h"
#include "../../Math/Math/CPUMatrix.h"
#include "../../Math/Math/GPUMatrix.h"
#include "../../Common/Include/fileutil.h"
#include "../../Common/Include/File.h"
// ToDo: CPP files directly included, use common library in the future if possible
#include "../../Common/File.cpp"
#include "../../Common/fileutil.cpp"

#include <string>

#include <boost/test/unit_test.hpp>

using namespace Microsoft::MSR::CNTK;

namespace Microsoft
Expand Down Expand Up @@ -44,11 +43,10 @@ namespace Microsoft

BOOST_CHECK(matrixCpuCopy.IsEqualTo(matrixCpuRead, 0.00001f));
}


BOOST_AUTO_TEST_CASE(GPUMatrixFileWriteRead)

BOOST_AUTO_TEST_CASE(GpuMatrixFileWriteRead)
{
GPUMatrix<float> matrixGpu = GPUMatrix<float>::RandomUniform(43, 10, 0 /*deviceId*/, -26.3f, 30.2f);
GPUMatrix<float> matrixGpu = GPUMatrix<float>::RandomUniform(43, 10, c_deviceIdZero, -26.3f, 30.2f);
GPUMatrix<float> matrixGpuCopy = matrixGpu;

std::wstring filenameGpu(L"MGPU.txt");
Expand All @@ -57,7 +55,7 @@ namespace Microsoft
fileGpu << matrixGpu;
fileGpu.SetPosition(0);

GPUMatrix<float> matrixGpuRead(0 /*deviceId*/);
GPUMatrix<float> matrixGpuRead(c_deviceIdZero);
fileGpu >> matrixGpuRead;

BOOST_CHECK(matrixGpuCopy.IsEqualTo(matrixGpuRead, 0.00001f));
Expand Down
5 changes: 2 additions & 3 deletions Tests/UnitTests/MathTests/stdafx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
// </copyright>
//
// stdafx.cpp : source file that includes just the standard includes

#define BOOST_TEST_MODULE MathTests
#include "stdafx.h"

#define BOOST_TEST_MODULE MathTests

#include <boost/test/unit_test.hpp>

5 changes: 4 additions & 1 deletion Tests/UnitTests/MathTests/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@

#define _CRT_SECURE_NO_WARNINGS // "secure" CRT not available on all platforms
#define _SCL_SECURE_NO_WARNINGS // current API of matrix does not allow safe invokations. TODO: change api to proper one.
#include "targetver.h"

#include "constant.h"
#include "targetver.h"
#include <boost/test/unit_test.hpp>

0 comments on commit a120b15

Please sign in to comment.