Analysis-Utilities
26.9.9
C++/ROOT utilities for nuclear measurement data analysis
Toggle main menu visibility
Loading...
Searching...
No Matches
RooLowLinTail.cu
Go to the documentation of this file.
1
#include "
RooFitPhotopeakKernels.hpp
"
2
3
#include <cuda_runtime.h>
4
5
namespace
{
6
7
__global__
void
RooLowLinTailKernel(
double
*output,
const
double
*x_vals,
8
double
mu,
double
slope,
9
double
inv_sqrt2_sigma,
size_t
n) {
10
size_t
i = blockIdx.x * blockDim.x + threadIdx.x;
11
if
(i < n) {
12
double
y = x_vals[i] - mu;
13
double
lin = 1.0 + slope * y;
14
if
(lin < 0.0) {
15
lin = 0.0;
16
}
17
double
v = lin * erfc(y * inv_sqrt2_sigma);
18
output[i] = v > 1e-300 ? v : 1e-300;
19
}
20
}
21
22
}
// namespace
23
24
void
RooLowLinTail_launchKernel
(
double
*output,
const
double
*x_vals,
double
mu,
25
double
slope,
double
inv_sqrt2_sigma,
26
size_t
n) {
27
const
int
threads = 256;
28
const
int
blocks = (n + threads - 1) / threads;
29
RooLowLinTailKernel<<<blocks, threads>>>(output, x_vals, mu, slope,
30
inv_sqrt2_sigma, n);
31
}
RooFitPhotopeakKernels.hpp
Host-callable launch wrappers for the photopeak PDF CUDA kernels.
RooLowLinTail_launchKernel
void RooLowLinTail_launchKernel(double *output, const double *x_vals, double mu, double slope, double inv_sqrt2_sigma, size_t n)
Launch the low-energy linear tail kernel.
Definition
RooLowLinTail.cu:24
gpu
RooLowLinTail.cu
Generated by
1.17.0