Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions cxx/isce3/cuda/Sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,27 @@ geometry/utilities.cu
image/gpuResampSlc.cu
image/Resample.cu
image/ResampSlc.cpp
matchtemplate/pycuampcor/cuAmpcorChunk.cu
matchtemplate/pycuampcor/cuAmpcorController.cu
matchtemplate/pycuampcor/cuAmpcorParameter.cu
matchtemplate/pycuampcor/cuArrays.cu
matchtemplate/pycuampcor/cuAmpcorController.cpp
matchtemplate/pycuampcor/cuAmpcorParameter.cpp
matchtemplate/pycuampcor/cuAmpcorProcessor.cpp
matchtemplate/pycuampcor/cuAmpcorProcessorOnePass.cpp
matchtemplate/pycuampcor/cuAmpcorProcessorTwoPass.cpp
matchtemplate/pycuampcor/cuArrays.cpp
matchtemplate/pycuampcor/cuArraysCopy.cu
matchtemplate/pycuampcor/cuArraysPadding.cu
matchtemplate/pycuampcor/cuCorrFrequency.cu
matchtemplate/pycuampcor/cuCorrNormalization.cu
matchtemplate/pycuampcor/cuCorrNormalizationSAT.cu
matchtemplate/pycuampcor/cuCorrNormalizer.cu
matchtemplate/pycuampcor/cuCorrNormalizer.cpp
matchtemplate/pycuampcor/cuCorrTimeDomain.cu
matchtemplate/pycuampcor/cuDeramp.cu
matchtemplate/pycuampcor/cuEstimateStats.cu
matchtemplate/pycuampcor/cuOffset.cu
matchtemplate/pycuampcor/cuOverSampler.cu
matchtemplate/pycuampcor/cuOverSampler.cpp
matchtemplate/pycuampcor/cuSincOverSampler.cu
matchtemplate/pycuampcor/GDALImage.cu
matchtemplate/pycuampcor/cudaError.cpp
matchtemplate/pycuampcor/cudaUtil.cpp
matchtemplate/pycuampcor/SlcImage.cpp
product/SubSwaths.cu
signal/gpuAzimuthFilter.cu
signal/gpuCrossMul.cu
Expand Down
163 changes: 0 additions & 163 deletions cxx/isce3/cuda/matchtemplate/pycuampcor/GDALImage.cu

This file was deleted.

83 changes: 0 additions & 83 deletions cxx/isce3/cuda/matchtemplate/pycuampcor/GDALImage.h

This file was deleted.

109 changes: 109 additions & 0 deletions cxx/isce3/cuda/matchtemplate/pycuampcor/PyCuAmpcor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include "cuAmpcorController.h"
#include "cuAmpcorParameter.h"

PYBIND11_MODULE(PyCuAmpcor, m)
{
m.doc() = "Python module controller for underlying CUDA-Ampcor code";

using str = std::string;
using cls = cuAmpcorController;

pybind11::class_<cls>(m, "PyCuAmpcor")
.def(pybind11::init<>())

// define a trivial binding for a controller method
#define DEF_METHOD(name) def(#name, &cls::name)

// define a trivial getter/setter for a controller parameter
#define DEF_PARAM_RENAME(T, pyname, cppname) \
def_property(#pyname, [](const cls& self) -> T { \
return self.param->cppname; \
}, [](cls& self, const T i) { \
self.param->cppname = i; \
})

// same as above, for even more trivial cases where pyname == cppname
#define DEF_PARAM(T, name) DEF_PARAM_RENAME(T, name, name)

.DEF_PARAM(int, algorithm)
.DEF_PARAM(int, deviceID)
.DEF_PARAM(int, nStreams)
.DEF_PARAM(int, derampMethod)
.DEF_PARAM(int, workflow)

.DEF_PARAM(str, referenceImageName)
.DEF_PARAM(int, referenceImageHeight)
.DEF_PARAM(int, referenceImageWidth)
.DEF_PARAM(int, referenceImageDataType)
.DEF_PARAM(str, secondaryImageName)
.DEF_PARAM(int, secondaryImageHeight)
.DEF_PARAM(int, secondaryImageWidth)
.DEF_PARAM(int, secondaryImageDataType)

.DEF_PARAM(int, numberWindowDown)
.DEF_PARAM(int, numberWindowAcross)

.DEF_PARAM_RENAME(int, windowSizeHeight, windowSizeHeightRaw)
.DEF_PARAM_RENAME(int, windowSizeWidth, windowSizeWidthRaw)

.DEF_PARAM(str, offsetImageName)
.DEF_PARAM(str, grossOffsetImageName)
.DEF_PARAM(int, mergeGrossOffset)
.DEF_PARAM(str, snrImageName)
.DEF_PARAM(str, covImageName)
.DEF_PARAM(str, peakValueImageName)

.DEF_PARAM(int, rawDataOversamplingFactor)
.DEF_PARAM(int, corrStatWindowSize)

.DEF_PARAM(int, numberWindowDownInChunk)
.DEF_PARAM(int, numberWindowAcrossInChunk)

.DEF_PARAM(int, useMmap)

.DEF_PARAM_RENAME(int, halfSearchRangeAcross, halfSearchRangeAcrossRaw)
.DEF_PARAM_RENAME(int, halfSearchRangeDown, halfSearchRangeDownRaw)

.DEF_PARAM_RENAME(int, referenceStartPixelAcrossStatic, referenceStartPixelAcross0)
.DEF_PARAM_RENAME(int, referenceStartPixelDownStatic, referenceStartPixelDown0)

.DEF_PARAM(int, corrSurfaceOverSamplingMethod)
.DEF_PARAM(int, corrSurfaceOverSamplingFactor)

.DEF_PARAM_RENAME(int, mmapSize, mmapSizeInGB)

.DEF_PARAM_RENAME(int, skipSampleDown, skipSampleDownRaw)
.DEF_PARAM_RENAME(int, skipSampleAcross, skipSampleAcrossRaw)
.DEF_PARAM_RENAME(int, corrSurfaceZoomInWindow, zoomWindowSize)

.DEF_METHOD(runAmpcor)

.DEF_METHOD(isDoublePrecision)

.def("checkPixelInImageRange", [](const cls& self) {
self.param->checkPixelInImageRange();
})

.def("setupParams", [](cls& self) {
self.param->setupParameters();
})

.def("setConstantGrossOffset", [](cls& self, const int goDown,
const int goAcross) {
self.param->setStartPixels(
self.param->referenceStartPixelDown0,
self.param->referenceStartPixelAcross0,
goDown, goAcross);
})
.def("setVaryingGrossOffset", [](cls& self, std::vector<int> vD,
std::vector<int> vA) {
self.param->setStartPixels(
self.param->referenceStartPixelDown0,
self.param->referenceStartPixelAcross0,
vD.data(), vA.data());
})
;
}
Loading
Loading