Commit c3c8d0fd authored by Allison Vacanti's avatar Allison Vacanti
Browse files

Refactor ArrayHandleCompositeVector to simplify usage and impl.

- Use tao::tuple instead of FunctionInterface to hold array/portal
  collections.
- Type signatures are simplified. Now just use:
  - ArrayHandleCompositeVector<ArrayT1, ArrayT2, ...>
  - make_ArrayHandleCompositeVector(array1, array2, ...)
  instead of relying on helper structs to determine types.
- No longer support component selection from an input array. All
  input arrays must have the same ValueType (See ArrayHandleSwizzle
  and ArrayHandleExtractComponent as the replacements for these
  usecases.
parent ec88b7dd
This diff is collapsed.
......@@ -111,12 +111,11 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
// Special implementation for composite vectors.
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::Float32, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::Vec<vtkm::Float32, 3>(vtkm::cont::ArrayHandle<vtkm::Float32>,
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>)>::StorageTag>& input,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>>::StorageTag>& input,
vtkm::cont::RuntimeDeviceTracker tracker)
{
return detail::ArrayRangeComputeImpl(input, tracker);
......@@ -124,12 +123,11 @@ vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::Float64, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::Vec<vtkm::Float64, 3>(vtkm::cont::ArrayHandle<vtkm::Float64>,
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>)>::StorageTag>& input,
vtkm::cont::ArrayHandle<vtkm::Float64>>::StorageTag>& input,
vtkm::cont::RuntimeDeviceTracker tracker)
{
return detail::ArrayRangeComputeImpl(input, tracker);
......
......@@ -109,23 +109,21 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault,
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::Float32, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::Vec<vtkm::Float32, 3>(vtkm::cont::ArrayHandle<vtkm::Float32>,
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>)>::StorageTag>& input,
vtkm::cont::ArrayHandle<vtkm::Float32>>::StorageTag>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
VTKM_CONT_EXPORT
VTKM_CONT
vtkm::cont::ArrayHandle<vtkm::Range> ArrayRangeCompute(
const vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::Float64, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::Vec<vtkm::Float64, 3>(vtkm::cont::ArrayHandle<vtkm::Float64>,
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>,
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>)>::StorageTag>& input,
vtkm::cont::ArrayHandle<vtkm::Float64>>::StorageTag>& input,
vtkm::cont::RuntimeDeviceTracker tracker = vtkm::cont::GetGlobalRuntimeDeviceTracker());
// Implementation of cartesian products
......
......@@ -127,18 +127,18 @@ template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
std::string name,
const vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::Float32, 3>,
vtkm::cont::internal::StorageTagCompositeVector<vtkm::Vec<vtkm::Float32, 3>(
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>,
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>,
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>)>>&);
vtkm::cont::ArrayHandle<vtkm::Float32, vtkm::cont::StorageTagBasic>>::StorageTag>&);
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(
std::string name,
const vtkm::cont::ArrayHandle<
vtkm::Vec<vtkm::Float64, 3>,
vtkm::cont::internal::StorageTagCompositeVector<vtkm::Vec<vtkm::Float64, 3>(
typename vtkm::cont::ArrayHandleCompositeVector<
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>,
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>,
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>)>>&);
vtkm::cont::ArrayHandle<vtkm::Float64, vtkm::cont::StorageTagBasic>>::StorageTag>&);
template VTKM_CONT_EXPORT CoordinateSystem::CoordinateSystem(std::string name,
const vtkm::cont::DynamicArrayHandle&);
......
......@@ -220,7 +220,7 @@ inline VTKM_CONT vtkm::cont::DataSet DataSetBuilderExplicit::BuildDataSet(
vtkm::cont::DataSet dataSet;
dataSet.AddCoordinateSystem(
vtkm::cont::CoordinateSystem(coordsNm, make_ArrayHandleCompositeVector(X, 0, Y, 0, Z, 0)));
vtkm::cont::CoordinateSystem(coordsNm, make_ArrayHandleCompositeVector(X, Y, Z)));
vtkm::Id nPts = X.GetNumberOfValues();
vtkm::cont::CellSetExplicit<> cellSet(cellNm);
......
......@@ -46,8 +46,7 @@ struct TryArraysOfType
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagArray, CountingArray>::value),
"Counting array type check failed.");
using CompositeArray =
typename vtkm::cont::ArrayHandleCompositeVectorType<StandardArray, CountingArray>::type;
using CompositeArray = vtkm::cont::ArrayHandleCompositeVector<StandardArray, CountingArray>;
VTKM_TEST_ASSERT((TypeCheck<TypeCheckTagArray, CompositeArray>::value),
"Composite array type check failed.");
......
......@@ -154,21 +154,13 @@ private:
template <typename ValueType>
VTKM_CONT void operator()(const ValueType vtkmNotUsed(v)) const
{
//hard-coded to make a vtkm::Vec<ValueType,3> composite vector
//for each ValueType.
using CompositeHandleType = typename vtkm::cont::ArrayHandleCompositeVectorType<
vtkm::cont::ArrayHandle<ValueType>,
vtkm::cont::ArrayHandle<ValueType>,
vtkm::cont::ArrayHandle<ValueType>>::type;
const ValueType value = TestValue(13, ValueType());
std::vector<ValueType> compositeData(ARRAY_SIZE, value);
vtkm::cont::ArrayHandle<ValueType> compositeInput =
vtkm::cont::make_ArrayHandle(compositeData);
CompositeHandleType composite = vtkm::cont::make_ArrayHandleCompositeVector(
compositeInput, 0, compositeInput, 1, compositeInput, 2);
auto composite =
vtkm::cont::make_ArrayHandleCompositeVector(compositeInput, compositeInput, compositeInput);
vtkm::cont::printSummary_ArrayHandle(composite, std::cout);
std::cout << std::endl;
......
......@@ -27,6 +27,7 @@
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandleConstant.h>
#include <vtkm/cont/ArrayHandleExtractComponent.h>
#include <vtkm/cont/ArrayHandleIndex.h>
#include <vtkm/cont/StorageBasic.h>
#include <vtkm/cont/serial/DeviceAdapterSerial.h>
......@@ -116,11 +117,11 @@ void TryScalarArray()
int inArrayId = 0;
InArrayType inArray = MakeInputArray<InValueType>(inArrayId);
using OutArrayType = typename vtkm::cont::ArrayHandleCompositeVectorType<InArrayType>::type;
for (vtkm::IdComponent inComponentIndex = 0; inComponentIndex < inComponents; inComponentIndex++)
{
OutArrayType outArray = vtkm::cont::make_ArrayHandleCompositeVector(inArray, inComponentIndex);
CheckArray(outArray, &inComponentIndex, &inArrayId);
auto c1 = vtkm::cont::make_ArrayHandleExtractComponent(inArray, inComponentIndex);
auto composite = vtkm::cont::make_ArrayHandleCompositeVector(c1);
CheckArray(composite, &inComponentIndex, &inArrayId);
}
}
......@@ -136,25 +137,21 @@ void TryVector4(vtkm::cont::ArrayHandle<T1, StorageTag> array1,
for (inComponents[0] = 0; inComponents[0] < vtkm::VecTraits<T1>::NUM_COMPONENTS;
inComponents[0]++)
{
auto c1 = vtkm::cont::make_ArrayHandleExtractComponent(array1, inComponents[0]);
for (inComponents[1] = 0; inComponents[1] < vtkm::VecTraits<T2>::NUM_COMPONENTS;
inComponents[1]++)
{
auto c2 = vtkm::cont::make_ArrayHandleExtractComponent(array2, inComponents[1]);
for (inComponents[2] = 0; inComponents[2] < vtkm::VecTraits<T3>::NUM_COMPONENTS;
inComponents[2]++)
{
auto c3 = vtkm::cont::make_ArrayHandleExtractComponent(array3, inComponents[2]);
for (inComponents[3] = 0; inComponents[3] < vtkm::VecTraits<T4>::NUM_COMPONENTS;
inComponents[3]++)
{
CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(array1,
inComponents[0],
array2,
inComponents[1],
array3,
inComponents[2],
array4,
inComponents[3]),
inComponents,
arrayIds);
auto c4 = vtkm::cont::make_ArrayHandleExtractComponent(array4, inComponents[3]);
CheckArray(
vtkm::cont::make_ArrayHandleCompositeVector(c1, c2, c3, c4), inComponents, arrayIds);
}
}
}
......@@ -172,16 +169,16 @@ void TryVector3(vtkm::cont::ArrayHandle<T1, StorageTag> array1,
for (inComponents[0] = 0; inComponents[0] < vtkm::VecTraits<T1>::NUM_COMPONENTS;
inComponents[0]++)
{
auto c1 = vtkm::cont::make_ArrayHandleExtractComponent(array1, inComponents[0]);
for (inComponents[1] = 0; inComponents[1] < vtkm::VecTraits<T2>::NUM_COMPONENTS;
inComponents[1]++)
{
auto c2 = vtkm::cont::make_ArrayHandleExtractComponent(array2, inComponents[1]);
for (inComponents[2] = 0; inComponents[2] < vtkm::VecTraits<T3>::NUM_COMPONENTS;
inComponents[2]++)
{
CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(
array1, inComponents[0], array2, inComponents[1], array3, inComponents[2]),
inComponents,
arrayIds);
auto c3 = vtkm::cont::make_ArrayHandleExtractComponent(array3, inComponents[2]);
CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(c1, c2, c3), inComponents, arrayIds);
}
}
}
......@@ -202,13 +199,12 @@ void TryVector2(vtkm::cont::ArrayHandle<T1, StorageTag> array1,
for (inComponents[0] = 0; inComponents[0] < vtkm::VecTraits<T1>::NUM_COMPONENTS;
inComponents[0]++)
{
auto c1 = vtkm::cont::make_ArrayHandleExtractComponent(array1, inComponents[0]);
for (inComponents[1] = 0; inComponents[1] < vtkm::VecTraits<T2>::NUM_COMPONENTS;
inComponents[1]++)
{
CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(
array1, inComponents[0], array2, inComponents[1]),
inComponents,
arrayIds);
auto c2 = vtkm::cont::make_ArrayHandleExtractComponent(array2, inComponents[1]);
CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(c1, c2), inComponents, arrayIds);
}
}
......@@ -227,8 +223,8 @@ void TryVector1(vtkm::cont::ArrayHandle<T1, StorageTag> array1)
for (inComponents[0] = 0; inComponents[0] < vtkm::VecTraits<T1>::NUM_COMPONENTS;
inComponents[0]++)
{
CheckArray(
vtkm::cont::make_ArrayHandleCompositeVector(array1, inComponents[0]), inComponents, arrayIds);
auto testArray = vtkm::cont::make_ArrayHandleExtractComponent(array1, inComponents[0]);
CheckArray(vtkm::cont::make_ArrayHandleCompositeVector(testArray), inComponents, arrayIds);
}
std::cout << " Second component from Scalar." << std::endl;
......@@ -257,18 +253,14 @@ void TrySpecialArrays()
using ArrayType2 = vtkm::cont::ArrayHandleConstant<vtkm::Id>;
ArrayType2 array2(295, ARRAY_SIZE);
using CompositeArrayType =
vtkm::cont::ArrayHandleCompositeVectorType<ArrayType1, ArrayType2>::type;
CompositeArrayType compositeArray =
vtkm::cont::make_ArrayHandleCompositeVector(array1, 0, array2, 0);
auto compositeArray = vtkm::cont::make_ArrayHandleCompositeVector(array1, array2);
vtkm::cont::printSummary_ArrayHandle(compositeArray, std::cout);
std::cout << std::endl;
VTKM_TEST_ASSERT(compositeArray.GetNumberOfValues() == ARRAY_SIZE, "Wrong array size.");
CompositeArrayType::PortalConstControl compositePortal = compositeArray.GetPortalConstControl();
auto compositePortal = compositeArray.GetPortalConstControl();
for (vtkm::Id index = 0; index < ARRAY_SIZE; index++)
{
VTKM_TEST_ASSERT(test_equal(compositePortal.Get(index), vtkm::Id2(index, 295)), "Bad value.");
......@@ -286,7 +278,7 @@ void TestBadArrayLengths()
try
{
vtkm::cont::make_ArrayHandleCompositeVector(longInArray, 0, shortInArray, 0);
vtkm::cont::make_ArrayHandleCompositeVector(longInArray, shortInArray);
VTKM_TEST_FAIL("Did not get exception like expected.");
}
catch (vtkm::cont::ErrorBadValue& error)
......
......@@ -39,10 +39,10 @@ struct ExtractComponentTests
using ExtractArray = vtkm::cont::ArrayHandleExtractComponent<InputArray>;
using ReferenceComponentArray = vtkm::cont::ArrayHandleCounting<ValueType>;
using ReferenceCompositeArray =
typename vtkm::cont::ArrayHandleCompositeVectorType<ReferenceComponentArray,
ReferenceComponentArray,
ReferenceComponentArray,
ReferenceComponentArray>::type;
typename vtkm::cont::ArrayHandleCompositeVector<ReferenceComponentArray,
ReferenceComponentArray,
ReferenceComponentArray,
ReferenceComponentArray>;
using DeviceTag = VTKM_DEFAULT_DEVICE_ADAPTER_TAG;
using Algo = vtkm::cont::DeviceAdapterAlgorithm<DeviceTag>;
......@@ -59,7 +59,7 @@ struct ExtractComponentTests
ReferenceComponentArray c3 = vtkm::cont::make_ArrayHandleCounting<ValueType>(4, 4, numValues);
ReferenceComponentArray c4 = vtkm::cont::make_ArrayHandleCounting<ValueType>(1, 3, numValues);
this->RefComposite = vtkm::cont::make_ArrayHandleCompositeVector(c1, 0, c2, 0, c3, 0, c4, 0);
this->RefComposite = vtkm::cont::make_ArrayHandleCompositeVector(c1, c2, c3, c4);
}
InputArray BuildInputArray() const
......
......@@ -43,11 +43,10 @@ struct SwizzleTests
using SwizzleArrayType = vtkm::cont::ArrayHandleSwizzle<SwizzleInputArrayType, OutSize>;
using ReferenceComponentArrayType = vtkm::cont::ArrayHandleCounting<ValueType>;
using ReferenceArrayType =
typename vtkm::cont::ArrayHandleCompositeVectorType<ReferenceComponentArrayType,
ReferenceComponentArrayType,
ReferenceComponentArrayType,
ReferenceComponentArrayType>::type;
using ReferenceArrayType = vtkm::cont::ArrayHandleCompositeVector<ReferenceComponentArrayType,
ReferenceComponentArrayType,
ReferenceComponentArrayType,
ReferenceComponentArrayType>;
template <vtkm::IdComponent Size>
using MapType = vtkm::Vec<vtkm::IdComponent, Size>;
......@@ -71,7 +70,7 @@ struct SwizzleTests
ReferenceComponentArrayType c4 =
vtkm::cont::make_ArrayHandleCounting<ValueType>(1, 3, numValues);
this->RefArray = vtkm::cont::make_ArrayHandleCompositeVector(c1, 0, c2, 0, c3, 0, c4, 0);
this->RefArray = vtkm::cont::make_ArrayHandleCompositeVector(c1, c2, c3, c4);
}
SwizzleInputArrayType BuildSwizzleInputArray() const
......
......@@ -354,7 +354,7 @@ void TryCastToArrayHandle()
CheckCastToArrayHandle(vtkm::cont::make_ArrayHandleCast(array, vtkm::FloatDefault()));
std::cout << " Composite vector array handle." << std::endl;
CheckCastToArrayHandle(vtkm::cont::make_ArrayHandleCompositeVector(array, 0, array, 0));
CheckCastToArrayHandle(vtkm::cont::make_ArrayHandleCompositeVector(array, array));
std::cout << " Constant array handle." << std::endl;
CheckCastToArrayHandle(vtkm::cont::make_ArrayHandleConstant(5, ARRAY_SIZE));
......
......@@ -54,25 +54,28 @@ protected:
public:
// composite vectors to hold array handles
typename //tell the compiler we have a dependent type
vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>::type
vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>
Intersection;
typename //tell the compiler we have a dependent type
vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>::type Normal;
vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>
Normal;
typename //tell the compiler we have a dependent type
vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>::type Origin;
vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>
Origin;
typename //tell the compiler we have a dependent type
vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>::type Dir;
vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>,
vtkm::cont::ArrayHandle<Precision>>
Dir;
vtkm::cont::ArrayHandle<Precision> IntersectionX; //ray Intersection
vtkm::cont::ArrayHandle<Precision> IntersectionY;
......@@ -113,21 +116,11 @@ public:
{
IntersectionDataEnabled = false;
NumRays = 0;
vtkm::IdComponent inComp[3];
inComp[0] = 0;
inComp[1] = 1;
inComp[2] = 2;
Intersection = vtkm::cont::make_ArrayHandleCompositeVector(
IntersectionX, inComp[0], IntersectionY, inComp[1], IntersectionZ, inComp[2]);
Normal = vtkm::cont::make_ArrayHandleCompositeVector(
NormalX, inComp[0], NormalY, inComp[1], NormalZ, inComp[2]);
Origin = vtkm::cont::make_ArrayHandleCompositeVector(
OriginX, inComp[0], OriginY, inComp[1], OriginZ, inComp[2]);
Dir = vtkm::cont::make_ArrayHandleCompositeVector(
DirX, inComp[0], DirY, inComp[1], DirZ, inComp[2]);
Intersection =
vtkm::cont::make_ArrayHandleCompositeVector(IntersectionX, IntersectionY, IntersectionZ);
Normal = vtkm::cont::make_ArrayHandleCompositeVector(NormalX, NormalY, NormalZ);
Origin = vtkm::cont::make_ArrayHandleCompositeVector(OriginX, OriginY, OriginZ);
Dir = vtkm::cont::make_ArrayHandleCompositeVector(DirX, DirY, DirZ);
ChannelBuffer<Precision> buffer;
buffer.Resize(NumRays);
......
......@@ -208,25 +208,14 @@ public:
vtkm::worklet::DispatcherMapField<Mask<vtkm::UInt8>, Device>(Mask<vtkm::UInt8>(statusUInt8))
.Invoke(rays.Status, masks);
//
// Make empty composite vectors so we don't use up extra storage
//
vtkm::IdComponent inComp[3];
inComp[0] = 0;
inComp[1] = 1;
inComp[2] = 2;
vtkm::cont::ArrayHandle<T> emptyHandle;
rays.Normal =
vtkm::cont::make_ArrayHandleCompositeVector(emptyHandle, emptyHandle, emptyHandle);
rays.Origin =
vtkm::cont::make_ArrayHandleCompositeVector(emptyHandle, emptyHandle, emptyHandle);
rays.Dir = vtkm::cont::make_ArrayHandleCompositeVector(emptyHandle, emptyHandle, emptyHandle);
rays.Normal = vtkm::cont::make_ArrayHandleCompositeVector(
emptyHandle, inComp[0], emptyHandle, inComp[1], emptyHandle, inComp[2]);
rays.Origin = vtkm::cont::make_ArrayHandleCompositeVector(
emptyHandle, inComp[0], emptyHandle, inComp[1], emptyHandle, inComp[2]);
rays.Dir = vtkm::cont::make_ArrayHandleCompositeVector(
emptyHandle, inComp[0], emptyHandle, inComp[1], emptyHandle, inComp[2]);
const vtkm::Int32 numFloatArrays = 18;
vtkm::cont::ArrayHandle<T>* floatArrayPointers[numFloatArrays];
floatArrayPointers[0] = &rays.OriginX;
......@@ -264,14 +253,11 @@ public:
//
// restore the composite vectors
//
rays.Normal = vtkm::cont::make_ArrayHandleCompositeVector(
rays.NormalX, inComp[0], rays.NormalY, inComp[1], rays.NormalZ, inComp[2]);
rays.Origin = vtkm::cont::make_ArrayHandleCompositeVector(
rays.OriginX, inComp[0], rays.OriginY, inComp[1], rays.OriginZ, inComp[2]);
rays.Dir = vtkm::cont::make_ArrayHandleCompositeVector(
rays.DirX, inComp[0], rays.DirY, inComp[1], rays.DirZ, inComp[2]);
rays.Normal =
vtkm::cont::make_ArrayHandleCompositeVector(rays.NormalX, rays.NormalY, rays.NormalZ);
rays.Origin =
vtkm::cont::make_ArrayHandleCompositeVector(rays.OriginX, rays.OriginY, rays.OriginZ);
rays.Dir = vtkm::cont::make_ArrayHandleCompositeVector(rays.DirX, rays.DirY, rays.DirZ);
vtkm::cont::ArrayHandle<vtkm::Id> compactedHits;
vtkm::cont::DeviceAdapterAlgorithm<Device>::CopyIf(rays.HitIdx, masks, compactedHits);
......
......@@ -122,14 +122,14 @@ struct ScalarRenderingTypes : vtkm::ListTagBase<ScalarF, ScalarD>
namespace detail
{
typedef vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>>::type
typedef vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>>
ArrayHandleCompositeVectorFloat32_3Default;
typedef vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>>::type
typedef vtkm::cont::ArrayHandleCompositeVector<vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>>
ArrayHandleCompositeVectorFloat64_3Default;
struct StructuredStorageListTagCoordinateSystem
......
......@@ -84,11 +84,9 @@ void CosmoTools<T, StorageType, DeviceAdapter>::HaloFinder(
{
// Package locations for worklets
using CompositeLocationType =
typename vtkm::cont::ArrayHandleCompositeVectorType<LocationType,
LocationType,
LocationType>::type;
typename vtkm::cont::ArrayHandleCompositeVector<LocationType, LocationType, LocationType>;
CompositeLocationType location;
location = make_ArrayHandleCompositeVector(xLoc, 0, yLoc, 0, zLoc, 0);
location = make_ArrayHandleCompositeVector(xLoc, yLoc, zLoc);
vtkm::cont::ArrayHandle<vtkm::Id> leftNeighbor; // lower particle id to check for linking length
vtkm::cont::ArrayHandle<vtkm::Id> rightNeighbor; // upper particle id to check for linking length
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment