About to add function to squash coefficients, but seems to have bugs running on CUDA

This commit is contained in:
Samuel Li 2016-07-26 19:00:23 -06:00
parent 148d96d3c4
commit c3dd581b49
2 changed files with 19 additions and 1 deletions

@ -34,6 +34,7 @@
namespace vtkm {
namespace filter {
template< typename DeviceAdapter >
class WaveletCompressor : public internal::WaveletDWT
{
public:
@ -54,6 +55,18 @@ public:
vtkm::Id nLevels, // n levels of DWT
vtkm::Id* L,
SignalArrayType &sigOut );
// In-place Threshold Coefficients
/*
template< typename CoeffArrayType >
vtkm::Id SquashCoeffs( CoeffArrayType coeffs )
{
typedef vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter> Algorithm;
Algorithm::Sort( coeffs );
return 0;
}
*/
// Compute the book keeping array L for 1D wavelet decomposition
void ComputeL( vtkm::Id sigInLen, vtkm::Id nLevels, vtkm::Id* L );

@ -152,7 +152,7 @@ void TestWaveDecompose()
exit(1);
}
// Use a timer
// Use a timer and decompose
vtkm::cont::Timer<> timer;
compressor.WaveDecompose( inputArray, nLevels, outputArray, L );
vtkm::Float64 elapsedTime = timer.GetElapsedTime();
@ -167,6 +167,10 @@ void TestWaveDecompose()
}
#endif
// Sort all coefficients
// Reconstruct
vtkm::cont::ArrayHandle<vtkm::Float64> reconstructArray;
timer.Reset();
compressor.WaveReconstruct( outputArray, nLevels, L, reconstructArray );
@ -184,6 +188,7 @@ void TestWaveDecompose()
"output value not the same..." );
}
}