Skip to content

Commit 964bfaa

Browse files
committed
Attempt to run on HIP
1 parent 772ce6f commit 964bfaa

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

src/pgen/turbulence.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,13 @@ void UserMeshWorkBeforeOutput(Mesh *pmesh, ParameterInput *pin,
578578
auto *comm = MPI_COMM_WORLD;
579579

580580
// TODO(pgrete) not nice, make nicer
581-
#ifndef KOKKOS_ENABLE_CUDA
582-
using backend_tag = heffte::backend::default_backend<heffte::tag::cpu>::type;
583-
#else
581+
#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP)
584582
using backend_tag = heffte::backend::default_backend<heffte::tag::gpu>::type;
585583
PARTHENON_REQUIRE_THROWS(heffte::gpu::device_count() == 1,
586584
"To make this work, we need to ensure that Kokkos and heffte "
587585
"use the same GPUs. So hard fail for now.");
586+
#else
587+
using backend_tag = heffte::backend::default_backend<heffte::tag::cpu>::type;
588588
#endif
589589

590590
// wrapper around MPI_Comm_rank() and MPI_Comm_size(), using this is optional
@@ -653,16 +653,18 @@ void UserMeshWorkBeforeOutput(Mesh *pmesh, ParameterInput *pin,
653653
std::vector<heffte::box3d<>> complex_boxes =
654654
heffte::split_world(complex_indexes, proc_grid);
655655
heffte::box3d<> const outbox = complex_boxes[me];
656-
657-
std::cerr << "[" << parthenon::Globals::my_rank
658-
<< "] my complex indices are: " << outbox.low[0] << ":" << outbox.high[0]
659-
<< " " << outbox.low[1] << ":" << outbox.high[1] << " " << outbox.low[2]
660-
<< ":" << outbox.high[2] << " "
661-
<< " and the complex order is for idx 012: " << outbox.order[0]
662-
<< outbox.order[1] << outbox.order[2]
663-
<< " and the real order is for idx 012: " << inbox.order[0] << inbox.order[1]
664-
<< inbox.order[2] << "\n";
665-
656+
/*
657+
std::cerr << "[" << parthenon::Globals::my_rank
658+
<< "] my complex indices are: " << outbox.low[0] << ":" << outbox.high[0]
659+
<< " " << outbox.low[1] << ":" << outbox.high[1] << " " << outbox.low[2]
660+
<< ":" << outbox.high[2] << " "
661+
<< " and the complex order is for idx 012: " << outbox.order[0]
662+
<< outbox.order[1] << outbox.order[2]
663+
<< " and the real order is for idx 012: " << inbox.order[0] <<
664+
inbox.order[1]
665+
<< inbox.order[2] << "\n";
666+
667+
*/
666668
// define the heffte class and the input and output geometry
667669
heffte::fft3d_r2c<backend_tag> fft(inbox, outbox, r2c_direction, comm);
668670

0 commit comments

Comments
 (0)