mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-23 13:18:16 +08:00
Add and update samples with CUDA 11.2 support
This commit is contained in:
@@ -302,10 +302,14 @@ LIBRARIES :=
|
||||
|
||||
################################################################################
|
||||
|
||||
PTX_FILE := vectorAdd_kernel${TARGET_SIZE}.ptx
|
||||
FATBIN_FILE := vectorAdd_kernel${TARGET_SIZE}.fatbin
|
||||
|
||||
# Gencode arguments
|
||||
SMS ?=
|
||||
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),armv7l aarch64))
|
||||
SMS ?= 35 37 50 52 60 61 70 72 75 80 86
|
||||
else
|
||||
SMS ?= 35 37 50 52 60 61 70 75 80 86
|
||||
endif
|
||||
|
||||
ifeq ($(GENCODE_FLAGS),)
|
||||
# Generate SASS code for each SM architecture listed in $(SMS)
|
||||
@@ -380,6 +384,8 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ALL_CCFLAGS += --threads 0
|
||||
|
||||
ifeq ($(SAMPLE_ENABLED),0)
|
||||
EXEC ?= @echo "[@]"
|
||||
endif
|
||||
@@ -389,7 +395,7 @@ endif
|
||||
# Target rules
|
||||
all: build
|
||||
|
||||
build: vectorAddMMAP $(PTX_FILE)
|
||||
build: vectorAddMMAP $(FATBIN_FILE)
|
||||
|
||||
check.deps:
|
||||
ifeq ($(SAMPLE_ENABLED),0)
|
||||
@@ -398,8 +404,8 @@ else
|
||||
@echo "Sample is ready - all dependencies have been met"
|
||||
endif
|
||||
|
||||
$(PTX_FILE): vectorAdd_kernel.cu
|
||||
$(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -ptx $<
|
||||
$(FATBIN_FILE): vectorAdd_kernel.cu
|
||||
$(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $@ -fatbin $<
|
||||
$(EXEC) mkdir -p data
|
||||
$(EXEC) cp -f $@ ./data
|
||||
$(EXEC) mkdir -p ../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)
|
||||
@@ -420,8 +426,9 @@ run: build
|
||||
$(EXEC) ./vectorAddMMAP
|
||||
|
||||
clean:
|
||||
rm -f vectorAddMMAP multidevicealloc_memmap.o vectorAddMMAP.o data/$(PTX_FILE) $(PTX_FILE)
|
||||
rm -f vectorAddMMAP multidevicealloc_memmap.o vectorAddMMAP.o data/$(FATBIN_FILE) $(FATBIN_FILE)
|
||||
rm -rf ../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)/vectorAddMMAP
|
||||
rm -rf ../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)/$(PTX_FILE)
|
||||
|
||||
rm -rf ../../bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE)/$(FATBIN_FILE)
|
||||
|
||||
clobber: clean
|
||||
|
||||
@@ -27,7 +27,7 @@ cuModuleLoad, cuModuleLoadDataEx, cuModuleGetFunction, cuMemAlloc, cuMemFree, cu
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Download and install the [CUDA Toolkit 11.1](https://developer.nvidia.com/cuda-downloads) for your corresponding platform.
|
||||
Download and install the [CUDA Toolkit 11.2](https://developer.nvidia.com/cuda-downloads) for your corresponding platform.
|
||||
|
||||
## Build and Run
|
||||
|
||||
|
||||
@@ -69,13 +69,10 @@ size_t allocationSize = 0;
|
||||
// Functions
|
||||
int CleanupNoFailure();
|
||||
void RandomInit(float *, int);
|
||||
bool findModulePath(const char *, string &, char **, string &);
|
||||
|
||||
// define input ptx file for different platforms
|
||||
#if defined(_WIN64) || defined(__LP64__)
|
||||
#define PTX_FILE "vectorAdd_kernel64.ptx"
|
||||
#else
|
||||
#define PTX_FILE "vectorAdd_kernel32.ptx"
|
||||
//define input fatbin file
|
||||
#ifndef FATBIN_FILE
|
||||
#define FATBIN_FILE "vectorAdd_kernel64.fatbin"
|
||||
#endif
|
||||
|
||||
// collect all of the devices whose memory can be mapped from cuDevice.
|
||||
@@ -150,176 +147,126 @@ int main(int argc, char **argv) {
|
||||
// Create context
|
||||
checkCudaErrors(cuCtxCreate(&cuContext, 0, cuDevice));
|
||||
|
||||
// first search for the module path before we load the results
|
||||
string module_path, ptx_source;
|
||||
// first search for the module path before we load the results
|
||||
string module_path;
|
||||
|
||||
if (!findModulePath(PTX_FILE, module_path, argv, ptx_source)) {
|
||||
if (!findModulePath("vectorAdd_kernel.cubin", module_path, argv,
|
||||
ptx_source)) {
|
||||
printf("> findModulePath could not find <vectorAdd> ptx or cubin\n");
|
||||
exit(EXIT_FAILURE);
|
||||
std::ostringstream fatbin;
|
||||
|
||||
if (!findFatbinPath(FATBIN_FILE, module_path, argv, fatbin))
|
||||
{
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
printf("> initCUDA loading module: <%s>\n", module_path.c_str());
|
||||
}
|
||||
|
||||
// Create module from binary file (PTX or CUBIN)
|
||||
if (module_path.rfind("ptx") != string::npos) {
|
||||
// in this branch we use compilation with parameters
|
||||
const unsigned int jitNumOptions = 3;
|
||||
CUjit_option *jitOptions = new CUjit_option[jitNumOptions];
|
||||
void **jitOptVals = new void *[jitNumOptions];
|
||||
|
||||
// set up size of compilation log buffer
|
||||
jitOptions[0] = CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES;
|
||||
int jitLogBufferSize = 1024;
|
||||
jitOptVals[0] = (void *)(size_t)jitLogBufferSize;
|
||||
|
||||
// set up pointer to the compilation log buffer
|
||||
jitOptions[1] = CU_JIT_INFO_LOG_BUFFER;
|
||||
char *jitLogBuffer = new char[jitLogBufferSize];
|
||||
jitOptVals[1] = jitLogBuffer;
|
||||
|
||||
// set up pointer to set the Maximum # of registers for a particular kernel
|
||||
jitOptions[2] = CU_JIT_MAX_REGISTERS;
|
||||
int jitRegCount = 32;
|
||||
jitOptVals[2] = (void *)(size_t)jitRegCount;
|
||||
|
||||
checkCudaErrors(cuModuleLoadDataEx(&cuModule, ptx_source.c_str(),
|
||||
jitNumOptions, jitOptions,
|
||||
(void **)jitOptVals));
|
||||
|
||||
printf("> PTX JIT log:\n%s\n", jitLogBuffer);
|
||||
} else {
|
||||
checkCudaErrors(cuModuleLoad(&cuModule, module_path.c_str()));
|
||||
}
|
||||
|
||||
// Get function handle from module
|
||||
checkCudaErrors(
|
||||
cuModuleGetFunction(&vecAdd_kernel, cuModule, "VecAdd_kernel"));
|
||||
|
||||
// Allocate input vectors h_A and h_B in host memory
|
||||
h_A = (float *)malloc(size);
|
||||
h_B = (float *)malloc(size);
|
||||
h_C = (float *)malloc(size);
|
||||
|
||||
// Initialize input vectors
|
||||
RandomInit(h_A, N);
|
||||
RandomInit(h_B, N);
|
||||
|
||||
// Allocate vectors in device memory
|
||||
// note that a call to cuCtxEnablePeerAccess is not needed even though
|
||||
// the backing devices and mapping device are not the same.
|
||||
// This is because the cuMemSetAccess call explicitly specifies
|
||||
// the cross device mapping.
|
||||
// cuMemSetAccess is still subject to the constraints of cuDeviceCanAccessPeer
|
||||
// for cross device mappings (hence why we checked cuDeviceCanAccessPeer
|
||||
// earlier).
|
||||
checkCudaErrors(simpleMallocMultiDeviceMmap(&d_A, &allocationSize, size,
|
||||
backingDevices, mappingDevices));
|
||||
checkCudaErrors(simpleMallocMultiDeviceMmap(&d_B, NULL, size, backingDevices,
|
||||
mappingDevices));
|
||||
checkCudaErrors(simpleMallocMultiDeviceMmap(&d_C, NULL, size, backingDevices,
|
||||
mappingDevices));
|
||||
|
||||
// Copy vectors from host memory to device memory
|
||||
checkCudaErrors(cuMemcpyHtoD(d_A, h_A, size));
|
||||
checkCudaErrors(cuMemcpyHtoD(d_B, h_B, size));
|
||||
|
||||
// This is the new CUDA 4.0 API for Kernel Parameter Passing and Kernel Launch
|
||||
// (simpler method)
|
||||
|
||||
// Grid/Block configuration
|
||||
int threadsPerBlock = 256;
|
||||
int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock;
|
||||
|
||||
void *args[] = {&d_A, &d_B, &d_C, &N};
|
||||
|
||||
// Launch the CUDA kernel
|
||||
checkCudaErrors(cuLaunchKernel(vecAdd_kernel, blocksPerGrid, 1, 1,
|
||||
threadsPerBlock, 1, 1, 0, NULL, args, NULL));
|
||||
|
||||
// Copy result from device memory to host memory
|
||||
// h_C contains the result in host memory
|
||||
checkCudaErrors(cuMemcpyDtoH(h_C, d_C, size));
|
||||
|
||||
// Verify result
|
||||
int i;
|
||||
|
||||
for (i = 0; i < N; ++i) {
|
||||
float sum = h_A[i] + h_B[i];
|
||||
|
||||
if (fabs(h_C[i] - sum) > 1e-7f) {
|
||||
break;
|
||||
else
|
||||
{
|
||||
printf("> initCUDA loading module: <%s>\n", module_path.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
CleanupNoFailure();
|
||||
printf("%s\n", (i == N) ? "Result = PASS" : "Result = FAIL");
|
||||
if (!fatbin.str().size())
|
||||
{
|
||||
printf("fatbin file empty. exiting..\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
exit((i == N) ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
// Create module from binary file (FATBIN)
|
||||
checkCudaErrors(cuModuleLoadData(&cuModule, fatbin.str().c_str()));
|
||||
|
||||
// Get function handle from module
|
||||
checkCudaErrors(cuModuleGetFunction(&vecAdd_kernel, cuModule, "VecAdd_kernel"));
|
||||
|
||||
// Allocate input vectors h_A and h_B in host memory
|
||||
h_A = (float *)malloc(size);
|
||||
h_B = (float *)malloc(size);
|
||||
h_C = (float *)malloc(size);
|
||||
|
||||
|
||||
// Initialize input vectors
|
||||
RandomInit(h_A, N);
|
||||
RandomInit(h_B, N);
|
||||
|
||||
// Allocate vectors in device memory
|
||||
// note that a call to cuCtxEnablePeerAccess is not needed even though
|
||||
// the backing devices and mapping device are not the same.
|
||||
// This is because the cuMemSetAccess call explicitly specifies
|
||||
// the cross device mapping.
|
||||
// cuMemSetAccess is still subject to the constraints of cuDeviceCanAccessPeer
|
||||
// for cross device mappings (hence why we checked cuDeviceCanAccessPeer earlier).
|
||||
checkCudaErrors(simpleMallocMultiDeviceMmap(&d_A, &allocationSize, size, backingDevices, mappingDevices));
|
||||
checkCudaErrors(simpleMallocMultiDeviceMmap(&d_B, NULL, size, backingDevices, mappingDevices));
|
||||
checkCudaErrors(simpleMallocMultiDeviceMmap(&d_C, NULL, size, backingDevices, mappingDevices));
|
||||
|
||||
// Copy vectors from host memory to device memory
|
||||
checkCudaErrors(cuMemcpyHtoD(d_A, h_A, size));
|
||||
checkCudaErrors(cuMemcpyHtoD(d_B, h_B, size));
|
||||
|
||||
// This is the new CUDA 4.0 API for Kernel Parameter Passing and Kernel Launch (simpler method)
|
||||
|
||||
// Grid/Block configuration
|
||||
int threadsPerBlock = 256;
|
||||
int blocksPerGrid = (N + threadsPerBlock - 1) / threadsPerBlock;
|
||||
|
||||
void *args[] = { &d_A, &d_B, &d_C, &N };
|
||||
|
||||
// Launch the CUDA kernel
|
||||
checkCudaErrors(cuLaunchKernel(vecAdd_kernel, blocksPerGrid, 1, 1,
|
||||
threadsPerBlock, 1, 1,
|
||||
0,
|
||||
NULL, args, NULL));
|
||||
|
||||
// Copy result from device memory to host memory
|
||||
// h_C contains the result in host memory
|
||||
checkCudaErrors(cuMemcpyDtoH(h_C, d_C, size));
|
||||
|
||||
// Verify result
|
||||
int i;
|
||||
|
||||
for (i = 0; i < N; ++i)
|
||||
{
|
||||
float sum = h_A[i] + h_B[i];
|
||||
|
||||
if (fabs(h_C[i] - sum) > 1e-7f)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CleanupNoFailure();
|
||||
printf("%s\n", (i==N) ? "Result = PASS" : "Result = FAIL");
|
||||
|
||||
exit((i==N) ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int CleanupNoFailure() {
|
||||
// Free device memory
|
||||
checkCudaErrors(simpleFreeMultiDeviceMmap(d_A, allocationSize));
|
||||
checkCudaErrors(simpleFreeMultiDeviceMmap(d_B, allocationSize));
|
||||
checkCudaErrors(simpleFreeMultiDeviceMmap(d_C, allocationSize));
|
||||
int CleanupNoFailure()
|
||||
{
|
||||
// Free device memory
|
||||
checkCudaErrors(simpleFreeMultiDeviceMmap(d_A, allocationSize));
|
||||
checkCudaErrors(simpleFreeMultiDeviceMmap(d_B, allocationSize));
|
||||
checkCudaErrors(simpleFreeMultiDeviceMmap(d_C, allocationSize));
|
||||
|
||||
// Free host memory
|
||||
if (h_A) {
|
||||
free(h_A);
|
||||
}
|
||||
// Free host memory
|
||||
if (h_A)
|
||||
{
|
||||
free(h_A);
|
||||
}
|
||||
|
||||
if (h_B) {
|
||||
free(h_B);
|
||||
}
|
||||
if (h_B)
|
||||
{
|
||||
free(h_B);
|
||||
}
|
||||
|
||||
if (h_C) {
|
||||
free(h_C);
|
||||
}
|
||||
if (h_C)
|
||||
{
|
||||
free(h_C);
|
||||
}
|
||||
|
||||
checkCudaErrors(cuCtxDestroy(cuContext));
|
||||
checkCudaErrors(cuCtxDestroy(cuContext));
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
// Allocates an array with random float entries.
|
||||
void RandomInit(float *data, int n) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
data[i] = rand() / (float)RAND_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
bool inline findModulePath(const char *module_file, string &module_path,
|
||||
char **argv, string &ptx_source) {
|
||||
char *actual_path = sdkFindFilePath(module_file, argv[0]);
|
||||
|
||||
if (actual_path) {
|
||||
module_path = actual_path;
|
||||
} else {
|
||||
printf("> findModulePath file not found: <%s> \n", module_file);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (module_path.empty()) {
|
||||
printf("> findModulePath could not find file: <%s> \n", module_file);
|
||||
return false;
|
||||
} else {
|
||||
printf("> findModulePath found file at <%s>\n", module_path.c_str());
|
||||
|
||||
if (module_path.rfind(".ptx") != string::npos) {
|
||||
FILE *fp = fopen(module_path.c_str(), "rb");
|
||||
fseek(fp, 0, SEEK_END);
|
||||
int file_size = ftell(fp);
|
||||
char *buf = new char[file_size + 1];
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fread(buf, sizeof(char), file_size, fp);
|
||||
fclose(fp);
|
||||
buf[file_size] = '\0';
|
||||
ptx_source = buf;
|
||||
delete[] buf;
|
||||
void RandomInit(float *data, int n)
|
||||
{
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
data[i] = rand() / (float)RAND_MAX;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 14.00
|
||||
# Visual Studio 2015
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vectorAddMMAP", "vectorAddMMAP_vs2015.vcxproj", "{997E0757-EA74-4A4E-A0FC-47D8C8831A15}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{997E0757-EA74-4A4E-A0FC-47D8C8831A15}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{997E0757-EA74-4A4E-A0FC-47D8C8831A15}.Debug|x64.Build.0 = Debug|x64
|
||||
{997E0757-EA74-4A4E-A0FC-47D8C8831A15}.Release|x64.ActiveCfg = Release|x64
|
||||
{997E0757-EA74-4A4E-A0FC-47D8C8831A15}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,112 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CUDAPropsPath Condition="'$(CUDAPropsPath)'==''">$(VCTargetsPath)\BuildCustomizations</CUDAPropsPath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{997E0757-EA74-4A4E-A0FC-47D8C8831A15}</ProjectGuid>
|
||||
<RootNamespace>vectorAddMMAP_vs2015</RootNamespace>
|
||||
<ProjectName>vectorAddMMAP</ProjectName>
|
||||
<CudaToolkitCustomDir />
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.1.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<IntDir>$(Platform)/$(Configuration)/</IntDir>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules />
|
||||
<CodeAnalysisRuleAssemblies />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'=='x64'">
|
||||
<OutDir>../../bin/win64/$(Configuration)/</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>WIN32;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>./;$(CudaToolkitDir)/include;../../Common;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalDependencies>cuda.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>
|
||||
<AdditionalLibraryDirectories>$(CudaToolkitLibDir);</AdditionalLibraryDirectories>
|
||||
<OutputFile>$(OutDir)/vectorAddMMAP.exe</OutputFile>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_35,compute_35;</CodeGeneration>
|
||||
<AdditionalOptions>-Xcompiler "/wd 4819" %(AdditionalOptions)</AdditionalOptions>
|
||||
<Include>./;../../Common</Include>
|
||||
<Defines>WIN32</Defines>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<Runtime>MTd</Runtime>
|
||||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<Runtime>MT</Runtime>
|
||||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="multidevicealloc_memmap.cpp" />
|
||||
<ClCompile Include="vectorAddMMAP.cpp" />
|
||||
<CudaCompile Include="vectorAdd_kernel.cu">
|
||||
<CompileOut Condition="'$(Platform)'=='x64'">data/%(Filename)64.ptx</CompileOut>
|
||||
<NvccCompilation>ptx</NvccCompilation>
|
||||
</CudaCompile>
|
||||
<ClInclude Include="multidevicealloc_memmap.hpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.1.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -38,7 +38,7 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.1.props" />
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.2.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
|
||||
@@ -67,10 +67,11 @@
|
||||
<OutputFile>$(OutDir)/vectorAddMMAP.exe</OutputFile>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_35,compute_35;</CodeGeneration>
|
||||
<CodeGeneration>compute_35,compute_35;compute_35,sm_35;compute_37,sm_37;compute_50,sm_50;compute_52,sm_52;compute_60,sm_60;compute_61,sm_61;compute_70,sm_70;compute_75,sm_75;compute_80,sm_80;compute_86,sm_86;</CodeGeneration>
|
||||
<AdditionalOptions>-Xcompiler "/wd 4819" %(AdditionalOptions)</AdditionalOptions>
|
||||
<Include>./;../../Common</Include>
|
||||
<Defines>WIN32</Defines>
|
||||
<AdditionalOptions>--threads 0</AdditionalOptions>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
@@ -105,13 +106,13 @@
|
||||
<ClCompile Include="multidevicealloc_memmap.cpp" />
|
||||
<ClCompile Include="vectorAddMMAP.cpp" />
|
||||
<CudaCompile Include="vectorAdd_kernel.cu">
|
||||
<CompileOut Condition="'$(Platform)'=='x64'">data/%(Filename)64.ptx</CompileOut>
|
||||
<NvccCompilation>ptx</NvccCompilation>
|
||||
<CompileOut Condition="'$(Platform)'=='x64'">data/%(Filename)64.fatbin</CompileOut>
|
||||
<NvccCompilation>fatbin</NvccCompilation>
|
||||
</CudaCompile>
|
||||
<ClInclude Include="multidevicealloc_memmap.hpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.1.targets" />
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.2.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.1.props" />
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.2.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" />
|
||||
@@ -63,10 +63,11 @@
|
||||
<OutputFile>$(OutDir)/vectorAddMMAP.exe</OutputFile>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_35,compute_35;</CodeGeneration>
|
||||
<CodeGeneration>compute_35,compute_35;compute_35,sm_35;compute_37,sm_37;compute_50,sm_50;compute_52,sm_52;compute_60,sm_60;compute_61,sm_61;compute_70,sm_70;compute_75,sm_75;compute_80,sm_80;compute_86,sm_86;</CodeGeneration>
|
||||
<AdditionalOptions>-Xcompiler "/wd 4819" %(AdditionalOptions)</AdditionalOptions>
|
||||
<Include>./;../../Common</Include>
|
||||
<Defines>WIN32</Defines>
|
||||
<AdditionalOptions>--threads 0</AdditionalOptions>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
@@ -101,13 +102,13 @@
|
||||
<ClCompile Include="multidevicealloc_memmap.cpp" />
|
||||
<ClCompile Include="vectorAddMMAP.cpp" />
|
||||
<CudaCompile Include="vectorAdd_kernel.cu">
|
||||
<CompileOut Condition="'$(Platform)'=='x64'">data/%(Filename)64.ptx</CompileOut>
|
||||
<NvccCompilation>ptx</NvccCompilation>
|
||||
<CompileOut Condition="'$(Platform)'=='x64'">data/%(Filename)64.fatbin</CompileOut>
|
||||
<NvccCompilation>fatbin</NvccCompilation>
|
||||
</CudaCompile>
|
||||
<ClInclude Include="multidevicealloc_memmap.hpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.1.targets" />
|
||||
<Import Project="$(CUDAPropsPath)\CUDA 11.2.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user