Commit b2ea5202 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'update_vtk_master' into pv-master

28c708e9 Merge topic 'update-kwsys' into master
063fb585 Merge topic 'vtkweb-add-file-widgets' into master
7087e30c Add server side FileBrowser
a9d18cdd Merge topic 'remove-range-wrapping' into master
df94b85e Remove range[2] overloads for vtk*DataArray wrappings
b1841bfb Merge topic 'vector-parameter-wrapping-support' into master
f13ab5c6 Merge topic 'context2d-private-deps' into master
8d323852 Merge topic 'StructuredData-GetLinearIndex' into master
3c2603db Merge topic 'amd-radeon-hd-depth-peeling' into master
a9db3e2e fix bug14192: ProbeFilter can't probe an Image with more than 2^31 cells
8f4f5602 Cleanup warning of shadow variable in vtkDepthPeelingPass
f76cf155 Merge topic 'amd-radeon-hd-depth-peeling' into master
3f6e7bc0 Merge topic 'TanglegramFixForVtkWeb' into master
59da79c1 BUG: Use smart pointer for table in vtKTanglegramItem.
3f3fc91d Merge topic 'no_weights_tree' into master
8c418bcd Merge topic 'handle-null-whole-extent' into master
...
parents 3cc03b01 28c708e9
......@@ -88,6 +88,7 @@ SET(VTK_LEGACY_SILENT "@VTK_LEGACY_SILENT@")
SET(VTK_WRAP_PYTHON "@VTK_WRAP_PYTHON@")
SET(VTK_WRAP_TCL "@VTK_WRAP_TCL@")
SET(VTK_WRAP_JAVA "@VTK_WRAP_JAVA@")
SET(VTK_QT_VERSION "@VTK_QT_VERSION@")
# Do not add options or information here that is specific to a
# particular module. Instead set <module>_EXPORT_OPTIONS and/or
......
......@@ -4,6 +4,15 @@ if(POLICY CMP0022)
cmake_policy(SET CMP0022 NEW)
endif()
# Eliminate a warning when building in Windows that relates
# to static linking of Qt executables to qtmain.lib.
# This policy was introduced in CMake version 2.8.11.
# CMake version 2.8.11.2 warns when the policy is not set
# and uses OLD behavior.
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()
project(VTK)
# Objective-C++ compile flags, future CMake versions might make this obsolete
......@@ -63,18 +72,6 @@ mark_as_advanced(CMAKE_RUNTIME_OUTPUT_DIRECTORY
option(BUILD_SHARED_LIBS "Build VTK with shared libraries." ON)
set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
# Choose which multi-threaded parallelism library to use
set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential" CACHE STRING
"Which multi-threaded parallelism implementation to use. Options are Sequential, Kaapi, OpenMP or TBB"
)
set_property(CACHE VTK_SMP_IMPLEMENTATION_TYPE PROPERTY STRINGS Sequential Kaapi OpenMP TBB)
if( NOT ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Kaapi" OR
"${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "TBB" OR
"${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "OpenMP"))
set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential")
endif()
#-----------------------------------------------------------------------------
include(vtkVersion)
set(VTK_VERSION
......
......@@ -2,11 +2,11 @@ vtk_module(vtkChartsCore
GROUPS
StandAlone
DEPENDS
vtkCommonColor
vtkRenderingContext2D
PRIVATE_DEPENDS
vtkCommonColor
vtkInfovisCore # Needed for plot parallel coordinates vtkStringToCategory
TEST_DEPENDS
vtkCommonColor
vtkTestingCore
vtkTestingRendering
vtkViewsContext2D
......
......@@ -26,21 +26,49 @@ set(vtkCommonCore_EXPORT_OPTIONS
VTK_ALL_NEW_OBJECT_FACTORY
)
# Choose which multi-threaded parallelism library to use
set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential" CACHE STRING
"Which multi-threaded parallelism implementation to use. Options are Sequential, Kaapi, OpenMP or TBB"
)
set_property(CACHE VTK_SMP_IMPLEMENTATION_TYPE PROPERTY STRINGS Sequential Kaapi OpenMP TBB)
if( NOT ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Kaapi" OR
"${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "TBB" OR
"${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "OpenMP"))
set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential")
endif()
if ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "TBB")
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})
set(VTK_SMP_IMPLEMENTATION_LIBRARIES ${TBB_LIBRARY})
set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/TBB")
include_directories(${TBB_INCLUDE_DIRS})
# This needs to be here because all modules that include vtkAtomic.h
# need to include tbb/atomic.h
list(APPEND vtkCommonCore_SYSTEM_INCLUDE_DIRS ${TBB_INCLUDE_DIRS})
elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "OpenMP")
find_package(OpenMP REQUIRED)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Sequential")
elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Kaapi")
find_package(XKaapi REQUIRED)
include_directories(${XKAAPI_INCLUDE_DIRS})
set(VTK_SMP_IMPLEMENTATION_LIBRARIES ${XKAAPI_LIBRARIES})
set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Sequential")
elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Sequential")
set(VTK_SMP_IMPLEMENTATION_LIBRARIES)
set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Sequential")
endif()
if(EXISTS ${VTK_SMP_ATOMIC_DIRECTORY}/vtkAtomicInt.cxx)
set(VTK_ATOMIC_CXX_FILE ${VTK_SMP_ATOMIC_DIRECTORY}/vtkAtomicInt.cxx)
else()
set(VTK_ATOMIC_CXX_FILE "")
endif()
configure_file(${VTK_SMP_ATOMIC_DIRECTORY}/vtkAtomicInt.h.in
${CMAKE_CURRENT_BINARY_DIR}/vtkAtomicInt.h COPY_ONLY)
#-----------------------------------------------------------------------------
include_directories(${VTK_SOURCE_DIR}/ThirdParty/utf8/source)
......@@ -116,6 +144,7 @@ SET(Module_SRCS
vtkLargeInteger.cxx
vtkLongArray.cxx
vtkLookupTable.cxx
vtkMappedDataArray.txx
vtkMath.cxx
vtkMinimalStandardRandomSequence.cxx
vtkMultiThreader.cxx
......@@ -138,6 +167,7 @@ SET(Module_SRCS
vtkScalarsToColors.cxx
vtkShortArray.cxx
vtkSignedCharArray.cxx
vtkSimpleCriticalSection.cxx
vtkSmartPointerBase.cxx
vtkSortDataArray.cxx
vtkStdString.cxx
......@@ -165,11 +195,11 @@ SET(Module_SRCS
vtkTypeTemplate.h
vtkType.h
vtkSystemIncludes.h
${VTK_ATOMIC_CXX_FILE}
${CMAKE_CURRENT_BINARY_DIR}/vtkAtomicInt.h
${CMAKE_CURRENT_BINARY_DIR}/vtkConfigure.h
${CMAKE_CURRENT_BINARY_DIR}/vtkMathConfigure.h
${CMAKE_CURRENT_BINARY_DIR}/vtkVersionMacros.h
${VTK_SMP_IMPLEMENTATION_TYPE}/vtkAtomicInt32.cxx
${VTK_SMP_IMPLEMENTATION_TYPE}/vtkAtomicInt64.cxx
)
set(${vtk-module}_HDRS
......@@ -182,13 +212,12 @@ set(${vtk-module}_HDRS
vtkArrayIteratorTemplateImplicit.txx
vtkArrayPrint.h
vtkArrayPrint.txx
vtkAtomicInt32.h
vtkAtomicInt64.h
vtkAutoInit.h
vtkDataArrayIteratorMacro.h
vtkDataArrayTemplateImplicit.txx
vtkIOStreamFwd.h
vtkInformationInternals.h
vtkMappedDataArray.h
vtkMathUtilities.h
vtkNew.h
vtkSetGet.h
......@@ -451,6 +480,7 @@ set_source_files_properties(
vtkOStrStreamWrapper.cxx
vtkOStreamWrapper.cxx
vtkOldStyleCallbackCommand.cxx
vtkSimpleCriticalSection.cxx
vtkSmartPointerBase.cxx
vtkStdString.cxx
vtkTimeStamp.cxx
......@@ -468,8 +498,6 @@ set_source_files_properties(
vtkArrayIteratorTemplateImplicit.txx
vtkArrayPrint.h
vtkArrayPrint.txx
vtkAtomicInt32.h
vtkAtomicInt64.h
vtkAutoInit.h
vtkDataArrayTemplate.txx
vtkDataArrayTemplateImplicit.txx
......@@ -477,6 +505,7 @@ set_source_files_properties(
vtkIOStreamFwd.h
vtkInformationInternals.h
vtkMathUtilities.h
vtkMappedDataArray.txx
vtkNew.h
vtkSetGet.h
vtkSmartPointer.h
......@@ -499,8 +528,8 @@ set_source_files_properties(
vtkMathConfigure.h
vtkVersionMacros.h
vtkTypeTemplate.h
${VTK_SMP_IMPLEMENTATION_TYPE}/vtkAtomicInt32.cxx
${VTK_SMP_IMPLEMENTATION_TYPE}/vtkAtomicInt64.cxx
${CMAKE_CURRENT_BINARY_DIR}/vtkAtomicInt.h
${VTK_ATOMIC_CXX_FILE}
WRAP_EXCLUDE
)
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAtomicInt64.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkAtomicInt32.h"
#include <stdint.h>
#include <kaapi_atomic.h>
struct vtkAtomicInt32Internal
{
kaapi_atomic32_t Value;
};
vtkAtomicInt32::~vtkAtomicInt32()
{
delete this->Internal;
this->Internal = 0;
}
void vtkAtomicInt32::Initialize(const int val)
{
this->Internal = new vtkAtomicInt32Internal;
this->Set(val);
}
void vtkAtomicInt32::Set(int value)
{
this->Internal->Value._counter = value;
}
int vtkAtomicInt32::Get() const
{
return this->Internal->Value._counter;
}
int vtkAtomicInt32::Increment()
{
return KAAPI_ATOMIC_INCR(&this->Internal->Value);
}
int vtkAtomicInt32::Add(int val)
{
return KAAPI_ATOMIC_ADD(&this->Internal->Value, val);
}
int vtkAtomicInt32::Decrement()
{
return KAAPI_ATOMIC_DECR(&this->Internal->Value);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAtomicInt64.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkAtomicInt64.h"
#include <stdint.h>
#include <kaapi_atomic.h>
struct vtkAtomicInt64Internal
{
kaapi_atomic64_t Value;
};
vtkAtomicInt64::~vtkAtomicInt64()
{
delete this->Internal;
this->Internal = 0;
}
void vtkAtomicInt64::Initialize(const vtkTypeInt64 val)
{
this->Internal = new vtkAtomicInt64Internal;
this->Set(val);
}
void vtkAtomicInt64::Set(vtkTypeInt64 value)
{
this->Internal->Value._counter = value;
}
vtkTypeInt64 vtkAtomicInt64::Get() const
{
return this->Internal->Value._counter;
}
vtkTypeInt64 vtkAtomicInt64::Increment()
{
return KAAPI_ATOMIC_INCR64(&this->Internal->Value);
}
vtkTypeInt64 vtkAtomicInt64::Add(vtkTypeInt64 val)
{
return KAAPI_ATOMIC_ADD64(&this->Internal->Value, val);
}
vtkTypeInt64 vtkAtomicInt64::Decrement()
{
return KAAPI_ATOMIC_DECR64(&this->Internal->Value);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAtomicInt64.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkAtomicInt64.h"
#include "vtkAtomicInt64BasicImpl.h"
vtkAtomicInt64::~vtkAtomicInt64()
{
delete this->Internal;
this->Internal = 0;
}
void vtkAtomicInt64::Initialize(const vtkTypeInt64 val)
{
this->Internal = new vtkAtomicInt64Internal;
this->Set(val);
}
void vtkAtomicInt64::Set(vtkTypeInt64 value)
{
#if defined(_OPENMP) && _OPENMP >= 201107
#pragma omp atomic write
this->Internal->Value = value;
#else
this->Internal->Value = value;
#endif
}
vtkTypeInt64 vtkAtomicInt64::Get() const
{
#if defined(_OPENMP) && _OPENMP >= 201107
vtkTypeInt64 val;
#pragma omp flush
#pragma omp atomic read
val = this->Internal->Value;
return val;
#else
return this->Internal->Value;
#endif
}
vtkTypeInt64 vtkAtomicInt64::Increment()
{
#if defined(_OPENMP) && _OPENMP >= 201107
vtkTypeInt64 val;
#pragma omp atomic capture
val = ++this->Internal->Value;
return val;
#else
return vtkAtomicInt64Increment(
&this->Internal->Value,
this->Internal->AtomicInt64CritSec);
#endif
}
vtkTypeInt64 vtkAtomicInt64::Add(vtkTypeInt64 val)
{
#if defined(_OPENMP) && _OPENMP >= 201107
vtkTypeInt64 val2;
#pragma omp atomic capture
{ this->Internal->Value += val; val2 = this->Internal->Value; }
return val2;
#else
return vtkAtomicInt64Add(
&this->Internal->Value,
val,
this->Internal->AtomicInt64CritSec);
#endif
}
vtkTypeInt64 vtkAtomicInt64::Decrement()
{
#if defined(_OPENMP) && _OPENMP >= 201107
vtkTypeInt64 val;
#pragma omp atomic capture
val = --this->Internal->Value;
return val;
#else
return vtkAtomicInt64Decrement(
&this->Internal->Value,
this->Internal->AtomicInt64CritSec);
#endif
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAtomicInt.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm 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.
=========================================================================*/
#include "vtkAtomicInt.h"
#if !defined(VTK_HAS_ATOMIC64) || !defined(VTK_HAS_ATOMIC32)
# include "vtkSimpleCriticalSection.h"
#endif
namespace detail
{
#if !defined(VTK_HAS_ATOMIC64)
vtkAtomicIntImpl<vtkTypeInt64>::vtkAtomicIntImpl()
{
this->AtomicInt64CritSec = new vtkSimpleCriticalSection;
}
vtkAtomicIntImpl<vtkTypeInt64>::~vtkAtomicIntImpl()
{
delete this->AtomicInt64CritSec;
}
vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator++()
{
if (!this->AtomicInt64CritSec)
{
return 0;
}
vtkTypeInt64 val;
this->AtomicInt64CritSec->Lock();
val = ++this->Value;
this->AtomicInt64CritSec->Unlock();
return val;
}
vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator--()
{
if (!this->AtomicInt64CritSec)
{
return 0;
}
vtkTypeInt64 val;
this->AtomicInt64CritSec->Lock();
val = --this->Value;
this->AtomicInt64CritSec->Unlock();
return val;
}
vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator+=(vtkTypeInt64 val)
{
if (!this->AtomicInt64CritSec)
{
return 0;
}
vtkTypeInt64 val2;
this->AtomicInt64CritSec->Lock();
val2 = (this->Value += val);
this->AtomicInt64CritSec->Unlock();
return val2;
}
vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::load() const
{
if (!this->AtomicInt64CritSec)
{
return 0;
}
vtkTypeInt64 val;
this->AtomicInt64CritSec->Lock();
val = this->Value;
this->AtomicInt64CritSec->Unlock();
return val;
}
void vtkAtomicIntImpl<vtkTypeInt64>::store(vtkTypeInt64 val)
{
if (!this->AtomicInt64CritSec)
{
return;
}
this->AtomicInt64CritSec->Lock();
this->Value = val;
this->AtomicInt64CritSec->Unlock();
}
#endif // !defined(VTK_HAS_ATOMIC64)
#if !defined(VTK_HAS_ATOMIC32)
vtkAtomicIntImpl<vtkTypeInt32>::vtkAtomicIntImpl()
{
this->AtomicInt32CritSec = new vtkSimpleCriticalSection;
}
vtkAtomicIntImpl<vtkTypeInt32>::~vtkAtomicIntImpl()
{
delete this->AtomicInt32CritSec;
}
vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator++()
{
if (!this->AtomicInt32CritSec)
{
return 0;
}
vtkTypeInt32 val;
this->AtomicInt32CritSec->Lock();
val = ++this->Value;
this->AtomicInt32CritSec->Unlock();
return val;
}
vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator--()
{
if (!this->AtomicInt32CritSec)
{
return 0;
}
vtkTypeInt32 val;
this->AtomicInt32CritSec->Lock();
val = --this->Value;
this->AtomicInt32CritSec->Unlock();
return val;
}
vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator+=(vtkTypeInt32 val)
{
if (!this->AtomicInt32CritSec)
{
return 0;
}
vtkTypeInt32 val2;
this->AtomicInt32CritSec->Lock();
val2 = (this->Value += val);
this->AtomicInt32CritSec->Unlock();
return val2;
}
vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::load() const
{
if (!this->AtomicInt32CritSec)
{
return 0;
}
vtkTypeInt32 val;
this->AtomicInt32CritSec->Lock();
val = this->Value;
this->AtomicInt32CritSec->Unlock();
return val;
}
void vtkAtomicIntImpl<vtkTypeInt32>::store(vtkTypeInt32 val)
{
if (!this->AtomicInt32CritSec)
{
return;
}
this->AtomicInt32CritSec->Lock();
this->Value = val;
this->AtomicInt32CritSec->Unlock();
}
#endif // !defined(VTK_HAS_ATOMIC32)
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkAtomicInt.h