Skip to content

Commit

Permalink
Revert "Add initialization and finalization in examples"
Browse files Browse the repository at this point in the history
This reverts commit 19bd963.
  • Loading branch information
Yuuichi Asahi committed Jan 14, 2025
1 parent 19bd963 commit 2b59d12
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions examples/01_1DFFT/01_1DFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ using View1D = Kokkos::View<T*, execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -45,7 +44,6 @@ int main(int argc, char* argv[]) {
KokkosFFT::irfft(exec, xc2r, xc2r_hat);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/02_2DFFT/02_2DFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ using View2D = Kokkos::View<T**, execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128, n1 = 128;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -45,7 +44,6 @@ int main(int argc, char* argv[]) {
KokkosFFT::irfft2(exec, xc2r, xc2r_hat);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/03_NDFFT/03_NDFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ using axis_type = KokkosFFT::axis_type<DIM>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -47,7 +46,6 @@ int main(int argc, char* argv[]) {
KokkosFFT::irfftn(exec, xc2r, xc2r_hat, axis_type<3>{-3, -2, -1});
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/04_batchedFFT/04_batchedFFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ using View3D = Kokkos::View<T***, execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -49,7 +48,6 @@ int main(int argc, char* argv[]) {
/*axis=*/-1);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/05_1DFFT_HOST_DEVICE/05_1DFFT_HOST_DEVICE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ using HostView1D = Kokkos::View<T*, host_execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -80,7 +79,6 @@ int main(int argc, char* argv[]) {
host_exec.fence();
#endif
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/06_1DFFT_reuse_plans/06_1DFFT_reuse_plans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ using View1D = Kokkos::View<T*, execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -55,7 +54,6 @@ int main(int argc, char* argv[]) {
irfft_plan.execute(xc2r, xc2r_hat);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/07_unmanaged_views/07_unmanaged_views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ using shape_type = KokkosFFT::shape_type<DIM>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128, n1 = 128, n2 = 16;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -64,7 +63,6 @@ int main(int argc, char* argv[]) {
KokkosFFT::Normalization::backward, shape);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/08_inplace_FFT/08_inplace_FFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ using RightView2D = Kokkos::View<T **, Kokkos::LayoutRight, execution_space>;

int main(int argc, char *argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128, n1 = 128;
const Kokkos::complex<double> z(1.0, 1.0);
Expand Down Expand Up @@ -70,7 +69,6 @@ int main(int argc, char *argv[]) {

exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
4 changes: 1 addition & 3 deletions install_test/as_library/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ using View1D = Kokkos::View<T*, execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128;
constexpr int n0 = 128;
const Kokkos::complex<double> z(1.0, 1.0);

// 1D C2C FFT (Forward and Backward)
Expand Down Expand Up @@ -45,7 +44,6 @@ int main(int argc, char* argv[]) {
KokkosFFT::irfft(exec, xc2r, xc2r_hat);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down
4 changes: 1 addition & 3 deletions install_test/as_subdirectory/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ using View2D = Kokkos::View<T**, execution_space>;

int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
KokkosFFT::initialize();
{
const int n0 = 128, n1 = 128;
constexpr int n0 = 128, n1 = 128;
const Kokkos::complex<double> z(1.0, 1.0);

// 2D C2C FFT (Forward and Backward)
Expand Down Expand Up @@ -45,7 +44,6 @@ int main(int argc, char* argv[]) {
KokkosFFT::irfft2(exec, xc2r, xc2r_hat);
exec.fence();
}
KokkosFFT::finalize();
Kokkos::finalize();

return 0;
Expand Down

0 comments on commit 2b59d12

Please sign in to comment.