Skip to content

Commit 28f08ff

Browse files
committed
gpujpeg_preprocessor.cu: make unit_size inline
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
1 parent 7537aa6 commit 28f08ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gpujpeg_preprocessor.cu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ template<enum gpujpeg_pixel_format>
8686
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);
8787

8888
template<enum gpujpeg_pixel_format>
89-
constexpr int __device__ unit_size() { return 1; }
89+
inline __device__ int unit_size() { return 1; }
9090

9191
template<>
9292
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)
@@ -121,7 +121,7 @@ inline __device__ void raw_to_comp_load<GPUJPEG_420_U8_P0P1P2>(const uint8_t* d_
121121
}
122122

123123
template<>
124-
constexpr int __device__ unit_size<GPUJPEG_444_U8_P012>() { return 3; }
124+
inline __device__ int unit_size<GPUJPEG_444_U8_P012>() { return 3; }
125125

126126
template<>
127127
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)
@@ -132,7 +132,7 @@ inline __device__ void raw_to_comp_load<GPUJPEG_444_U8_P012>(const uint8_t* d_da
132132
}
133133

134134
template<>
135-
constexpr int __device__ unit_size<GPUJPEG_4444_U8_P0123>() { return 4; }
135+
inline __device__ int unit_size<GPUJPEG_4444_U8_P0123>() { return 4; }
136136

137137
template<>
138138
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)
@@ -144,7 +144,7 @@ inline __device__ void raw_to_comp_load<GPUJPEG_4444_U8_P0123>(const uint8_t* d_
144144
}
145145

146146
template<>
147-
constexpr int __device__ unit_size<GPUJPEG_422_U8_P1020>() { return 2; }
147+
inline __device__ int unit_size<GPUJPEG_422_U8_P1020>() { return 2; }
148148

149149
template<>
150150
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)

0 commit comments

Comments
 (0)