The following is a description of execution side virtual methods as currently implemented in VTK-m.
The majority of this implementation resides in the following class:
template<typename VirtualObject>
class VirtualObjectCache;
#include <type_traits> | |
template <typename... Ls> | |
struct apply_impl | |
{ | |
using type = std::integral_constant<bool,true>; | |
}; |
cmake_minimum_required(VERSION 3.7) | |
project( DelayDeviceLinking CUDA) | |
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") | |
set(CMAKE_CXX_STANDARD 11) | |
set(CMAKE_CUDA_STANDARD 11) | |
add_library(StaticA STATIC function1.cu) | |
add_library(StaticB STATIC function2.cu) | |
add_library(StaticC STATIC function3.cu) |
#include <iostream> | |
#include <typeinfo> | |
#include <vtkm/cont/ArrayHandle.h> | |
#include <vtkm/cont/RuntimeDeviceInformation.h> | |
#include <vtkm/cont/cuda/DeviceAdapterCuda.h> | |
#include <vtkm/cont/serial/DeviceAdapterSerial.h> | |
#include <vtkm/cont/TryExecute.h> |
| |
Microsoft Visual Studio Solution File, Format Version 12.00 | |
# Visual Studio 14 | |
VisualStudioVersion = 14.0.25420.1 | |
MinimumVisualStudioVersion = 10.0.40219.1 | |
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CudaIssue1867810", "CudaIssue1867810.vcxproj", "{F432C891-06E0-4CBF-9A7F-50E84E64F913}" | |
EndProject | |
Global | |
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
Debug|Win32 = Debug|Win32 |
| |
Microsoft Visual Studio Solution File, Format Version 12.00 | |
# Visual Studio 14 | |
VisualStudioVersion = 14.0.25420.1 | |
MinimumVisualStudioVersion = 10.0.40219.1 | |
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CudaDeviceLink", "CudaDeviceLink.vcxproj", "{97773376-9A12-4CC2-9102-BB1F6D455C71}" | |
EndProject | |
Global | |
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |
Debug|Win32 = Debug|Win32 |
A .vcxproj file containing: | |
<CudaCompile Include="foo.notcu" /> | |
results in a failure to build: | |
nvcc fatal: Don't know what to do with 'C:/path/to/foo.notcu' | |
because CudaCompile does not pass '-x cu' to nvcc. |
If a .vcxproj file contains: | |
<CudaCompile Include="C:\path\to\foo.cu" /> |
cmake_minimum_required(VERSION 3.7) | |
project(SepBug CXX CUDA) | |
#Goal for this example: | |
# show off separable compilation | |
set(CMAKE_CUDA_FLAGS "-gencode arch=compute_50,code=compute_50") | |
set(CMAKE_CUDA_STANDARD 11) | |
set(CMAKE_CXX_STANDARD 11) |
set(srcs | |
cpp_source1.cpp | |
) | |
set(cuda_srcs | |
cuda_source1.cu | |
) | |
set(GPGPU_BUILD_TYPE STATIC) |