Skip to content

Commit

Permalink
gpujpeg_preprocessor.cu: make unit_size inline
Browse files Browse the repository at this point in the history
Instead of constexpr function, that may cause problems on some ancient
platforms (eg. CUDA 8.0 on OS X 10.11) use inline - should behave
the same.

this modifies the commit a12554c from 2024-09-24
  • Loading branch information
MartinPulec committed Nov 20, 2024
1 parent 7537aa6 commit 28f08ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gpujpeg_preprocessor.cu
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ template<enum gpujpeg_pixel_format>
inline __device__ void raw_to_comp_load(const uint8_t* d_data_raw, int &image_width, int &image_height, int &image_position, int &x, int &y, uchar4 &r);

template<enum gpujpeg_pixel_format>
constexpr int __device__ unit_size() { return 1; }
inline __device__ int unit_size() { return 1; }

template<>
inline __device__ void raw_to_comp_load<GPUJPEG_U8>(const uint8_t* d_data_raw, int &image_width, int &image_height, int &image_position, int &x, int &y, uchar4 &r)
Expand Down Expand Up @@ -121,7 +121,7 @@ inline __device__ void raw_to_comp_load<GPUJPEG_420_U8_P0P1P2>(const uint8_t* d_
}

template<>
constexpr int __device__ unit_size<GPUJPEG_444_U8_P012>() { return 3; }
inline __device__ int unit_size<GPUJPEG_444_U8_P012>() { return 3; }

template<>
inline __device__ void raw_to_comp_load<GPUJPEG_444_U8_P012>(const uint8_t* d_data_raw, int &image_width, int &image_height, int &offset, int &x, int &y, uchar4 &r)
Expand All @@ -132,7 +132,7 @@ inline __device__ void raw_to_comp_load<GPUJPEG_444_U8_P012>(const uint8_t* d_da
}

template<>
constexpr int __device__ unit_size<GPUJPEG_4444_U8_P0123>() { return 4; }
inline __device__ int unit_size<GPUJPEG_4444_U8_P0123>() { return 4; }

template<>
inline __device__ void raw_to_comp_load<GPUJPEG_4444_U8_P0123>(const uint8_t* d_data_raw, int &image_width, int &image_height, int &offset, int &x, int &y, uchar4 &r)
Expand All @@ -144,7 +144,7 @@ inline __device__ void raw_to_comp_load<GPUJPEG_4444_U8_P0123>(const uint8_t* d_
}

template<>
constexpr int __device__ unit_size<GPUJPEG_422_U8_P1020>() { return 2; }
inline __device__ int unit_size<GPUJPEG_422_U8_P1020>() { return 2; }

template<>
inline __device__ void raw_to_comp_load<GPUJPEG_422_U8_P1020>(const uint8_t* d_data_raw, int &image_width, int &image_height, int &offset, int &x, int &y, uchar4 &r)
Expand Down

0 comments on commit 28f08ff

Please sign in to comment.