Add env vars to control CUDA codegen.
This commit is contained in:
Родитель
c5c1537bd4
Коммит
f6acb1033e
15
Makefile
15
Makefile
|
@ -126,14 +126,25 @@ GENCODE_SM20 := -gencode arch=compute_20,code=\"sm_20,compute_20\"
|
|||
GENCODE_SM30 := -gencode arch=compute_30,code=\"sm_30,compute_30\"
|
||||
GENCODE_SM35 := -gencode arch=compute_35,code=\"sm_35,compute_35\"
|
||||
GENCODE_SM50 := -gencode arch=compute_50,code=\"sm_50,compute_50\"
|
||||
GENCODE_FLAGS := $(GENCODE_SM20) $(GENCODE_SM30) $(GENCODE_SM35) $(GENCODE_SM50)
|
||||
|
||||
ifeq ("$(BUILDTYPE)","debug")
|
||||
ifdef CNTK_CUDA_CODEGEN_DEBUG
|
||||
GENCODE_FLAGS := $(CNTK_CUDA_CODEGEN_DEBUG)
|
||||
else
|
||||
GENCODE_FLAGS := -gencode arch=compute_20,code=\"compute_20\"
|
||||
endif
|
||||
|
||||
CXXFLAGS += -g
|
||||
CUFLAGS += -O0 -G -lineinfo -gencode arch=compute_20,code=\"compute_20\" $(GENCODE_SM35)
|
||||
CUFLAGS += -O0 -G -lineinfo $(GENCODE_FLAGS)
|
||||
endif
|
||||
|
||||
ifeq ("$(BUILDTYPE)","release")
|
||||
ifdef CNTK_CUDA_CODEGEN_RELEASE
|
||||
GENCODE_FLAGS := $(CNTK_CUDA_CODEGEN_RELEASE)
|
||||
else
|
||||
GENCODE_FLAGS := $(GENCODE_SM20) $(GENCODE_SM30) $(GENCODE_SM35) $(GENCODE_SM50)
|
||||
endif
|
||||
|
||||
CXXFLAGS += -O4
|
||||
CUFLAGS += -O3 -use_fast_math -lineinfo $(GENCODE_FLAGS)
|
||||
endif
|
||||
|
|
|
@ -53,9 +53,13 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CudaCodeGen>$(CNTK_CUDA_CODEGEN_DEBUG)</CudaCodeGen>
|
||||
<CudaCodeGen Condition="'$(CudaCodeGen)'==''">compute_20,compute_20</CudaCodeGen>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CudaCodeGen>$(CNTK_CUDA_CODEGEN_RELEASE)</CudaCodeGen>
|
||||
<CudaCodeGen Condition="'$(CudaCodeGen)'==''">compute_20,sm_20;compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;</CudaCodeGen>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
|
@ -80,6 +84,7 @@
|
|||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
<GenerateLineInfo>true</GenerateLineInfo>
|
||||
<AdditionalCompilerOptions>/WX</AdditionalCompilerOptions>
|
||||
<CodeGeneration>$(CudaCodeGen)</CodeGeneration>
|
||||
</CudaCompile>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /D /I /Y "$(CudaPath)\bin\cudart64_*.dll" $(OutputPath)</Command>
|
||||
|
@ -93,9 +98,6 @@
|
|||
</ClCompile>
|
||||
<Link>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_20,compute_20;compute_35,sm_35</CodeGeneration>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
|
@ -112,7 +114,6 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_20,sm_20;compute_30,sm_30;compute_35,sm_35;compute_50,sm_50;</CodeGeneration>
|
||||
<FastMath>true</FastMath>
|
||||
<GPUDebugInfo>false</GPUDebugInfo>
|
||||
<HostDebugInfo>false</HostDebugInfo>
|
||||
|
|
Загрузка…
Ссылка в новой задаче