Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
LoadConstantData.cu
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "cheetah/cuda_utils/cuda_errorhandling.h"
25 
26 namespace ska {
27 namespace cheetah {
28 namespace fldo {
29 namespace cuda {
30 namespace util {
31 
53 void load_constant_data(double *delta_freq, double *nu, double *nudot, float *dm,
54  int *nbins, int nchannels, int nchan_per_subband,
55  size_t nsubints, double tsamp, int ncandidates)
56 {
57  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_delta_freq, delta_freq, nchannels * sizeof(double), 0, cudaMemcpyHostToDevice));
58  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_nu, nu, ncandidates * sizeof(double), 0, cudaMemcpyHostToDevice));
59  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_nudot, nudot, ncandidates * sizeof(double), 0, cudaMemcpyHostToDevice));
60  // candidates DMs
61  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_dm, dm, ncandidates * sizeof(float), 0, cudaMemcpyHostToDevice));
62  // candidates phases
63  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_nbins, nbins, ncandidates * sizeof(int), 0, cudaMemcpyHostToDevice));
64  // subint time mean value
65  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_nchan_per_band, &nchan_per_subband, sizeof(int), 0, cudaMemcpyHostToDevice));
66  // number of sub-integrations
67  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_nsubints, &nsubints, sizeof(int), 0, cudaMemcpyHostToDevice));
68  // sampling time
69  // OSS: the prebin value is taken into account inside the kernel function.
70  CUDA_ERROR_CHECK(cudaMemcpyToSymbol(cuda::d_tsamp, &tsamp, sizeof(double), 0, cudaMemcpyHostToDevice));
71 }
72 
73 } // utils
74 } // namespace cuda
75 } // namespace fldo
76 } // namespace cheetah
77 } // namespace ska
Some limits and constants for FLDO.
Definition: Brdz.h:35