26 #include <cuda_runtime_api.h> 29 #include "cuda_geo_linear_interpolator.cu" 33 const auto& s = this->getSettings();
37 this->getSettings().dims.size() *
sizeof(T),
38 cudaMemcpyHostToDevice));
39 this->setIsSrcSet(
true);
47 const auto &s = this->getSettings();
48 m_stream =
dynamic_cast<GPU*
>(s.hw.at(0));
49 if (
nullptr == m_stream) {
62 const auto &s = this->getSettings();
69 if (1 != s.hw.size()) {
72 if ( ! s.keepSrcCopy) {
79 bool isReady = this->isInitialized()
87 this->getSettings().dims.size() *
sizeof(T),
88 cudaMemcpyDeviceToDevice));
96 m_d_matrices =
nullptr;
110 const auto& s = this->getSettings();
116 bytes = dims.
n() * 9 *
sizeof(float);
117 gpuErrchk(cudaMalloc(&m_d_matrices, bytes));
122 const auto& dims = this->getSettings().dims;
123 size_t bytes = dims.n() * 9 *
sizeof(float);
124 auto stream = *(cudaStream_t*)m_stream->stream();
129 cudaMemcpyHostToDevice, stream));
130 dim3 dimBlock(64, 1, 1);
132 std::ceil(dims.x() / (float)dimBlock.x),
133 std::ceil(dims.y() / (float)dimBlock.y),
136 interpolateKernel<<<dimGrid, dimBlock, 0, stream>>> (
137 m_d_src, m_d_dest, m_d_matrices,
146 const std::vector<float> &weights,
size_t firstN,
148 const auto& dims = this->getSettings().dims.copyForN(firstN);
149 assert(weights.size() == dims.n());
150 assert(0 < dims.n());
151 dim3 dimBlock(32, 32, 1);
153 std::ceil(dims.x() / (float)dimBlock.x),
154 std::ceil(dims.y() / (float)dimBlock.y),
156 auto stream = *(cudaStream_t*)m_stream->stream();
160 size_t bytesWeight = weights.size() *
sizeof(float);
161 gpuErrchk(cudaMalloc(&d_weights, bytesWeight));
166 cudaMemcpyHostToDevice, stream));
168 sumKernel<<<dimGrid, dimBlock, 0, stream>>> (
169 m_d_dest, m_d_src, d_weights,
170 dims.x(), dims.y(), dims.n(),
norm);
172 size_t bytes = dims.sizeSingle() *
sizeof(T);
177 cudaMemcpyDeviceToHost, stream));
Case or algorithm not implemented yet.
#define REPORT_ERROR(nerr, ErrormMsg)
T norm(const std::vector< T > &v)
constexpr size_t sizePadded() const
CUDA_HD constexpr size_t n() const
Some logical error in the pipeline.