Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing compiler warnings #63

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions include/heffte_backend_oneapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -508,15 +508,15 @@ class onemkl_executor : public executor_base{
}else if (size2 == 0){
plan.set_value(oneapi::mkl::dft::config_param::NUMBER_OF_TRANSFORMS, (MKL_LONG) howmanyffts);
plan.set_value(oneapi::mkl::dft::config_param::PLACEMENT, DFTI_INPLACE);
plan.set_value(oneapi::mkl::dft::config_param::INPUT_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::OUTPUT_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::FWD_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::BWD_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::FWD_DISTANCE, (MKL_LONG) dist);
plan.set_value(oneapi::mkl::dft::config_param::BWD_DISTANCE, (MKL_LONG) dist);
}else{
plan.set_value(oneapi::mkl::dft::config_param::NUMBER_OF_TRANSFORMS, (MKL_LONG) howmanyffts);
plan.set_value(oneapi::mkl::dft::config_param::PLACEMENT, DFTI_INPLACE);
plan.set_value(oneapi::mkl::dft::config_param::INPUT_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::OUTPUT_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::FWD_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::BWD_STRIDES, embed.data());
plan.set_value(oneapi::mkl::dft::config_param::FWD_DISTANCE, (MKL_LONG) dist);
plan.set_value(oneapi::mkl::dft::config_param::BWD_DISTANCE, (MKL_LONG) dist);
}
Expand Down Expand Up @@ -620,8 +620,8 @@ class onemkl_executor_r2c : public executor_base{
plan.set_value(oneapi::mkl::dft::config_param::PLACEMENT, DFTI_NOT_INPLACE);
plan.set_value(oneapi::mkl::dft::config_param::CONJUGATE_EVEN_STORAGE, DFTI_COMPLEX_COMPLEX);
MKL_LONG slstride[] = {0, static_cast<MKL_LONG>(stride)};
plan.set_value(oneapi::mkl::dft::config_param::INPUT_STRIDES, slstride);
plan.set_value(oneapi::mkl::dft::config_param::OUTPUT_STRIDES, slstride);
plan.set_value(oneapi::mkl::dft::config_param::FWD_STRIDES, slstride);
plan.set_value(oneapi::mkl::dft::config_param::BWD_STRIDES, slstride);
plan.set_value(oneapi::mkl::dft::config_param::FWD_DISTANCE, (MKL_LONG) rdist);
plan.set_value(oneapi::mkl::dft::config_param::BWD_DISTANCE, (MKL_LONG) cdist);
plan.commit(q);
Expand Down
7 changes: 6 additions & 1 deletion include/heffte_r2r_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct cpu_cos1_pre_pos_processor{
static void pre_forward(void*, int length, precision const input[], precision fft_signal[]){
for (int i = 0; i < length-1; i++){
fft_signal[2*i] = input[i];
fft_signal[2*i+1] = 0.0;
fft_signal[2*i+1] = 0.0;
}
for (int i = 1; i < length; i++){
fft_signal[4*(length-1)-2*i] = input[i];
Expand Down Expand Up @@ -190,6 +190,11 @@ struct cpu_sin1_pre_pos_processor{};
*/
template<typename fft_backend_tag, typename prepost_processor>
struct real2real_executor : public executor_base{
//! \brief Will not be used, suppresses compiler warnings
using executor_base::forward;
//! \brief Will not be used, suppresses compiler warnings
using executor_base::backward;

//! \brief Construct a plan for batch 1D transforms.
template<typename index>
real2real_executor(typename backend::device_instance<typename backend::buffer_traits<fft_backend_tag>::location>::stream_type cstream, box3d<index> const box, int dimension) :
Expand Down
1 change: 1 addition & 0 deletions test/post_install_test.cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fi
-DCMAKE_CXX_FLAGS="@CMAKE_CXX_FLAGS@" \
-DHeffte_DIR=@CMAKE_INSTALL_FULL_LIBDIR@/cmake/Heffte \
-DMPI_CXX_COMPILER="@MPI_CXX_COMPILER@" \
-DMPIEXEC_EXECUTABLE="@MPIEXEC_EXECUTABLE@" \
$heffte_mpic_compiler \
$heffte_mpif_compiler \
-DMPIEXEC_NUMPROC_FLAG="@MPIEXEC_NUMPROC_FLAG@" \
Expand Down
10 changes: 7 additions & 3 deletions test/test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,15 @@ using gpu_backend = heffte::backend::rocfft;

hipStream_t make_stream(backend::rocfft){
hipStream_t result;
hipStreamCreateWithFlags(&result, hipStreamNonBlocking);
rocm::check_error( hipStreamCreateWithFlags(&result, hipStreamNonBlocking), "hipStreamCreateWithFlags()");
return result;
}
void sync_stream(hipStream_t){ hipDeviceSynchronize(); }
void free_stream(hipStream_t stream){ hipStreamDestroy(stream); }
void sync_stream(hipStream_t){
rocm::check_error( hipDeviceSynchronize(), "hipDeviceSynchronize()");
}
void free_stream(hipStream_t stream){
rocm::check_error( hipStreamDestroy(stream), "hipStreamDestroy()");
}
#endif
#ifdef Heffte_ENABLE_ONEAPI
using gpu_backend = heffte::backend::onemkl;
Expand Down
14 changes: 10 additions & 4 deletions test/test_units_nompi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,21 @@ void test_in_node_transpose(){

auto active_intput = test_traits<backend_tag>::load(input);
vcontainer result(24);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_intput.data(), result.data(), nullptr);

// when doing out-of-place transpose we do not need a workspace and can use a nullptr instead,
// but the in/out-place is checked at runtime and one of the branches that is never used
// will still be compiled with the hard-coded nullptr, to suppress the warning we are using a dummy-null dnull
scalar_type *dnull = result.data();

heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_intput.data(), result.data(), dnull);

sassert(match(result, reference));

// test 2, transpose the data to order (2, 1, 0)
box3d<> destination2(std::array<int, 3>{0, 0, 0}, std::array<int, 3>{1, 2, 3}, std::array<int, 3>{2, 1, 0});
plans.clear();
heffte::compute_overlap_map_transpose_pack(0, 1, destination2, {inbox}, proc, offset, sizes, plans);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_intput.data(), result.data(), nullptr);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_intput.data(), result.data(), dnull);

reference = {1.0, 7.0, 13.0, 19.0, 3.0, 9.0, 15.0, 21.0, 5.0, 11.0, 17.0, 23.0,
2.0, 8.0, 14.0, 20.0, 4.0, 10.0, 16.0, 22.0, 6.0, 12.0, 18.0, 24.0};
Expand All @@ -615,14 +621,14 @@ void test_in_node_transpose(){
plans.clear();
heffte::compute_overlap_map_transpose_pack(0, 1, inbox, {destination2}, proc, offset, sizes, plans);
auto active_reference = test_traits<backend_tag>::load(reference);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_reference.data(), result.data(), nullptr);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_reference.data(), result.data(), dnull);
sassert(match(result, input));

// test 3, transpose the data to order (0, 2, 1)
box3d<> destination3(std::array<int, 3>{0, 0, 0}, std::array<int, 3>{1, 2, 3}, std::array<int, 3>{0, 2, 1});
plans.clear();
heffte::compute_overlap_map_transpose_pack(0, 1, destination3, {inbox}, proc, offset, sizes, plans);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_intput.data(), result.data(), nullptr);
heffte::reshape3d_transpose<ltag, int>(device.stream(), plans[0]).apply(1, active_intput.data(), result.data(), dnull);

reference = {1.0, 2.0, 7.0, 8.0, 13.0, 14.0, 19.0, 20.0,
3.0, 4.0, 9.0, 10.0, 15.0, 16.0, 21.0, 22.0,
Expand Down