Skip to content

Commit db58611

Browse files
committed
First Commit
1 parent a6b6f57 commit db58611

26 files changed

+963
-0
lines changed
28.5 KB
Binary file not shown.
8.16 MB
Binary file not shown.
42 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DriverPropertiesViewer", "DriverPropertiesViewer\DriverPropertiesViewer.vcxproj", "{CDFEC0AF-E7C8-4215-A9D4-8021D4DA36DB}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{CDFEC0AF-E7C8-4215-A9D4-8021D4DA36DB}.Debug|x64.ActiveCfg = Debug|x64
15+
{CDFEC0AF-E7C8-4215-A9D4-8021D4DA36DB}.Debug|x64.Build.0 = Debug|x64
16+
{CDFEC0AF-E7C8-4215-A9D4-8021D4DA36DB}.Release|x64.ActiveCfg = Release|x64
17+
{CDFEC0AF-E7C8-4215-A9D4-8021D4DA36DB}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {45A4E260-AAC0-4424-ADF3-1D1B4A5F2A14}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
#include "cuda_runtime.h"
3+
#include "device_launch_parameters.h"
4+
5+
#include <stdio.h>
6+
#include <conio.h>
7+
8+
void ShowGPUProps(int DeviceID)
9+
{
10+
cudaDeviceProp DeviceProp;
11+
cudaGetDeviceProperties(&DeviceProp, DeviceID);
12+
printf("--- Card: %s --- Device Number: %d --- Integrated: %s ---\n", DeviceProp.name, DeviceID, DeviceProp.integrated ? "True" : "False");
13+
printf("--- Major Revision is %d and Minor Revision is %d ---\n", DeviceProp.major, DeviceProp.minor);
14+
printf("---------------------------------------------------------\n");
15+
printf("Total Global Memory: %d\n", DeviceProp.totalGlobalMem);
16+
printf("Total Constant Memory: %d\n", DeviceProp.totalConstMem);
17+
printf("Maximum Threads Per Block: %d\n", DeviceProp.maxThreadsPerBlock);
18+
printf("Maximum Grid Size: %d\n", DeviceProp.maxGridSize);
19+
printf("Multi Processors: %d\n", DeviceProp.multiProcessorCount);
20+
printf("Maximum Texture Dimensions;\n");
21+
printf("1D: %d\n2D: %d\n3D: %d\n", DeviceProp.maxTexture1D, DeviceProp.maxTexture2D, DeviceProp.maxTexture3D);
22+
printf("Warp Size: %d\n", DeviceProp.warpSize);
23+
printf("Registers Per Block: %d\n", DeviceProp.regsPerBlock);
24+
printf("---------------------------------------------------------\n");
25+
}
26+
27+
int main()
28+
{
29+
int DeviceCount, UserInput;
30+
cudaGetDeviceCount(&DeviceCount);
31+
32+
if (DeviceCount > 1)
33+
{
34+
printf("This machine has %d video cards.\n1 - Choose one card by number\n2 - Choose all cards\nYour choice: ");
35+
scanf("%d", &UserInput);
36+
if (UserInput == 1)
37+
{
38+
printf("Choose the a number between 0 and %d: ", (DeviceCount - 1));
39+
scanf("%d", &UserInput);
40+
if (UserInput >= 0 && UserInput <= DeviceCount - 1)
41+
ShowGPUProps(UserInput);
42+
else
43+
printf("A wrong value was typed. Please try again.\n");
44+
main();
45+
}
46+
else
47+
{
48+
for (int i = 0; i < DeviceCount - 1; i++)
49+
ShowGPUProps(i);
50+
}
51+
}
52+
else
53+
{
54+
ShowGPUProps(0);
55+
}
56+
getch();
57+
return 0;
58+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|x64">
5+
<Configuration>Debug</Configuration>
6+
<Platform>x64</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|x64">
9+
<Configuration>Release</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<ProjectGuid>{CDFEC0AF-E7C8-4215-A9D4-8021D4DA36DB}</ProjectGuid>
15+
<RootNamespace>DriverPropertiesViewer</RootNamespace>
16+
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
20+
<ConfigurationType>Application</ConfigurationType>
21+
<UseDebugLibraries>true</UseDebugLibraries>
22+
<CharacterSet>MultiByte</CharacterSet>
23+
<PlatformToolset>v141</PlatformToolset>
24+
</PropertyGroup>
25+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
26+
<ConfigurationType>Application</ConfigurationType>
27+
<UseDebugLibraries>false</UseDebugLibraries>
28+
<WholeProgramOptimization>true</WholeProgramOptimization>
29+
<CharacterSet>MultiByte</CharacterSet>
30+
<PlatformToolset>v141</PlatformToolset>
31+
</PropertyGroup>
32+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33+
<ImportGroup Label="ExtensionSettings">
34+
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.0.props" />
35+
</ImportGroup>
36+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
37+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
38+
</ImportGroup>
39+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
40+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
41+
</ImportGroup>
42+
<PropertyGroup Label="UserMacros" />
43+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
44+
<LinkIncremental>true</LinkIncremental>
45+
</PropertyGroup>
46+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
47+
<ClCompile>
48+
<WarningLevel>Level3</WarningLevel>
49+
<Optimization>Disabled</Optimization>
50+
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
51+
</ClCompile>
52+
<Link>
53+
<GenerateDebugInformation>true</GenerateDebugInformation>
54+
<SubSystem>Console</SubSystem>
55+
<AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
56+
</Link>
57+
<PostBuildEvent>
58+
<Command>echo copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"
59+
copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
60+
</PostBuildEvent>
61+
<CudaCompile>
62+
<TargetMachinePlatform>64</TargetMachinePlatform>
63+
</CudaCompile>
64+
</ItemDefinitionGroup>
65+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
66+
<ClCompile>
67+
<WarningLevel>Level3</WarningLevel>
68+
<Optimization>MaxSpeed</Optimization>
69+
<FunctionLevelLinking>true</FunctionLevelLinking>
70+
<IntrinsicFunctions>true</IntrinsicFunctions>
71+
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
72+
</ClCompile>
73+
<Link>
74+
<GenerateDebugInformation>true</GenerateDebugInformation>
75+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
76+
<OptimizeReferences>true</OptimizeReferences>
77+
<SubSystem>Console</SubSystem>
78+
<AdditionalDependencies>cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
79+
</Link>
80+
<PostBuildEvent>
81+
<Command>echo copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"
82+
copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command>
83+
</PostBuildEvent>
84+
<CudaCompile>
85+
<TargetMachinePlatform>64</TargetMachinePlatform>
86+
</CudaCompile>
87+
</ItemDefinitionGroup>
88+
<ItemGroup>
89+
<CudaCompile Include="DevInfo.cu" />
90+
<CudaCompile Include="kernel.cu" />
91+
</ItemGroup>
92+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
93+
<ImportGroup Label="ExtensionTargets">
94+
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.0.targets" />
95+
</ImportGroup>
96+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
140 KB
Binary file not shown.

0 commit comments

Comments
 (0)