Highly Efficient FFT for Exascale: HeFFTe v2.4
Toggle main menu visibility
Loading...
Searching...
No Matches
heffte_magma_helpers.h
1
/*
2
-- heFFTe --
3
Univ. of Tennessee, Knoxville
4
@date
5
*/
6
7
#ifndef HEFFTE_MAGMA_HELPERS_H
8
#define HEFFTE_MAGMA_HELPERS_H
9
10
#include "heffte_pack3d.h"
11
19
20
namespace
heffte
{
21
22
namespace
gpu {
30
template
<
typename
>
struct
magma_handle
{
32
magma_handle
(
void
*){}
34
template
<
typename
scalar_type>
void
scal
(
int
,
double
, scalar_type*)
const
{}
35
};
36
42
template
<>
43
struct
magma_handle
<
tag
::gpu>{
45
magma_handle
(
void
* gpu_stream);
47
~magma_handle
();
49
void
scal
(
int
num_entries,
double
scale_factor,
float
*data)
const
;
51
void
scal
(
int
num_entries,
double
scale_factor,
double
*data)
const
;
53
template
<
typename
precision_type>
54
void
scal
(
int
num_entries,
double
scale_factor, std::complex<precision_type> *data)
const
{
55
scal
(2*num_entries, scale_factor,
reinterpret_cast<
precision_type*
>
(data));
56
}
57
58
mutable
void
*
handle
;
59
};
60
}
61
62
}
63
64
#endif
/* HEFFTE_MAGMA_HELPERS_H */
heffte::tag
Contains internal type-tags.
Definition
heffte_common.h:30
heffte
Namespace containing all HeFFTe methods and classes.
Definition
heffte_backend_cuda.h:38
heffte::gpu::magma_handle< tag::gpu >::magma_handle
magma_handle(void *gpu_stream)
Constructor, calls magma_init() and creates a new queue on the given stream.
heffte::gpu::magma_handle< tag::gpu >::scal
void scal(int num_entries, double scale_factor, std::complex< precision_type > *data) const
Template for the complex case, uses reinterpret_cast().
Definition
heffte_magma_helpers.h:54
heffte::gpu::magma_handle< tag::gpu >::scal
void scal(int num_entries, double scale_factor, float *data) const
Wrapper around magma_sscal().
heffte::gpu::magma_handle< tag::gpu >::~magma_handle
~magma_handle()
Destructor, cleans the queue and calls magma_finalize().
heffte::gpu::magma_handle< tag::gpu >::scal
void scal(int num_entries, double scale_factor, double *data) const
Wrapper around magma_dscal().
heffte::gpu::magma_handle< tag::gpu >::handle
void * handle
Opaque pointer to a magma_queue.
Definition
heffte_magma_helpers.h:58
heffte::gpu::magma_handle::scal
void scal(int, double, scalar_type *) const
Wrapper around MAGMA sscal()/dscal(), but no-op in a CPU context.
Definition
heffte_magma_helpers.h:34
heffte::gpu::magma_handle::magma_handle
magma_handle(void *)
No-op constructor, see the GPU specialization.
Definition
heffte_magma_helpers.h:32
include
heffte_magma_helpers.h
Generated by
1.17.0