Integrate alrezni/quick_fix into master
This commit is contained in:
Коммит
a0c30a309d
1
Makefile
1
Makefile
|
@ -1188,6 +1188,7 @@ UNITTEST_MATH_SRC = \
|
|||
$(SOURCEDIR)/../Tests/UnitTests/MathTests/MatrixLearnerTests.cpp \
|
||||
$(SOURCEDIR)/../Tests/UnitTests/MathTests/stdafx.cpp \
|
||||
|
||||
UNITTEST_MATH_SRC += $(CNTK_COMMON_SRC)
|
||||
UNITTEST_MATH_OBJ := $(patsubst %.cpp, $(OBJDIR)/%.o, $(UNITTEST_MATH_SRC))
|
||||
|
||||
UNITTEST_MATH := $(BINDIR)/mathtests
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
<Import Project="$(SolutionDir)\CNTK.Cpp.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Condition="$(GpuBuild)" Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA $(CudaVersion).props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
|
@ -56,6 +58,15 @@
|
|||
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="$(GpuBuild)">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(CudaInclude)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(CudaLibPath)</AdditionalLibraryDirectories>
|
||||
<DelayLoadDLLs>%(DelayLoadDLLs);nvml.dll;$(CudaRuntimeDll)</DelayLoadDLLs>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="$(CpuOnlyBuild)">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions);CPUONLY</PreprocessorDefinitions>
|
||||
|
@ -63,6 +74,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Math\NcclComm.cpp" />
|
||||
<ClCompile Include="BestGpu.cpp" />
|
||||
<ClCompile Include="Config.cpp" />
|
||||
<ClCompile Include="DataReader.cpp" />
|
||||
<ClCompile Include="DataWriter.cpp" />
|
||||
|
@ -76,5 +88,7 @@
|
|||
<ClCompile Include="TimerUtility.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets" />
|
||||
<ImportGroup Condition="$(GpuBuild)" Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA $(CudaVersion).targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -15,8 +15,6 @@ namespace Microsoft { namespace MSR { namespace ScriptableObjects { struct IConf
|
|||
|
||||
namespace Microsoft { namespace MSR { namespace CNTK {
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifndef CPUONLY
|
||||
enum class GpuValidity
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "stdafx.h"
|
||||
#include "../../../Source/Math/GPUMatrix.h"
|
||||
#include "../../../Source/Math/Matrix.h"
|
||||
#include "BestGpu.h"
|
||||
|
||||
using namespace Microsoft::MSR::CNTK;
|
||||
|
||||
|
@ -16,18 +17,13 @@ BOOST_AUTO_TEST_SUITE(GPUMatrixSuite)
|
|||
|
||||
BOOST_FIXTURE_TEST_CASE(MatrixCopyAssignAccrossDevices, RandomSeedFixture)
|
||||
{
|
||||
bool hasTwoGpus = false;
|
||||
#ifndef CPUONLY
|
||||
auto gpus = GetAllGpusData();
|
||||
hasTwoGpus = (gpus.size() > 1);
|
||||
#endif
|
||||
std::array<float, 6> array = { 1, 2, 3, 4, 5, 6 };
|
||||
|
||||
bool hasTwoGpus = true;
|
||||
try
|
||||
{
|
||||
Matrix<float> m_gpu(2, 3, array.data(), c_deviceIdZero + 1, matrixFlagNormal);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
hasTwoGpus = false;
|
||||
}
|
||||
|
||||
{
|
||||
Matrix<float> m_gpu(2, 3, array.data(), c_deviceIdZero, matrixFlagNormal);
|
||||
Matrix<float> m_copy_gpu_0(m_gpu, c_deviceIdZero);
|
||||
|
|
Загрузка…
Ссылка в новой задаче