Skip to content

Commit

Permalink
Rename complex number to avoid confusion with the imaginary unit (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau authored Oct 8, 2024
1 parent b460f18 commit f64a013
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions examples/01_1DFFT/01_1DFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
View1D<Kokkos::complex<double> > xc2c("xc2c", n0);
Expand All @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) {

Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

KokkosFFT::fft(exec, xc2c, xc2c_hat);
Expand All @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
// 1D C2R FFT
View1D<Kokkos::complex<double> > xc2r("xr2c_hat", n0 / 2 + 1);
View1D<double> xc2r_hat("xc2r", n0);
Kokkos::fill_random(exec, xc2r, random_pool, I);
Kokkos::fill_random(exec, xc2r, random_pool, z);
exec.fence();

KokkosFFT::irfft(exec, xc2r, xc2r_hat);
Expand Down
6 changes: 3 additions & 3 deletions examples/02_2DFFT/02_2DFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

// 2D C2C FFT (Forward and Backward)
View2D<Kokkos::complex<double> > xc2c("xc2c", n0, n1);
Expand All @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) {

Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

KokkosFFT::fft2(exec, xc2c, xc2c_hat);
Expand All @@ -43,7 +43,7 @@ int main(int argc, char* argv[]) {
// 2D C2R FFT
View2D<Kokkos::complex<double> > xc2r("xr2c_hat", n0, n1 / 2 + 1);
View2D<double> xc2r_hat("xc2r", n0, n1);
Kokkos::fill_random(exec, xc2r, random_pool, I);
Kokkos::fill_random(exec, xc2r, random_pool, z);
exec.fence();

KokkosFFT::irfft2(exec, xc2r, xc2r_hat);
Expand Down
6 changes: 3 additions & 3 deletions examples/03_NDFFT/03_NDFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

// 3D C2C FFT (Forward and Backward)
View3D<Kokkos::complex<double> > xc2c("xc2c", n0, n1, n2);
Expand All @@ -26,7 +26,7 @@ int main(int argc, char* argv[]) {

Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

KokkosFFT::fftn(exec, xc2c, xc2c_hat, axis_type<3>{-3, -2, -1});
Expand All @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) {
// 3D C2R FFT
View3D<Kokkos::complex<double> > xc2r("xr2c_hat", n0, n1, n2 / 2 + 1);
View3D<double> xc2r_hat("xc2r", n0, n1, n2);
Kokkos::fill_random(exec, xc2r, random_pool, I);
Kokkos::fill_random(exec, xc2r, random_pool, z);
exec.fence();

KokkosFFT::irfftn(exec, xc2r, xc2r_hat, axis_type<3>{-3, -2, -1});
Expand Down
6 changes: 3 additions & 3 deletions examples/04_batchedFFT/04_batchedFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

// 1D batched C2C FFT (Forward and Backward)
View3D<Kokkos::complex<double> > xc2c("xc2c", n0, n1, n2);
Expand All @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) {

Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

KokkosFFT::fft(exec, xc2c, xc2c_hat, KokkosFFT::Normalization::backward,
Expand All @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) {
// 1D batched C2R FFT
View3D<Kokkos::complex<double> > xc2r("xr2c_hat", n0, n1, n2 / 2 + 1);
View3D<double> xc2r_hat("xc2r", n0, n1, n2);
Kokkos::fill_random(exec, xc2r, random_pool, I);
Kokkos::fill_random(exec, xc2r, random_pool, z);
exec.fence();

KokkosFFT::irfft(exec, xc2r, xc2r_hat, KokkosFFT::Normalization::backward,
Expand Down
6 changes: 3 additions & 3 deletions examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
View1D<Kokkos::complex<double> > xc2c("xc2c", n0);
Expand All @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) {

Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

KokkosFFT::fft(exec, xc2c, xc2c_hat);
Expand All @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) {
// 1D C2R FFT
View1D<Kokkos::complex<double> > xc2r("xr2c_hat", n0 / 2 + 1);
View1D<double> xc2r_hat("xc2r", n0);
Kokkos::fill_random(exec, xc2r, random_pool, I);
Kokkos::fill_random(exec, xc2r, random_pool, z);
exec.fence();

KokkosFFT::irfft(exec, xc2r, xc2r_hat);
Expand Down
6 changes: 3 additions & 3 deletions examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
View1D<Kokkos::complex<double> > xc2c("xc2c", n0);
Expand All @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) {

Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

int axis = -1;
Expand Down Expand Up @@ -52,7 +52,7 @@ int main(int argc, char* argv[]) {
// 1D C2R FFT
View1D<Kokkos::complex<double> > xc2r("xc2r_hat", n0 / 2 + 1);
View1D<double> xc2r_hat("xc2r", n0);
Kokkos::fill_random(exec, xc2r, random_pool, I);
Kokkos::fill_random(exec, xc2r, random_pool, z);
exec.fence();

KokkosFFT::Impl::Plan irfft_plan(exec, xc2r, xc2r_hat,
Expand Down
4 changes: 2 additions & 2 deletions examples/07_unmanaged_views/07_unmanaged_views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
{
constexpr int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> I(1.0, 1.0);
const Kokkos::complex<double> z(1.0, 1.0);

shape_type<3> shape;
shape[0] = n0;
Expand Down Expand Up @@ -55,7 +55,7 @@ int main(int argc, char* argv[]) {
n0, n1, n2);
Kokkos::Random_XorShift64_Pool<> random_pool(12345);
execution_space exec;
Kokkos::fill_random(exec, xc2c, random_pool, I);
Kokkos::fill_random(exec, xc2c, random_pool, z);
exec.fence();

KokkosFFT::fftn(exec, xc2c, xc2c_hat, axis_type<3>{-3, -2, -1},
Expand Down

0 comments on commit f64a013

Please sign in to comment.