mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 01:49:02 +00:00
Fix compile time errors
Add DeviceAdapterAlgorithm as an include to the TransferToOpenGL file. Clean up comments in opengl/cuda/internal/TransferToOpenGL.h Add FindGLEW.cmake to the License exepmtion list
This commit is contained in:
parent
a9589c34ea
commit
754bf623f3
@ -73,5 +73,6 @@ licenses.
|
||||
CMake/CheckCXX11Features.cmake
|
||||
CMake/FindBoostHeaders.cmake
|
||||
CMake/FindTBB.cmake
|
||||
CMake/FindGLEW.cmake
|
||||
vtkm/cont/tbb/internal/parallel_sort.h
|
||||
vtkm/testing/OptionParser.h
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include <vtkm/opengl/internal/TransferToOpenGL.h>
|
||||
|
||||
//Usesd for ::thrust::copy
|
||||
#include <thrust/copy.h>
|
||||
#include <thrust/device_ptr.h>
|
||||
|
||||
@ -122,9 +121,8 @@ public:
|
||||
//Copy the data into memory that opengl owns, since we can't
|
||||
//give memory from cuda to opengl
|
||||
|
||||
//Pulled this line from Dax's Copy.h file
|
||||
//To use this function directly, I've added thrust/copy and thrust/device_ptr in the includes above
|
||||
//It also requires MakeThrustIterator to create an thrust iterator from the portals
|
||||
//Perhaps a direct call to thrust copy should be wrapped in a vtkm
|
||||
//compatble function
|
||||
::thrust::copy(vtkm::cont::cuda::internal::IteratorBegin(portal),
|
||||
vtkm::cont::cuda::internal::IteratorEnd(portal),
|
||||
thrust::cuda::pointer<ValueType>(beginPointer));
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <vtkm/cont/ArrayHandle.h>
|
||||
#include <vtkm/cont/StorageBasic.h>
|
||||
#include <vtkm/cont/DeviceAdapterAlgorithm.h>
|
||||
|
||||
#include <vtkm/opengl/internal/OpenGLHeaders.h>
|
||||
#include <vtkm/opengl/internal/BufferTypePicker.h>
|
||||
@ -39,20 +40,23 @@ void CopyFromHandle(
|
||||
GLenum type,
|
||||
DeviceAdapterTag)
|
||||
{
|
||||
//Generic implementation that will work no matter what. We pull the data
|
||||
//back to the control enviornment using PerpareForInput and give an iterator
|
||||
//from the portal to OpenGL to upload to the rendering system
|
||||
//Generic implementation that will work no matter what. We copy the data
|
||||
//in the given handle to a temporary handle using the basic storage tag.
|
||||
//We then ensure the data is available in the control environment by
|
||||
//synchronizing the control array. Last, we steal the array and pass the
|
||||
//iterator to the rendering system
|
||||
const vtkm::Id numberOfValues = handle.GetNumberOfValues();
|
||||
std::size_t size = sizeof(ValueType) * numberOfValues;
|
||||
|
||||
//Copy that data its specialized Storage container to a basic storage
|
||||
//Copy the data from its specialized Storage container to a basic storage
|
||||
vtkm::cont::ArrayHandle<ValueType, vtkm::cont::StorageTagBasic> tmpHandle;
|
||||
vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapterTag>::Copy(handle, tmpHandle);
|
||||
|
||||
//Sync the control array to make sure the most current data is available
|
||||
//Synchronize the arrays to ensure the most current data is available in the
|
||||
//control environment
|
||||
tmpHandle.SyncControlArray();
|
||||
|
||||
//Note that the ArrayHandle is no longer valid after this call
|
||||
//Note that the temporary ArrayHandle is no longer valid after this call
|
||||
ValueType* temporaryStorage = tmpHandle.Internals->ControlArray.StealArray();
|
||||
|
||||
//Detach the current buffer
|
||||
|
@ -184,7 +184,7 @@ private:
|
||||
|
||||
for(std::size_t i=0; i < Size; ++i)
|
||||
{
|
||||
VTKM_TEST_ASSERT(test_equal(expectedValues+=i,returnedValues[i]),
|
||||
VTKM_TEST_ASSERT(test_equal(*(expectedValues+i),returnedValues[i]),
|
||||
"Array Handle failed to transfer properly");
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ private:
|
||||
|
||||
for(std::size_t i=0; i < Size*2; ++i)
|
||||
{
|
||||
VTKM_TEST_ASSERT(test_equal(expectedValues+=i,returnedValues[i]),
|
||||
VTKM_TEST_ASSERT(test_equal(*(expectedValues+i),returnedValues[i]),
|
||||
"Array Handle failed to transfer properly");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user