50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
// Copyright (2019-2023) Paul Scherrer Institute
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#ifndef JUNGFRAUJOCH_JFCONVERSIONGPU_CUH
|
|
#define JUNGFRAUJOCH_JFCONVERSIONGPU_CUH
|
|
|
|
#include "JFConversion.h"
|
|
#include "JFConversionFixedPoint.h"
|
|
|
|
struct CudaStreamWrapper;
|
|
|
|
class JFConversionGPU : public JFConversion {
|
|
#ifdef JFJOCH_USE_CUDA
|
|
CudaStreamWrapper *cudastream = nullptr;
|
|
|
|
uint16_t *gpu_pedestal_g0 = nullptr;
|
|
uint16_t *gpu_pedestal_g1 = nullptr;
|
|
uint16_t *gpu_pedestal_g2 = nullptr;
|
|
float *gpu_gain_g0 = nullptr;
|
|
float *gpu_gain_g1 = nullptr;
|
|
float *gpu_gain_g2 = nullptr;
|
|
|
|
float *host_gain_g0 = nullptr;
|
|
float *host_gain_g1 = nullptr;
|
|
float *host_gain_g2 = nullptr;
|
|
|
|
|
|
uint16_t *gpu_input = nullptr;
|
|
int16_t *gpu_output = nullptr;
|
|
#else
|
|
JFConversionFixedPoint alt_conv;
|
|
#endif
|
|
public:
|
|
JFConversionGPU();
|
|
JFConversionGPU(JFConversionGPU& other) = delete;
|
|
JFConversionGPU& operator=(JFConversionGPU& other) = delete;
|
|
~JFConversionGPU();
|
|
void Setup(const JFModuleGainCalibration &gain_calibration,
|
|
const JFModulePedestal &pedestal_g0,
|
|
const JFModulePedestal &pedestal_g1,
|
|
const JFModulePedestal &pedestal_g2,
|
|
double energy) override;
|
|
|
|
void ConvertModule(int16_t *dest, const uint16_t *source) override;
|
|
void Sync() override;
|
|
};
|
|
|
|
|
|
#endif //JUNGFRAUJOCH_JFCONVERSIONGPU_CUH
|