SHTns 3.6.1
shtns_cuda.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010-2021 Centre National de la Recherche Scientifique.
3 * written by Nathanael Schaeffer (CNRS, ISTerre, Grenoble, France).
4 *
5 * nathanael.schaeffer@univ-grenoble-alpes.fr
6 *
7 * This software is governed by the CeCILL license under French law and
8 * abiding by the rules of distribution of free software. You can use,
9 * modify and/or redistribute the software under the terms of the CeCILL
10 * license as circulated by CEA, CNRS and INRIA at the following URL
11 * "http://www.cecill.info".
12 *
13 * The fact that you are presently reading this means that you have had
14 * knowledge of the CeCILL license and that you accept its terms.
15 *
16 */
17
22#ifdef __HIP_PLATFORM_AMD__
23#include <hip/hip_runtime.h>
24typedef hipStream_t shtns_gpu_stream_t;
25#else
26#include <cuda_runtime.h>
27typedef cudaStream_t shtns_gpu_stream_t;
28#endif
29
30
31#ifdef __cplusplus
32extern "C" {
33#endif /* __cplusplus */
34
41
44
46void cu_spat_to_SH(shtns_cfg shtns, double *Vr, cplx *Qlm, int ltr);
48void cu_spat_to_SH_float(shtns_cfg shtns, float *Vr, cplx_f *Qlm, int ltr);
50void cu_SH_to_spat(shtns_cfg shtns, cplx *Qlm, double *Vr, int ltr);
52void cu_SH_to_spat_float(shtns_cfg shtns, cplx_f *Qlm, float *Vr, int ltr);
54void cu_spat_to_SHsphtor(shtns_cfg, double *Vt, double *Vp, cplx *Slm, cplx *Tlm, int ltr);
55void cu_spat_to_SHsphtor_float(shtns_cfg, float *Vt, float *Vp, cplx_f *Slm, cplx_f *Tlm, int ltr);
57void cu_SHsphtor_to_spat(shtns_cfg, cplx *Slm, cplx *Tlm, double *Vt, double *Vp, int ltr);
58void cu_SHsphtor_to_spat_float(shtns_cfg, cplx_f *Slm, cplx_f *Tlm, float *Vt, float *Vp, int ltr);
60void cu_SHsph_to_spat(shtns_cfg, cplx *Slm, double *Vt, double *Vp, int ltr);
61void cu_SHsph_to_spat_float(shtns_cfg, cplx_f *Slm, float *Vt, float *Vp, int ltr);
63void cu_SHtor_to_spat(shtns_cfg, cplx *Tlm, double *Vt, double *Vp, int ltr);
64void cu_SHtor_to_spat_float(shtns_cfg, cplx_f *Tlm, float *Vt, float *Vp, int ltr);
66void cu_spat_to_SHqst(shtns_cfg, double *Vr, double *Vt, double *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm, int ltr);
67void cu_spat_to_SHqst_float(shtns_cfg, float *Vr, float *Vt, float *Vp, cplx_f *Qlm, cplx_f *Slm, cplx_f *Tlm, int ltr);
69void cu_SHqst_to_spat(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double *Vr, double *Vt, double *Vp, int ltr);
70void cu_SHqst_to_spat_float(shtns_cfg, cplx_f *Qlm, cplx_f *Slm, cplx_f *Tlm, float *Vr, float *Vt, float *Vp, int ltr);
72
75
82
89shtns_cfg cushtns_clone(shtns_cfg shtns, shtns_gpu_stream_t compute_stream, shtns_gpu_stream_t transfer_stream);
90
92void cushtns_set_streams(shtns_cfg shtns, shtns_gpu_stream_t compute_stream, shtns_gpu_stream_t transfer_stream);
93
97
99
100#ifdef __cplusplus
101}
102#endif /* __cplusplus */
void cu_spat_to_SH_float(shtns_cfg shtns, float *Vr, cplx_f *Qlm, int ltr)
Same as cu_spat_to_SH, but working on single precision data.
void cu_SHqst_to_spat(shtns_cfg, cplx *Qlm, cplx *Slm, cplx *Tlm, double *Vr, double *Vt, double *Vp, int ltr)
Same as SHqst_to_spat, but working on data residing on the GPU.
int cushtns_init_gpu(shtns_cfg shtns)
Initialize given config to work on the current (or default) GPU, allowing to call GPU transforms cu_*...
void cu_SHsphtor_to_spat(shtns_cfg, cplx *Slm, cplx *Tlm, double *Vt, double *Vp, int ltr)
Same as SHsphtor_to_spat, but working on data residing on the GPU.
void cu_SH_to_spat_float(shtns_cfg shtns, cplx_f *Qlm, float *Vr, int ltr)
Same as cu_SH_to_spat, but working on single precision data.
void cu_spat_to_SHqst(shtns_cfg, double *Vr, double *Vt, double *Vp, cplx *Qlm, cplx *Slm, cplx *Tlm, int ltr)
Same as spat_to_SHqst, but working on data residing on the GPU.
void cu_spat_to_SHsphtor(shtns_cfg, double *Vt, double *Vp, cplx *Slm, cplx *Tlm, int ltr)
Same as spat_to_SHsphtor, but working on data residing on the GPU.
void cu_spat_to_SH(shtns_cfg shtns, double *Vr, cplx *Qlm, int ltr)
Same as spat_to_SH, but working on data residing on the GPU.
void cu_SHtor_to_spat(shtns_cfg, cplx *Tlm, double *Vt, double *Vp, int ltr)
Same as SHtor_to_spat, but working on data residing on the GPU.
void cushtns_set_streams(shtns_cfg shtns, shtns_gpu_stream_t compute_stream, shtns_gpu_stream_t transfer_stream)
Set user-specified streams for compute (including fft) and transfer.
shtns_cfg cushtns_clone(shtns_cfg shtns, shtns_gpu_stream_t compute_stream, shtns_gpu_stream_t transfer_stream)
Clone a gpu-enabled shtns config, and assign it to different streams (to allow compute overlap and/or...
void cu_SHsph_to_spat(shtns_cfg, cplx *Slm, double *Vt, double *Vp, int ltr)
Same as SHsph_to_spat, but working on data residing on the GPU.
void cushtns_release_gpu(shtns_cfg)
Release resources needed for GPU transforms, which won't work after this call.
void cu_SH_to_spat(shtns_cfg shtns, cplx *Qlm, double *Vr, int ltr)
Same as SH_to_spat, but working on data residing on the GPU.
_Complex double cplx
double precision complex number data type
Definition shtns.h:28
_Complex float cplx_f
single precision (float) complex number data type
Definition shtns.h:29
Definition shtns.h:80