Skip to content

Commit

Permalink
Adding "inline" to idx_to_dim_list() and coord_to_lindex()
Browse files Browse the repository at this point in the history
These two functions are frequently called inside loops so we
request compilers to inline them if possible.
  • Loading branch information
dqwu authored and jedwards4b committed Apr 5, 2019
1 parent 1228cb7 commit ed840ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clib/pio_rearrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* corresponding to this index.
* @author Jim Edwards
*/
void idx_to_dim_list(int ndims, const int *gdimlen, PIO_Offset idx,
inline void idx_to_dim_list(int ndims, const int *gdimlen, PIO_Offset idx,
PIO_Offset *dim_list)
{
/* Check inputs. */
Expand Down Expand Up @@ -199,7 +199,7 @@ PIO_Offset find_region(int ndims, const int *gdimlen, int maplen, const PIO_Offs
* @returns the local array index.
* @author Jim Edwards
*/
PIO_Offset coord_to_lindex(int ndims, const PIO_Offset *lcoord, const PIO_Offset *count)
inline PIO_Offset coord_to_lindex(int ndims, const PIO_Offset *lcoord, const PIO_Offset *count)
{
PIO_Offset lindex = 0;
PIO_Offset stride = 1;
Expand Down

0 comments on commit ed840ec

Please sign in to comment.