https://github.com/Microsoft/CNTK
Raw File
Tip revision: 38f0218c8ce2e0e0b999cdf0be2a7f554aafe030 authored by Clemens Marschner on 03 June 2016, 12:33:58 UTC
Switch off OpenMP for Math
Tip revision: 38f0218
CNTK.Cpp.props
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <!-- Note: SolutionDir / RepoRootPath are the same in current setup -->
    <RepoRootPath>$(MSBuildThisFileDirectory)</RepoRootPath>
    <RelativeProjectPath>$(MSBuildProjectDirectory.Substring($(MSBuildThisFileDirectory.Length)))</RelativeProjectPath>

    <OutDir>$(RepoRootPath)$(Platform)\$(Configuration)\</OutDir>
    <IntDir>$(RepoRootPath)$(Platform)\.build\$(Configuration)\$(RelativeProjectPath)\</IntDir>

    <DebugBuild>false</DebugBuild>
    <DebugBuild Condition="$(Configuration.StartsWith('Debug'))">true</DebugBuild>

    <ReleaseBuild>false</ReleaseBuild>
    <ReleaseBuild Condition="!$(DebugBuild)">true</ReleaseBuild>

    <GpuBuild>true</GpuBuild>
    <GpuBuild Condition="$(Configuration.EndsWith('_CpuOnly'))">false</GpuBuild>

    <CpuOnlyBuild>true</CpuOnlyBuild>
    <CpuOnlyBuild Condition="$(GpuBuild)">false</CpuOnlyBuild>

    <NvmlInclude>"c:\Program Files\NVIDIA Corporation\GDK\gdk_win7_amd64_release\nvml\include"</NvmlInclude>
    <NvmlLibPath>"c:\Program Files\NVIDIA Corporation\GDK\gdk_win7_amd64_release\nvml\lib"</NvmlLibPath>

    <CudaVersion/>
    <CudaVersion Condition="Exists('$(CUDA_PATH_V7_5)') And '$(CudaVersion)' == ''">7.5</CudaVersion>
    <CudaVersion Condition="Exists('$(CUDA_PATH_V7_0)') And '$(CudaVersion)' == ''">7.0</CudaVersion>

  </PropertyGroup>

  <Choose>
    <When Condition="Exists('$(ACML_PATH)')">
      <PropertyGroup>
        <MathLibrayName>ACML</MathLibrayName>
        <MathIncludePath>$(ACML_PATH)\include</MathIncludePath>
        <MathLibraryPath>$(ACML_PATH)\lib</MathLibraryPath>
        <MathLinkLibrary>libacml_mp_dll.lib</MathLinkLibrary>
        <MathDelayLoad>libacml_mp_dll.dll</MathDelayLoad>
        <MathPostBuildPath>$(ACML_PATH)\lib\*.dll</MathPostBuildPath>
        <UnitTestDlls>$(OutDir)libacml_mp_dll.dll;$(OutDir)libifcoremd.dll;$(OutDir)libifportmd.dll;$(OutDir)libiomp*.dll;$(OutDir)libmmd.dll;$(OutDir)svml_dispmd.dll;</UnitTestDlls>
        <MathDefine>USE_ACML</MathDefine>
        <!-- TODO remove USE_ACML and USE_MKL once we remove all the dependencies on ACML -->    
      </PropertyGroup>
    </When>
    <When Condition="'$(CNTK_MKL)' == '1'">
      <PropertyGroup>    
        <MKLCustomVersion>1</MKLCustomVersion>
        <MKLDropDirectory>$(CNTK_MKL_PATH)\$(MKLCustomVersion)</MKLDropDirectory>
        <!-- The prebuild custom MKL DLLs and header files have to be precopied into the directory defined by the user defined CNTK_MKL_PATH environment variable -->
        <!-- inside this directory the MKLCustomVersion defines the version of the custom MKL DLLs to use in this project -->
        <!-- this allows for multiple version of the custom DLLs present on the machine -->
        <!-- TODO: check if MKLDropDirectory is existing, report error/warning if not found -->
        <MathIncludePath>$(MKLDropDirectory)\include</MathIncludePath>
        <MathDefine>USE_MKL</MathDefine>
      </PropertyGroup>
      <Choose>
        <When Condition="'$(CNTK_MKL_SEQUENTIAL)' != '1'">
          <PropertyGroup>    
            <MathLibrayName>CNTK-Custom MKL Parallel (Version: $(MKLCustomVersion))</MathLibrayName>
            <MathLibraryPath>$(MKLDropDirectory)\x64\parallel</MathLibraryPath>
            <MathLinkLibrary>mkl_cntk_p.lib</MathLinkLibrary>
            <MathDelayLoad>mkl_cntk_p.dll</MathDelayLoad>
            <MathPostBuildPath>$(MathLibraryPath)\*.dll</MathPostBuildPath>
            <UnitTestDlls>$(OutDir)mkl_cntk_p.dll;$(OutDir)libiomp5md.dll;</UnitTestDlls>
          </PropertyGroup>
        </When>
        <When Condition="'$(CNTK_MKL_SEQUENTIAL)' == '1'">
          <PropertyGroup>            
            <MathLibrayName>CNTK-Custom MKL Sequential (Version: $(MKLCustomVersion))</MathLibrayName>
            <MathLibraryPath>$(MKLDropDirectory)\x64\sequential</MathLibraryPath>
            <MathLinkLibrary>mkl_cntk_s.lib</MathLinkLibrary>
            <MathDelayLoad>mkl_cntk_s.dll</MathDelayLoad>
            <MathPostBuildPath>$(MathLibraryPath)\*.dll</MathPostBuildPath>
            <UnitTestDlls>$(OutDir)mkl_cntk_s.dll;</UnitTestDlls>      
          </PropertyGroup>
        </When>
      
      </Choose>
    </When>
  </Choose>
  
  <PropertyGroup Condition="'$(CudaVersion)' == '7.5'">
    <CudaPath>$(CUDA_PATH_V7_5)</CudaPath>
    <CudaRuntimeDll>cudart64_75.dll</CudaRuntimeDll>
    <CudaDlls>cublas64_75.dll;cusparse64_75.dll;curand64_75.dll;$(CudaRuntimeDll)</CudaDlls>
  </PropertyGroup>

  <PropertyGroup Condition="'$(CudaVersion)' == '7.0'">
    <CudaPath>$(CUDA_PATH_V7_0)</CudaPath>
    <CudaRuntimeDll>cudart64_70.dll</CudaRuntimeDll>
    <CudaDlls>cublas64_70.dll;cusparse64_70.dll;curand64_70.dll;$(CudaRuntimeDll)</CudaDlls>
  </PropertyGroup>

  <PropertyGroup>
    <CudaLibs>cudart.lib;cublas.lib;cusparse.lib;curand.lib</CudaLibs>
    <CudaInclude>$(CudaPath)\include</CudaInclude>
    <CudaLibPath>$(CudaPath)\lib\$(Platform)</CudaLibPath>
  </PropertyGroup>

  <!-- TODO warn if ConfigurationType not (yet) defined -->

  <PropertyGroup Condition="'$(ConfigurationType)' == 'StaticLibrary'">
    <UseDebugLibraries>$(DebugBuild)</UseDebugLibraries>
    <PlatformToolset>v120</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
    <WholeProgramOptimization>$(ReleaseBuild)</WholeProgramOptimization>
    <LinkIncremental>$(DebugBuild)</LinkIncremental>
  </PropertyGroup>

  <ItemDefinitionGroup Condition="'$(ConfigurationType)' == 'StaticLibrary'">
    <ClCompile>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <SDLCheck>true</SDLCheck>
      <OpenMPSupport>true</OpenMPSupport>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </ItemDefinitionGroup>

  <ItemDefinitionGroup Condition="'$(ConfigurationType)' == 'StaticLibrary' And $(DebugBuild)">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    <Link>
      <StackReserveSize>100000000</StackReserveSize>
    </Link>
  </ItemDefinitionGroup>

  <ItemDefinitionGroup Condition="'$(ConfigurationType)' == 'StaticLibrary' And $(ReleaseBuild)">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    <Link>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <OptimizeReferences>true</OptimizeReferences>
      <Profile>true</Profile>
    </Link>
  </ItemDefinitionGroup>

</Project>
back to top