Merge remote-tracking branch 'upstream/master' into StreamingArray
This commit is contained in:
commit
b27190e54b
@ -64,7 +64,8 @@ set(VTKm_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
|
||||
set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@")
|
||||
set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@")
|
||||
set(VTKm_ENABLE_OPENGL_INTEROP "@VTKm_ENABLE_OPENGL_INTEROP@")
|
||||
set(VTKm_BUILD_RENDERING "@VTKm_BUILD_RENDERING@")
|
||||
set(VTKm_ENABLE_OSMESA "@VTKm_ENABLE_OSMESA@")
|
||||
set(VTKm_ENABLE_RENDERING "@VTKm_ENABLE_RENDERING@")
|
||||
|
||||
# Load the library exports, but only if not compiling VTK-m itself
|
||||
set_and_check(VTKm_CONFIG_DIR "@PACKAGE_VTKm_INSTALL_CONFIG_DIR@")
|
||||
|
@ -130,19 +130,26 @@ macro(vtkm_configure_component_OpenGL)
|
||||
# succeed even if the OSMesa configuration fails.
|
||||
vtkm_configure_component_OSMesa()
|
||||
|
||||
find_package(OpenGL ${VTKm_FIND_PACKAGE_QUIETLY})
|
||||
if(NOT VTKm_OSMesa_FOUND)
|
||||
find_package(OpenGL ${VTKm_FIND_PACKAGE_QUIETLY})
|
||||
|
||||
vtkm_finish_configure_component(OpenGL
|
||||
DEPENDENT_VARIABLES VTKm_Base_FOUND OPENGL_FOUND
|
||||
ADD_INCLUDES ${OPENGL_INCLUDE_DIR}
|
||||
ADD_LIBRARIES ${OPENGL_LIBRARIES}
|
||||
)
|
||||
vtkm_finish_configure_component(OpenGL
|
||||
DEPENDENT_VARIABLES VTKm_Base_FOUND OPENGL_FOUND
|
||||
ADD_INCLUDES ${OPENGL_INCLUDE_DIR}
|
||||
ADD_LIBRARIES ${OPENGL_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
# OSMesa comes with its own implementation of OpenGL. So if OSMesa has been
|
||||
# found, then simply report that OpenGL has been found and use the includes
|
||||
# and libraries already added for OSMesa.
|
||||
set(VTKm_OpenGL_FOUND TRUE)
|
||||
endif()
|
||||
endmacro(vtkm_configure_component_OpenGL)
|
||||
|
||||
macro(vtkm_configure_component_OSMesa)
|
||||
vtkm_configure_component_Base()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
if (VTKm_ENABLE_OSMESA)
|
||||
find_package(MESA ${VTKm_FIND_PACKAGE_QUIETLY})
|
||||
|
||||
vtkm_finish_configure_component(OSMesa
|
||||
@ -150,8 +157,6 @@ macro(vtkm_configure_component_OSMesa)
|
||||
ADD_INCLUDES ${OSMESA_INCLUDE_DIR}
|
||||
ADD_LIBRARIES ${OSMESA_LIBRARY}
|
||||
)
|
||||
else()
|
||||
vtkm_configure_component_message("OSMesa not supported on this platform.")
|
||||
endif()
|
||||
endmacro(vtkm_configure_component_OSMesa)
|
||||
|
||||
@ -204,14 +209,14 @@ macro(vtkm_configure_component_Interop)
|
||||
endmacro(vtkm_configure_component_Interop)
|
||||
|
||||
macro(vtkm_configure_component_Rendering)
|
||||
if(VTKm_BUILD_RENDERING)
|
||||
if(VTKm_ENABLE_RENDERING)
|
||||
vtkm_configure_component_OpenGL()
|
||||
vtkm_configure_component_EGL()
|
||||
vtkm_configure_component_OSMesa()
|
||||
endif()
|
||||
|
||||
vtkm_finish_configure_component(Rendering
|
||||
DEPENDENT_VARIABLES VTKm_BUILD_RENDERING VTKm_Base_FOUND
|
||||
DEPENDENT_VARIABLES VTKm_ENABLE_RENDERING VTKm_Base_FOUND
|
||||
ADD_LIBRARIES vtkm_rendering
|
||||
)
|
||||
endmacro(vtkm_configure_component_Rendering)
|
||||
@ -261,8 +266,9 @@ macro(vtkm_configure_component_CUDA)
|
||||
#---------------------------------------------------------------------------
|
||||
# Setup build flags for CUDA to have C++11 support
|
||||
#---------------------------------------------------------------------------
|
||||
if(NOT MSVC)
|
||||
if(NOT MSVC AND NOT VTKM_CUDA_CXX11_FLAGS_ADDED)
|
||||
list(APPEND CUDA_NVCC_FLAGS --std c++11)
|
||||
set(VTKM_CUDA_CXX11_FLAGS_ADDED TRUE CACHE INTERNAL "cuda C++11 flags added")
|
||||
endif()
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
@ -288,7 +294,10 @@ macro(vtkm_configure_component_CUDA)
|
||||
# 4 - maxwell
|
||||
# - Uses: --generate-code arch=compute_50,code=compute_50
|
||||
# - Uses: --generate-code arch=compute_52,code=compute_52
|
||||
# 5 - all
|
||||
# 5 - pascal
|
||||
# - Uses: --generate-code arch=compute_60,code=compute_60
|
||||
# - Uses: --generate-code arch=compute_61,code=compute_61
|
||||
# 6 - all
|
||||
# - Uses: --generate-code arch=compute_20,code=compute_20
|
||||
# - Uses: --generate-code arch=compute_30,code=compute_30
|
||||
# - Uses: --generate-code arch=compute_35,code=compute_35
|
||||
@ -301,13 +310,17 @@ macro(vtkm_configure_component_CUDA)
|
||||
|
||||
#detect what the propery is set too
|
||||
if(VTKm_CUDA_Architecture STREQUAL "native")
|
||||
if(NOT VTKM_CUDA_NATIVE_EXE_PROCESS_RAN)
|
||||
|
||||
if(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT)
|
||||
#Use the cached value
|
||||
list(APPEND CUDA_NVCC_FLAGS ${VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT})
|
||||
else()
|
||||
|
||||
#run execute_process to do auto_detection
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cxx")
|
||||
set(args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
|
||||
else()
|
||||
set(args "-ccbin" "${CUDA_HOST_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cxx")
|
||||
set(args "-ccbin" "${CUDA_HOST_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cu")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
@ -319,11 +332,13 @@ macro(vtkm_configure_component_CUDA)
|
||||
#find the position of the "--generate-code" output. With some compilers such as
|
||||
#msvc we get compile output plus run output. So we need to strip out just the
|
||||
#run output
|
||||
message(STATUS "run_output: ${run_output}")
|
||||
string(FIND "${run_output}" "--generate-code" position)
|
||||
string(SUBSTRING "${run_output}" ${position} -1 run_output)
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${run_output}")
|
||||
set(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN TRUE CACHE INTERNAL
|
||||
"We have correctly detected the device type(s) for cuda[native]")
|
||||
|
||||
list(APPEND CUDA_NVCC_FLAGS ${run_output})
|
||||
set(VTKM_CUDA_NATIVE_EXE_PROCESS_RAN_OUTPUT ${run_output} CACHE INTERNAL
|
||||
"device type(s) for cuda[native]")
|
||||
else()
|
||||
set(VTKm_CUDA_Architecture "fermi")
|
||||
vtkm_configure_component_message(
|
||||
@ -343,12 +358,17 @@ Falling back to fermi, please manually specify if you want something else.")
|
||||
elseif(VTKm_CUDA_Architecture STREQUAL "maxwell")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_50,code=compute_50")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_52,code=compute_52")
|
||||
elseif(VTKm_CUDA_Architecture STREQUAL "pascal")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_60,code=compute_60")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_61,code=compute_61")
|
||||
elseif(VTKm_CUDA_Architecture STREQUAL "all")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_20,code=compute_20")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_30,code=compute_30")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_35,code=compute_35")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_50,code=compute_50")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_52,code=compute_52")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_60,code=compute_60")
|
||||
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --generate-code arch=compute_61,code=compute_61")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
|
49
CMake/VTKmDetectCUDAVersion.cu
Normal file
49
CMake/VTKmDetectCUDAVersion.cu
Normal file
@ -0,0 +1,49 @@
|
||||
//=============================================================================
|
||||
//
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
//
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
// Copyright 2015 Sandia Corporation.
|
||||
// Copyright 2015 UT-Battelle, LLC.
|
||||
// Copyright 2015 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
// Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
// this software.
|
||||
//
|
||||
//=============================================================================
|
||||
#include <cuda.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <cstdio>
|
||||
int main()
|
||||
{
|
||||
int count = 0;
|
||||
if (cudaSuccess != cudaGetDeviceCount(&count)) return 1;
|
||||
if (count == 0) return 1;
|
||||
|
||||
int prev_arch = 0;
|
||||
for (int device = 0; device < count; ++device)
|
||||
{
|
||||
cudaDeviceProp prop;
|
||||
if (cudaSuccess == cudaGetDeviceProperties(&prop, device))
|
||||
{
|
||||
int arch = (prop.major * 10) + prop.minor;
|
||||
int compute_level = arch;
|
||||
//arch 21 has no equivalent compute level.
|
||||
if(compute_level == 21) { compute_level = 20; }
|
||||
|
||||
//handle multiple cards of the same architecture
|
||||
if(arch == prev_arch) { continue; }
|
||||
prev_arch = arch;
|
||||
printf("--generate-code arch=compute_%d,code=sm_%d ", compute_level, arch);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
//=============================================================================
|
||||
//
|
||||
// Copyright (c) Kitware, Inc.
|
||||
// All rights reserved.
|
||||
// See LICENSE.txt for details.
|
||||
//
|
||||
// This software is distributed WITHOUT ANY WARRANTY; without even
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//
|
||||
// Copyright 2015 Sandia Corporation.
|
||||
// Copyright 2015 UT-Battelle, LLC.
|
||||
// Copyright 2015 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
||||
// the U.S. Government retains certain rights in this software.
|
||||
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
||||
// Laboratory (LANL), the U.S. Government retains certain rights in
|
||||
// this software.
|
||||
//
|
||||
//=============================================================================
|
||||
#include <cuda.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
std::map< int, std::string > arch_to_compute;
|
||||
arch_to_compute[11] = "compute_11";
|
||||
arch_to_compute[12] = "compute_12";
|
||||
arch_to_compute[13] = "compute_13";
|
||||
arch_to_compute[20] = "compute_20";
|
||||
arch_to_compute[21] = "compute_20";
|
||||
arch_to_compute[30] = "compute_30";
|
||||
arch_to_compute[32] = "compute_32";
|
||||
arch_to_compute[35] = "compute_35";
|
||||
arch_to_compute[37] = "compute_37";
|
||||
arch_to_compute[50] = "compute_50";
|
||||
arch_to_compute[52] = "compute_52";
|
||||
arch_to_compute[53] = "compute_53";
|
||||
|
||||
cudaError_t err;
|
||||
int nDevices;
|
||||
err = cudaGetDeviceCount(&nDevices);
|
||||
if(err != cudaSuccess || nDevices < 1)
|
||||
{ //return failure if no cuda devices found
|
||||
return 1;
|
||||
}
|
||||
|
||||
//iterate over the devices outputting a string that would be the compile
|
||||
//flags needed to target all gpu's on this machine.
|
||||
int prev_arch = 0;
|
||||
for (int i = 0; i < nDevices; i++)
|
||||
{
|
||||
cudaDeviceProp prop;
|
||||
err = cudaGetDeviceProperties(&prop, i);
|
||||
if(err != cudaSuccess)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//convert 2.1 to 21, 3.5 to 35, etc
|
||||
int arch = (prop.major * 10) + prop.minor;
|
||||
|
||||
//if we have multiple gpu's make sure they have different arch's
|
||||
//instead of adding the same compile options multiple times
|
||||
if(prev_arch == arch)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
prev_arch = arch;
|
||||
|
||||
//look up the closest virtual architecture, if the arch we are building
|
||||
//for is not found
|
||||
if(arch_to_compute.find(arch) != arch_to_compute.end() )
|
||||
{
|
||||
std::string compute_level = arch_to_compute[arch];
|
||||
std::cout << "--generate-code arch=" << compute_level
|
||||
<< ",code=sm_"<< arch << " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
//if not found default to known highest arch, and compile to a virtual
|
||||
//arch instead of a known sm.
|
||||
std::string compute_level = arch_to_compute.rbegin()->second;
|
||||
std::cout << "--generate-code arch=" << compute_level
|
||||
<< ",code=" << compute_level << " ";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -18,25 +18,12 @@
|
||||
## this software.
|
||||
##============================================================================
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
#setup policy rules for CMake 3.0 while we have a minimum required of 2.8.X
|
||||
if(POLICY CMP0025)
|
||||
cmake_policy(SET CMP0025 NEW)#Clang and AppleClang are different compiler ids
|
||||
cmake_policy(SET CMP0042 NEW)#Enable RPATH on OSX
|
||||
endif()
|
||||
|
||||
#setup policy rules for CMake 3.1 while we have a minimum required of 2.8.X
|
||||
if(POLICY CMP0054)
|
||||
cmake_policy(SET CMP0053 NEW)#Enable faster parser engine
|
||||
cmake_policy(SET CMP0054 NEW)#simplify if() argument expansion
|
||||
endif()
|
||||
|
||||
#setup policy rules for CMake 3.3 while we have a minimum required of 2.8.X
|
||||
if(POLICY CMP0063)
|
||||
cmake_policy(SET CMP0058 NEW)#All dependencies on built targets are declared
|
||||
cmake_policy(SET CMP0063 NEW)#Honor visibility properties for all targets
|
||||
endif()
|
||||
#We require CMake 3.3 for Modern CMake which as features such as:
|
||||
# - Better custom command support
|
||||
# - Better acting if() argument expansion
|
||||
# - Support for usage requirements
|
||||
# -
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
|
||||
project (VTKm)
|
||||
|
||||
@ -75,16 +62,11 @@ endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Add flag to enable C++11 support.
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.1")
|
||||
option(VTKm_ENABLE_CXX11 "Build VTKm using C++11" ON)
|
||||
else()
|
||||
set(VTKm_ENABLE_CXX11 OFF)
|
||||
endif()
|
||||
# If the user has requested C++11, propagate that information to CMake
|
||||
if (VTKm_ENABLE_CXX11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_EXTENSIONS False)
|
||||
# Unless the user has explicitly stated to compile with a different standard
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
set(CMAKE_CXX_EXTENSIONS False)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -103,12 +85,13 @@ include(CMake/VTKmCompilerExtras.cmake)
|
||||
# Configurable Options
|
||||
option(VTKm_ENABLE_CUDA "Enable Cuda support" OFF)
|
||||
option(VTKm_ENABLE_TBB "Enable TBB support" OFF)
|
||||
option(VTKm_ENABLE_RENDERING "Enable rendering library" ON)
|
||||
option(VTKm_ENABLE_TESTING "Enable VTKm Testing" ON)
|
||||
option(VTKm_ENABLE_BENCHMARKS "Enable VTKm Benchmarking" OFF)
|
||||
option(VTKm_ENABLE_OSMESA "Enable creating the OSMesa canvas" OFF)
|
||||
|
||||
option(VTKm_BUILD_DOCUMENTATION "Build Doxygen documentation" OFF)
|
||||
option(VTKm_BUILD_EXAMPLES "Build examples" OFF)
|
||||
option(VTKm_BUILD_RENDERING "Build rendering" OFF)
|
||||
|
||||
option(VTKm_USE_DOUBLE_PRECISION
|
||||
"Use double precision for floating point calculations"
|
||||
|
@ -31,7 +31,7 @@ add_subdirectory(isosurface)
|
||||
add_subdirectory(multi_backend)
|
||||
add_subdirectory(streamline)
|
||||
add_subdirectory(tetrahedra)
|
||||
if(VTKm_BUILD_RENDERING)
|
||||
if(VTKm_ENABLE_RENDERING)
|
||||
add_subdirectory(rendering)
|
||||
endif(VTKm_BUILD_RENDERING)
|
||||
endif()
|
||||
|
||||
|
@ -78,7 +78,7 @@ int main(int argc, char* argv[])
|
||||
fieldName = "SCALARS:pointvar";
|
||||
}
|
||||
|
||||
typedef vtkm::rendering::MapperRayTracer<VTKM_DEFAULT_DEVICE_ADAPTER_TAG> Mapper;
|
||||
typedef vtkm::rendering::MapperRayTracer Mapper;
|
||||
typedef vtkm::rendering::CanvasRayTracer Canvas;
|
||||
|
||||
// Set up a camera for rendering the input data
|
||||
|
@ -60,9 +60,9 @@ endif(VTKm_ENABLE_OPENGL_INTEROP)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build rendering
|
||||
if(VTKm_BUILD_RENDERING)
|
||||
if(VTKm_ENABLE_RENDERING)
|
||||
add_subdirectory(rendering)
|
||||
endif(VTKm_BUILD_RENDERING)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#add the control and exec folders
|
||||
|
@ -533,7 +533,6 @@ protected:
|
||||
std::string arrayName, dataType;
|
||||
this->DataFile->Stream >> arrayName >> numComponents >> numTuples
|
||||
>> dataType >> std::ws;
|
||||
|
||||
this->DoSkipDynamicArray(dataType, numTuples, numComponents);
|
||||
}
|
||||
}
|
||||
@ -600,9 +599,25 @@ protected:
|
||||
void DoSkipDynamicArray(std::string dataType, std::size_t numElements,
|
||||
vtkm::IdComponent numComponents)
|
||||
{
|
||||
vtkm::io::internal::DataType typeId = vtkm::io::internal::DataTypeId(dataType);
|
||||
vtkm::io::internal::SelectTypeAndCall(typeId, numComponents,
|
||||
SkipDynamicArray(this, numElements));
|
||||
// string is unsupported for SkipDynamicArray, so it requires some
|
||||
// special handling
|
||||
if(dataType == "string")
|
||||
{
|
||||
const vtkm::Id stringCount =
|
||||
numComponents * static_cast<vtkm::Id>(numElements);
|
||||
for(vtkm::Id i = 0; i < stringCount; ++i)
|
||||
{
|
||||
std::string trash;
|
||||
this->DataFile->Stream >> trash;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkm::io::internal::DataType typeId = vtkm::io::internal::DataTypeId(dataType);
|
||||
vtkm::io::internal::SelectTypeAndCall(typeId, numComponents,
|
||||
SkipDynamicArray(this, numElements));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DoReadDynamicArray(std::string dataType, std::size_t numElements,
|
||||
|
@ -128,7 +128,7 @@ if(VTKm_OpenGL_FOUND)
|
||||
vtkm_configure_component_EGL()
|
||||
if(VTKm_EGL_FOUND)
|
||||
list(APPEND headers ${egl_headers})
|
||||
list(APPEND sources ${egl_headers})
|
||||
list(APPEND sources ${egl_sources})
|
||||
endif()
|
||||
|
||||
vtkm_configure_component_GLFW()
|
||||
@ -137,6 +137,12 @@ if(VTKm_OpenGL_FOUND)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(VTKm_ENABLE_OSMESA AND NOT VTKm_OSMesa_FOUND)
|
||||
message(SEND_ERROR "OSMesa was requested by not properly configured.
|
||||
Either make sure the OSMesa headers and library are properly found or set
|
||||
VTKm_ENABLE_OSMESA to OFF.")
|
||||
endif()
|
||||
|
||||
vtkm_declare_headers(${headers})
|
||||
|
||||
if (VTKm_ENABLE_CUDA)
|
||||
|
@ -38,6 +38,7 @@ namespace rendering {
|
||||
// 6. added explicit casts to remove compiler warnings
|
||||
// 7. renamed a function argument to avoid a shadowing warning
|
||||
// 8. default argument removed (moved to header prototype declaration)
|
||||
// 9. initialized info.width/height to remove unititalized value warnings
|
||||
// ----------------------------------------------------------------------------
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@ -299,6 +300,7 @@ int DecodePNG(std::vector<unsigned char>& out_image, unsigned long& image_width,
|
||||
void decode(std::vector<unsigned char>& out, const unsigned char* in, std::size_t size, bool convert_to_rgba32_flag)
|
||||
{
|
||||
error = 0;
|
||||
info.width = 0; info.height = 0; //changed if header read successfully
|
||||
if(size == 0 || in == 0) { error = 48; return; } //the given data is empty
|
||||
readPngHeader(&in[0], size); if(error) return;
|
||||
std::size_t pos = 33; //first byte of the first chunk after the header
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include <vtkm/rendering/raytracing/RayTracingTypeDefs.h>
|
||||
|
||||
#include <limits>
|
||||
#include <cstring>
|
||||
|
||||
namespace vtkm {
|
||||
namespace rendering {
|
||||
|
@ -19,6 +19,7 @@
|
||||
//============================================================================
|
||||
#ifndef vtk_m_rendering_raytracing_TriagnleIntersector_h
|
||||
#define vtk_m_rendering_raytracing_TriagnleIntersector_h
|
||||
#include <cstring>
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/ArrayHandleCompositeVector.h>
|
||||
#include <vtkm/cont/Timer.h>
|
||||
|
@ -155,7 +155,7 @@ public:
|
||||
|/ |/ |/
|
||||
0----------1 |__ x
|
||||
*/
|
||||
vtkm::Vec<vtkm::Float32,3> bottomLeft;
|
||||
vtkm::Vec<vtkm::Float32,3> bottomLeft(0);
|
||||
bool newCell = true;
|
||||
//check to see if we left the cell
|
||||
vtkm::Float32 tx = 0.f;
|
||||
|
@ -33,7 +33,7 @@ namespace {
|
||||
|
||||
void RenderTests()
|
||||
{
|
||||
typedef vtkm::rendering::MapperGL<VTKM_DEFAULT_DEVICE_ADAPTER_TAG> M;
|
||||
typedef vtkm::rendering::MapperGL M;
|
||||
typedef vtkm::rendering::CanvasEGL C;
|
||||
typedef vtkm::rendering::View3D V3;
|
||||
typedef vtkm::rendering::View2D V2;
|
||||
|
@ -19,16 +19,17 @@
|
||||
//============================================================================
|
||||
#include <vtkm/Bounds.h>
|
||||
#include <vtkm/cont/testing/MakeTestDataSet.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <vtkm/rendering/Actor.h>
|
||||
#include <vtkm/rendering/CanvasGL.h>
|
||||
#include <vtkm/rendering/MapperGL.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <vtkm/rendering/Scene.h>
|
||||
#include <vtkm/rendering/View2D.h>
|
||||
#include <vtkm/rendering/View3D.h>
|
||||
#include <vtkm/cont/DeviceAdapter.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
#include <vtkm/rendering/testing/RenderTest.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
static const vtkm::Id WIDTH = 512, HEIGHT = 512;
|
||||
|
Loading…
Reference in New Issue
Block a user