Skip to content

Commit 215388f

Browse files
committed
consistent float literals
1 parent c03f031 commit 215388f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

ggml/src/ggml-cpu/ops.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7424,14 +7424,14 @@ static void ggml_compute_forward_upscale_f32(
74247424
// Similar to F.interpolate(..., mode="bilinear", align_corners=False, antialias=True)
74257425
// https://github.com/pytorch/pytorch/blob/8871ff29b743948d1225389d5b7068f37b22750b/aten/src/ATen/native/cpu/UpSampleKernel.cpp
74267426
auto triangle_filter = [](float x) -> float {
7427-
return std::max(1.0f - fabsf(x), 0.f);
7427+
return std::max(1.0f - fabsf(x), 0.0f);
74287428
};
74297429

74307430
// support and invscale, maximum 1 pixel for bilinear
7431-
const float support1 = std::max(1.f, 1.f / sf1);
7432-
const float invscale1 = 1.0 / support1;
7433-
const float support0 = std::max(1.f, 1.f / sf0);
7434-
const float invscale0 = 1.f / support0;
7431+
const float support1 = std::max(1.0f, 1.0f / sf1);
7432+
const float invscale1 = 1.0f / support1;
7433+
const float support0 = std::max(1.0f, 1.0f / sf0);
7434+
const float invscale0 = 1.0f / support0;
74357435

74367436
for (int64_t i3 = 0; i3 < ne3; i3++) {
74377437
const int64_t i03 = i3 / sf3;

ggml/src/ggml-cuda/upscale.cu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ static __global__ void upscale_f32_bilinear_antialias(const float * src0, float
108108
const float x = ((float)i10_dst + pixel_offset) / sf0;
109109

110110
// support and invscale, maximum 1 pixel for bilinear
111-
const float support1 = max(1.f / sf1, 1.f);
112-
const float invscale1 = 1.0 / support1;
113-
const float support0 = max(1.f / sf0, 1.f);
114-
const float invscale0 = 1.f / support0;
111+
const float support1 = max(1.0f / sf1, 1.0f);
112+
const float invscale1 = 1.0f / support1;
113+
const float support0 = max(1.0f / sf0, 1.0f);
114+
const float invscale0 = 1.0f / support0;
115115

116116
// the range of source pixels that contribute
117117
const int64_t x_min = max(int64_t(0), int64_t(x - support0 + pixel_offset));
@@ -124,7 +124,7 @@ static __global__ void upscale_f32_bilinear_antialias(const float * src0, float
124124
float total_weight = 0.0f;
125125

126126
auto triangle_filter = [](float x) -> float {
127-
return max(1.0f - fabsf(x), 0.f);
127+
return max(1.0f - fabsf(x), 0.0f);
128128
};
129129

130130
for (int64_t sy = y_min; sy < y_max; sy++) {

0 commit comments

Comments
 (0)