mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-21 11:35:43 +00:00
About to add function to squash coefficients, but seems to have bugs running on CUDA
This commit is contained in:
parent
148d96d3c4
commit
c3dd581b49
@ -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..." );
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user