diff --git a/include/cudecomp.h b/include/cudecomp.h index f84a805..0a92966 100644 --- a/include/cudecomp.h +++ b/include/cudecomp.h @@ -598,7 +598,8 @@ cudecompResult_t cudecompUpdateHalosX(cudecompHandle_t handle, cudecompGridDesc_ * i-th global domain axis. Symmetric halos are assumed (e.g. a value of one in halo_extents means there are 2 halo * elements, one element on each side) * @param[in] halo_periods An array of three booleans to define halo periodicity of the input data, in global order. - * If the i-th entry in this array is true, the domain is treated periodically along the i-th global domain axis. + * If the i-th entry in this array is true, the domain is treated periodically along the i-th global domain axis. A NULL + * pointer can be provided if none of the domain axes are periodic. * @param[in] dim Which pencil dimension (global indexed) to perform the halo update * @param[in] padding An array of three integers to define padding of the input data, in global order. The i-th entry * in this array should contain the number of elements to treat as padding in the i-th global domain axis. If the input @@ -624,7 +625,8 @@ cudecompResult_t cudecompUpdateHalosY(cudecompHandle_t handle, cudecompGridDesc_ * i-th global domain axis. Symmetric halos are assumed (e.g. a value of one in halo_extents means there are 2 halo * elements, one element on each side) * @param[in] halo_periods An array of three booleans to define halo periodicity of the input data, in global order. - * If the i-th entry in this array is true, the domain is treated periodically along the i-th global domain axis. + * If the i-th entry in this array is true, the domain is treated periodically along the i-th global domain axis. A NULL + * pointer can be provided if none of the domain axes are periodic. * @param[in] dim Which pencil dimension (global indexed) to perform the halo update * @param[in] padding An array of three integers to define padding of the input data, in global order. The i-th entry * in this array should contain the number of elements to treat as padding in the i-th global domain axis. If the input diff --git a/src/cudecomp.cc b/src/cudecomp.cc index 0fbadbb..6096ffd 100644 --- a/src/cudecomp.cc +++ b/src/cudecomp.cc @@ -1647,7 +1647,6 @@ cudecompResult_t cudecompUpdateHalosX(cudecompHandle_t handle, cudecompGridDesc_ // No halos, quick return. return CUDECOMP_RESULT_SUCCESS; } - if (!halo_periods) { THROW_INVALID_USAGE("halo_periods argument cannot be null"); } if (!input) { THROW_INVALID_USAGE("input argument cannot be null"); } if (!work) { THROW_INVALID_USAGE("work argument cannot be null"); } if (dim < 0 || dim > 2) { THROW_INVALID_USAGE("dim argument out of range"); } @@ -1690,7 +1689,6 @@ cudecompResult_t cudecompUpdateHalosY(cudecompHandle_t handle, cudecompGridDesc_ // No halos, quick return. return CUDECOMP_RESULT_SUCCESS; } - if (!halo_periods) { THROW_INVALID_USAGE("halo_periods argument cannot be null"); } if (!input) { THROW_INVALID_USAGE("input argument cannot be null"); } if (!work) { THROW_INVALID_USAGE("work argument cannot be null"); } if (dim < 0 || dim > 2) { THROW_INVALID_USAGE("dim argument out of range"); } @@ -1733,7 +1731,6 @@ cudecompResult_t cudecompUpdateHalosZ(cudecompHandle_t handle, cudecompGridDesc_ // No halos, quick return. return CUDECOMP_RESULT_SUCCESS; } - if (!halo_periods) { THROW_INVALID_USAGE("halo_periods argument cannot be null"); } if (!input) { THROW_INVALID_USAGE("input argument cannot be null"); } if (!work) { THROW_INVALID_USAGE("work argument cannot be null"); } if (dim < 0 || dim > 2) { THROW_INVALID_USAGE("dim argument out of range"); } diff --git a/tests/ctest/api_tests.cc b/tests/ctest/api_tests.cc index 32cae83..9ebcadd 100644 --- a/tests/ctest/api_tests.cc +++ b/tests/ctest/api_tests.cc @@ -1228,9 +1228,6 @@ TEST_F(ApiHaloTest, RejectsInvalidArguments) { EXPECT_EQ(CUDECOMP_RESULT_INVALID_USAGE, cudecompUpdateHalosX(handle_, grid_desc, valid_pointer, valid_pointer, CUDECOMP_FLOAT, nullptr, kHaloPeriods.data(), 0, nullptr, 0)); - EXPECT_EQ(CUDECOMP_RESULT_INVALID_USAGE, - cudecompUpdateHalosX(handle_, grid_desc, valid_pointer, valid_pointer, CUDECOMP_FLOAT, kHaloExtents.data(), - nullptr, 0, nullptr, 0)); EXPECT_EQ(CUDECOMP_RESULT_INVALID_USAGE, cudecompUpdateHalosX(handle_, grid_desc, nullptr, valid_pointer, CUDECOMP_FLOAT, kHaloExtents.data(), kHaloPeriods.data(), 0, nullptr, 0));