diff --git a/vtkm/worklet/WaveletCompressor.h b/vtkm/worklet/WaveletCompressor.h index 68c04b052..0f48d3797 100644 --- a/vtkm/worklet/WaveletCompressor.h +++ b/vtkm/worklet/WaveletCompressor.h @@ -56,7 +56,6 @@ public: } if( nLevels == 0 ) // 0 levels means no transform { - //WaveletBase::DeviceCopy( sigIn, coeffOut, DeviceTag ); vtkm::cont::DeviceAdapterAlgorithm< DeviceTag >::Copy( sigIn, coeffOut ); return 0; } @@ -163,14 +162,15 @@ public: // Multi-level 2D wavelet decomposition - template< typename InArrayType, typename OutArrayType> + template< typename InArrayType, typename OutArrayType, typename DeviceTag> VTKM_CONT_EXPORT vtkm::Id WaveDecompose2D( const InArrayType &sigIn, // Input vtkm::Id nLevels, // n levels of DWT vtkm::Id inX, // Input X dim vtkm::Id inY, // Input Y dim OutArrayType &coeffOut, - std::vector &L) + std::vector &L, + DeviceTag ) { vtkm::Id sigInLen = sigIn.GetNumberOfValues(); VTKM_ASSERT( inX * inY == sigInLen ); @@ -181,7 +181,7 @@ public: } if( nLevels == 0 ) // 0 levels means no transform { - WaveletBase::DeviceCopy( sigIn, coeffOut ); + vtkm::cont::DeviceAdapterAlgorithm< DeviceTag >::Copy( sigIn, coeffOut ); return 0; } @@ -193,7 +193,7 @@ public: vtkm::Id currentLenY = inY; std::vector L2d(10, 0); - WaveletBase::DeviceCopy( sigIn, coeffOut ); + vtkm::cont::DeviceAdapterAlgorithm< DeviceTag >::Copy( sigIn, coeffOut ); typedef typename OutArrayType::ValueType OutValueType; typedef vtkm::cont::ArrayHandle OutBasicArray; @@ -223,14 +223,15 @@ public: // Multi-level 2D wavelet reconstruction - template< typename InArrayType, typename OutArrayType> + template< typename InArrayType, typename OutArrayType, typename DeviceTag> VTKM_CONT_EXPORT vtkm::Id WaveReconstruct2D( const InArrayType &arrIn, // Input vtkm::Id nLevels, // n levels of DWT vtkm::Id inX, // Input X dim vtkm::Id inY, // Input Y dim OutArrayType &arrOut, - std::vector &L) + std::vector &L, + DeviceTag ) { vtkm::Id arrInLen = arrIn.GetNumberOfValues(); VTKM_ASSERT( inX * inY == arrInLen ); @@ -240,7 +241,7 @@ public: throw vtkm::cont::ErrorControlBadValue("Number of levels of transform is not supported! "); } // fill the output array - WaveletBase::DeviceCopy( arrIn, arrOut ); + vtkm::cont::DeviceAdapterAlgorithm< DeviceTag >::Copy( arrIn, arrOut ); if( nLevels == 0 ) // 0 levels means no transform { return 0; @@ -296,7 +297,7 @@ public: template< typename CoeffArrayType, typename DeviceTag > vtkm::Id SquashCoefficients( CoeffArrayType &coeffIn, vtkm::Float64 ratio, - DeviceTag ) + DeviceTag ) { if( ratio > 1 ) { diff --git a/vtkm/worklet/testing/UnitTestWaveletCompressor.cxx b/vtkm/worklet/testing/UnitTestWaveletCompressor.cxx index 83547f3f6..2d983eae9 100644 --- a/vtkm/worklet/testing/UnitTestWaveletCompressor.cxx +++ b/vtkm/worklet/testing/UnitTestWaveletCompressor.cxx @@ -93,8 +93,10 @@ void DebugRectangleCopy() // make bookkeeping array std::vector L; - vtkm::worklet::WaveletCompressor wavelet( "CDF5/3" ); - wavelet.WaveDecompose2D( inputArray, 2, sigX, sigY, outputArray, L ); + vtkm::worklet::wavelets::WaveletName wname = vtkm::worklet::wavelets::CDF5_3; + vtkm::worklet::WaveletCompressor wavelet( wname ); + wavelet.WaveDecompose2D( inputArray, 2, sigX, sigY, outputArray, L, + VTKM_DEFAULT_DEVICE_ADAPTER_TAG() ); for( vtkm::Id i = 0; i < outputArray.GetNumberOfValues(); i++ ) { @@ -124,8 +126,10 @@ void DebugDWTIDWT2D() vtkm::Id nlevels = 2; // Forward Transform - vtkm::worklet::WaveletCompressor wavelet( "CDF9/7" ); - wavelet.WaveDecompose2D( inputArray, nlevels, sigX, sigY, coeffOut, L ); + vtkm::worklet::wavelets::WaveletName wname = vtkm::worklet::wavelets::CDF9_7; + vtkm::worklet::WaveletCompressor wavelet( wname ); + wavelet.WaveDecompose2D( inputArray, nlevels, sigX, sigY, coeffOut, L, + VTKM_DEFAULT_DEVICE_ADAPTER_TAG() ); /* for( vtkm::Id i = 0; i < coeffOut.GetNumberOfValues(); i++ ) @@ -140,7 +144,8 @@ void DebugDWTIDWT2D() // Inverse Transform vtkm::cont::ArrayHandle reconstructArray; - wavelet.WaveReconstruct2D( coeffOut, nlevels, sigX, sigY, reconstructArray, L ); + wavelet.WaveReconstruct2D( coeffOut, nlevels, sigX, sigY, reconstructArray, L, + VTKM_DEFAULT_DEVICE_ADAPTER_TAG() ); for( vtkm::Id i = 0; i < reconstructArray.GetNumberOfValues(); i++ ) { std::cout << reconstructArray.GetPortalConstControl().Get(i) << " ";