mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Fixed checking CC for enabling Tensor Cores
This commit is contained in:
@ -93,8 +93,8 @@
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\..\include;..\..\3rdparty\include;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir);$(cudnn)\include</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_MBCS;LIB_EXPORTS;_TIMESPEC_DEFINED;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;GPU;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<UndefinePreprocessorDefinitions>CUDNN</UndefinePreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_MBCS;LIB_EXPORTS;_TIMESPEC_DEFINED;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;GPU;WIN32;DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<UndefinePreprocessorDefinitions>CUDNN_HALF;CUDNN</UndefinePreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<ForcedIncludeFiles>stdlib.h;crtdbg.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
</ClCompile>
|
||||
@ -106,7 +106,7 @@
|
||||
<AssemblyDebug>true</AssemblyDebug>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_30,sm_30;compute_52,sm_52</CodeGeneration>
|
||||
<CodeGeneration>compute_30,sm_30;compute_75,sm_75</CodeGeneration>
|
||||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
@ -137,7 +137,7 @@
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>C:\opencv_3.0\opencv\build\include;..\..\include;..\..\3rdparty\include;%(AdditionalIncludeDirectories);$(CudaToolkitIncludeDir);$(cudnn)\include</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>CUDNN;GPU;LIB_EXPORTS;_TIMESPEC_DEFINED;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>CUDNN_HALF;CUDNN;GPU;LIB_EXPORTS;_TIMESPEC_DEFINED;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CLanguageStandard>c11</CLanguageStandard>
|
||||
<CppLanguageStandard>c++1y</CppLanguageStandard>
|
||||
<PrecompiledHeaderCompileAs>CompileAsCpp</PrecompiledHeaderCompileAs>
|
||||
@ -156,7 +156,7 @@
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
<CodeGeneration>compute_30,sm_30;compute_52,sm_52</CodeGeneration>
|
||||
<CodeGeneration>compute_30,sm_30;compute_75,sm_75</CodeGeneration>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
@ -309,7 +309,7 @@ int get_gpu_compute_capability(int i)
|
||||
cudaDeviceProp prop;
|
||||
cudaError_t status = cudaGetDeviceProperties(&prop, i);
|
||||
CHECK_CUDA(status);
|
||||
int cc = prop.major * 10 + prop.minor;
|
||||
int cc = prop.major * 100 + prop.minor * 10; // __CUDA_ARCH__ format
|
||||
return cc;
|
||||
}
|
||||
|
||||
|
@ -671,8 +671,10 @@ void parse_net_options(list *options, network *net)
|
||||
net->policy = get_policy(policy_s);
|
||||
net->burn_in = option_find_int_quiet(options, "burn_in", 0);
|
||||
#ifdef CUDNN_HALF
|
||||
if(get_gpu_compute_capability(net->gpu_index) >= 7000) net->cudnn_half = 1;
|
||||
int compute_capability = get_gpu_compute_capability(net->gpu_index);
|
||||
if(get_gpu_compute_capability(net->gpu_index) >= 700) net->cudnn_half = 1;
|
||||
else net->cudnn_half = 0;
|
||||
fprintf(stderr, " compute_capability = %d, cudnn_half = %d \n", compute_capability, net->cudnn_half);
|
||||
#endif
|
||||
if(net->policy == STEP){
|
||||
net->step = option_find_int(options, "step", 1);
|
||||
|
Reference in New Issue
Block a user