Add in initial support for texture binding of input arrays.

This commit is contained in:
Robert Maynard 2014-12-15 13:27:39 -05:00
parent a509dae909
commit 1b5c5a6ce5
5 changed files with 55 additions and 7 deletions

@ -23,7 +23,7 @@
#include <vtkm/cont/Storage.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
// Disable GCC warnings we check Dax for but Thrust does not.
// Disable GCC warnings we check vtkmfor but Thrust does not.
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push

@ -20,16 +20,15 @@
#ifndef vtk_m_cont_cuda_internal_DeviceAdapterThrust_h
#define vtk_m_cont_cuda_internal_DeviceAdapterThrust_h
#include <vtkm/cont/cuda/internal/MakeThrustIterator.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/ErrorExecution.h>
#include <vtkm/exec/cuda/internal/ArrayPortalFromThrust.h>
#include <vtkm/cont/cuda/internal/MakeThrustIterator.h>
#include <vtkm/exec/internal/ErrorMessageBuffer.h>
#include <vtkm/exec/internal/WorkletInvokeFunctor.h>
// Disable GCC warnings we check Dax for but Thrust does not.
// Disable GCC warnings we check vtkmfor but Thrust does not.
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push

@ -23,7 +23,10 @@
#include <vtkm/Types.h>
#include <vtkm/internal/ExportMacros.h>
// Disable GCC warnings we check Dax for but Thrust does not.
#include <vtkm/exec/cuda/internal/ArrayPortalFromThrust.h>
#include <vtkm/exec/cuda/internal/ArrayPortalFromTexture.h>
// Disable GCC warnings we check vtkmfor but Thrust does not.
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push
@ -56,6 +59,7 @@ namespace detail {
// Tags to specify what type of thrust iterator to use.
struct ThrustIteratorTransformTag { };
struct ThrustIteratorDevicePtrTag { };
struct ThrustIteratorDeviceTextureTag { };
// Traits to help classify what thrust iterators will be used.
template<class IteratorType>
@ -145,6 +149,14 @@ struct IteratorTraits
typedef typename IteratorChooser<PortalType, Tag>::Type IteratorType;
};
template<typename T>
struct IteratorTraits< vtkm::exec::cuda::internal::ConstArrayPortalFromTexture< T > >
{
// typedef vtkm::exec::cuda::internal::ConstArrayPortalFromTexture< T > PortalType;
// typedef ThrustIteratorDeviceTextureTag Tag;
// typedef typename PortalType::IteratorType IteratorType;
};
template<typename T>
VTKM_CONT_EXPORT static
::thrust::cuda::pointer<T>

@ -53,7 +53,26 @@
#include <iterator>
// #include <iostream>
// Disable GCC warnings we check vtkmfor but Thrust does not.
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push
#endif // gcc version >= 4.6
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 2)
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif // gcc version >= 4.2
#endif // gcc && !CUDA
#include <thrust/system/cuda/memory.h>
#include <thrust/iterator/iterator_facade.h>
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif // gcc version >= 4.6
#endif // gcc && !CUDA
namespace
{

@ -24,6 +24,24 @@
#include <iterator>
// Disable GCC warnings we check vtkmfor but Thrust does not.
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push
#endif // gcc version >= 4.6
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 2)
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif // gcc version >= 4.2
#endif // gcc && !CUDA
#include <thrust/system/cuda/memory.h>
#if defined(__GNUC__) && !defined(VTKM_CUDA)
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif // gcc version >= 4.6
#endif // gcc && !CUDA
namespace vtkm {
namespace exec {
namespace cuda {