Skip to content

Commit

Permalink
Rename the FEE GPU-calling function.
Browse files Browse the repository at this point in the history
This should've been done when the analytic code was introduced.
  • Loading branch information
cjordan authored and d3v-null committed Jan 22, 2024
1 parent f4420da commit 2f1bab5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/fee/gpu/double.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn bindgen_test_layout_FEECoeffs() {
);
}
extern "C" {
pub fn gpu_calc_jones(
pub fn gpu_fee_calc_jones(
d_azs: *const f64,
d_zas: *const f64,
num_directions: ::std::os::raw::c_int,
Expand Down
12 changes: 6 additions & 6 deletions src/fee/gpu/fee.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ typedef struct FEECoeffs {
const unsigned char n_max;
} FEECoeffs;

const char *gpu_calc_jones(const FLOAT *d_azs, const FLOAT *d_zas, int num_directions, const FEECoeffs *d_coeffs,
int num_coeffs, const void *d_norm_jones, const FLOAT *d_latitude_rad, const int iau_reorder,
void *d_results);
const char *gpu_fee_calc_jones(const FLOAT *d_azs, const FLOAT *d_zas, int num_directions, const FEECoeffs *d_coeffs,
int num_coeffs, const void *d_norm_jones, const FLOAT *d_latitude_rad,
const int iau_reorder, void *d_results);

#ifdef __cplusplus
} // extern "C"
Expand Down Expand Up @@ -409,9 +409,9 @@ __global__ void fee_kernel(const FEECoeffs coeffs, const FLOAT *azs, const FLOAT
}
}

extern "C" const char *gpu_calc_jones(const FLOAT *d_azs, const FLOAT *d_zas, int num_directions,
const FEECoeffs *d_coeffs, int num_coeffs, const void *d_norm_jones,
const FLOAT *d_latitude_rad, const int iau_order, void *d_results) {
extern "C" const char *gpu_fee_calc_jones(const FLOAT *d_azs, const FLOAT *d_zas, int num_directions,
const FEECoeffs *d_coeffs, int num_coeffs, const void *d_norm_jones,
const FLOAT *d_latitude_rad, const int iau_order, void *d_results) {
dim3 gridDim, blockDim;
blockDim.x = warpSize;
gridDim.x = (int)ceil((double)num_directions / (double)blockDim.x);
Expand Down
4 changes: 2 additions & 2 deletions src/fee/gpu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ impl FEEBeamGpu {

// The return value is a pointer to a CUDA/HIP error string. If it's null
// then everything is fine.
let error_message_ptr = gpu_calc_jones(
let error_message_ptr = gpu_fee_calc_jones(
d_az_rad,
d_za_rad,
num_directions,
Expand All @@ -498,7 +498,7 @@ impl FEEBeamGpu {
let error_message = CStr::from_ptr(error_message_ptr)
.to_str()
.unwrap_or("<cannot read GPU error string>");
let our_error_str = format!("fee.h:gpu_calc_jones failed with: {error_message}");
let our_error_str = format!("fee.h:gpu_fee_calc_jones failed with: {error_message}");
Err(FEEBeamError::Gpu(GpuError::Kernel {
msg: our_error_str.into(),
file: file!(),
Expand Down
2 changes: 1 addition & 1 deletion src/fee/gpu/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn bindgen_test_layout_FEECoeffs() {
);
}
extern "C" {
pub fn gpu_calc_jones(
pub fn gpu_fee_calc_jones(
d_azs: *const f32,
d_zas: *const f32,
num_directions: ::std::os::raw::c_int,
Expand Down
2 changes: 1 addition & 1 deletion src/update_rust_bindings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ for PRECISION in SINGLE DOUBLE; do
echo "Generating bindings for ${LOWER_CASE}-precision GPU code"

bindgen "${SCRIPTPATH}"/fee/gpu/fee.h \
--allowlist-function "gpu_calc_jones.*" \
--allowlist-function "gpu_fee_calc_jones.*" \
--allowlist-type "FEECoeffs" \
-- -D BINDGEN -D "${PRECISION}" \
-I "${SCRIPTPATH}"/gpu_common/ \
Expand Down

0 comments on commit 2f1bab5

Please sign in to comment.