clamp 22 apps/HelloAndroid/jni/hello_generator.cpp result(x, y) = cast<uint8_t>(clamp(sharper(x, y), 0, 255)); clamp 30 apps/HelloAndroidCamera2/jni/edge_detect_generator.cpp result(x, y) = cast<uint8_t>(clamp(grad_mag(x, y), 0, 255)); clamp 90 apps/HelloHexagon/process.cpp in(clamp(x + rx, 0, W - 1), clamp(y + ry, 0, H - 1), c); clamp 81 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp R = clamp(R, 0.0f, 1.0f); clamp 82 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp G = clamp(G, 0.0f, 1.0f); clamp 83 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp B = clamp(B, 0.0f, 1.0f); clamp 96 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp Expr min_x = clamp(mouse_x - 20, 0, state.dim(0).extent()-1); clamp 97 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp Expr max_x = clamp(mouse_x + 20, 0, state.dim(0).extent()-1); clamp 98 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp Expr min_y = clamp(mouse_y - 20, 0, state.dim(1).extent()-1); clamp 99 apps/HelloiOS/HelloiOS/reaction_diffusion_2_generator.cpp Expr max_y = clamp(mouse_y + 20, 0, state.dim(1).extent()-1); clamp 21 apps/bilateral_grid/bilateral_grid_generator.cpp val = clamp(val, 0.0f, 1.0f); clamp 48 apps/bilateral_grid/bilateral_grid_generator.cpp val = clamp(input(x, y), 0.0f, 1.0f); clamp 15 apps/c_backend/pipeline_generator.cpp f(x, y) = (input(clamp(x+2, 0, input.width()-1), clamp(y-2, 0, input.height()-1)) * 17)/13; clamp 52 apps/camera_pipe/camera_pipe_generator.cpp denoised(x, y) = clamp(input(x, y), 0, a); clamp 265 apps/camera_pipe/camera_pipe_generator.cpp Expr xf = clamp(cast<float>(x - minRaw)*invRange, 0.0f, 1.0f); clamp 274 apps/camera_pipe/camera_pipe_generator.cpp Expr val = cast(result_type, clamp(z*255.0f+0.5f, 0.0f, 255.0f)); clamp 284 apps/camera_pipe/camera_pipe_generator.cpp curved(x, y, c) = curve(clamp(input(x, y, c), 0, 1023)); clamp 290 apps/camera_pipe/camera_pipe_generator.cpp Expr y0 = curve(clamp(u0, 0, 127)); clamp 291 apps/camera_pipe/camera_pipe_generator.cpp Expr y1 = curve(clamp(u0 + 1, 0, 127)); clamp 16 apps/glsl/halide_blur_glsl_generator.cpp input(x,y,c) = cast<float>(input8(clamp(x, input8.left(), input8.right()), clamp 17 apps/glsl/halide_blur_glsl_generator.cpp clamp(y, input8.top(), input8.bottom()), c)) / 255.f; clamp 23 apps/hexagon_benchmarks/conv3x3_generator.cpp output(x, y) = cast<uint8_t>(clamp(sum >> 4, 0, 255)); clamp 116 apps/hexagon_benchmarks/process.h sum += static_cast<int16_t>(u8_in(clamp(x+rx, 0, W-1), clamp(y+ry, 0, H-1))) clamp 121 apps/hexagon_benchmarks/process.h sum = clamp<int16_t>(sum, 0, 255); clamp 183 apps/hexagon_benchmarks/process.h auto u8_in_bounded = [&](int x_, int y_) { return u8_in(clamp(x_, 0, W-1), clamp(y_, 0, H-1)); }; clamp 251 apps/hexagon_benchmarks/process.h auto u8_in_bounded = [&](int x_, int y_) { return u8_in(clamp(x_, 0, W-1), clamp(y_, 0, H-1)); }; clamp 322 apps/hexagon_benchmarks/process.h int16_t val = static_cast<int16_t>(u8_in(clamp(x+rx, 0, W-1), clamp(y+ry, 0, H-1))); clamp 389 apps/hexagon_benchmarks/process.h auto u16_in_bounded = [&](int x_, int y_) { return static_cast<uint16_t>(u8_in(clamp(x_, 0, W-1), clamp(y_, 0, H-1))); }; clamp 400 apps/hexagon_benchmarks/process.h uint8_t sobel_val = static_cast<uint8_t>(clamp(sobel_x + sobel_y, 0, 255)); clamp 477 apps/hexagon_benchmarks/process.h sum += static_cast<int16_t>(u8_in(clamp(x+rx, 0, W-1), clamp(y+ry, 0, H-1))) clamp 482 apps/hexagon_benchmarks/process.h sum = clamp(sum, 0, 255); clamp 24 apps/hexagon_benchmarks/sobel_generator.cpp output(x, y) = cast<uint8_t>(clamp(sobel_x(x, y) + sobel_y(x, y), 0, 255)); clamp 54 apps/interpolate/interpolate.cpp prev = lambda(x, y, c, prev(clamp(x, 0, w), clamp(y, 0, h), c)); clamp 42 apps/local_laplacian/local_laplacian_generator.cpp idx = clamp(cast<int>(idx), 0, (levels-1)*256); clamp 67 apps/local_laplacian/local_laplacian_generator.cpp Expr li = clamp(cast<int>(level), 0, levels-2); clamp 87 apps/local_laplacian/local_laplacian_generator.cpp output(x, y, c) = cast<uint16_t>(clamp(color(x, y, c), 0.0f, 1.0f) * 65535.0f); clamp 152 apps/resize/resize.cpp final(x, y, c) = clamp(resized_y(x, y, c), 0.0f, 1.0f); clamp 45 apps/wavelet/wavelet.cpp rearranged(x, y, 0) = clamp(t(x, y, 0), 0.0f, 1.0f); clamp 46 apps/wavelet/wavelet.cpp rearranged(x + t.width(), y, 0) = clamp(t(x, y, 1)*4.f + 0.5f, 0.0f, 1.0f); clamp 257 python_bindings/python/IROperator.cpp p::def("clamp", &h::clamp, clamp 22 src/BoundaryConditions.cpp actuals.push_back(clamp(likely(arg_var), min, min + extent - 1)); clamp 106 src/BoundaryConditions.cpp clamp(likely(arg_var), min, min + extent - 1)); clamp 146 src/BoundaryConditions.cpp coord = clamp(coord, min, min + extent - 1); clamp 148 src/BoundaryConditions.cpp clamp(likely(arg_var), min, min + extent-1)); clamp 193 src/BoundaryConditions.cpp clamp(likely(arg_var), min, min + extent - 1)); clamp 1497 src/Bounds.cpp check(scope, clamp(1/(x-2), x-10, x+10), -10, 20); clamp 1531 src/Bounds.cpp cast<uint16_t>(clamp(cast<float>(x/y), 0.0f, 4095.0f)), clamp 1535 src/Bounds.cpp cast<uint8_t>(clamp(cast<uint16_t>(x/y), cast<uint16_t>(0), cast<uint16_t>(128))), clamp 121 src/CodeGen_ARM.cpp p.pattern = cast(t, clamp(w_vector + w_vector, tmin, tmax)); clamp 139 src/CodeGen_ARM.cpp p.pattern = cast(t, clamp(ws_vector - ws_vector, tsmin, tsmax)); clamp 759 src/IROperator.cpp Expr biased = clamp(k + fpbias, 0, 255); clamp 847 src/IROperator.cpp e = cast(t, clamp(e, t.min(), t.max())); clamp 849 src/IROperator.cpp e = clamp(cast(t, e), t.min(), t.max()); clamp 868 src/IROperator.cpp e = clamp(e, min_bound, max_bound); clamp 774 src/IROperator.h inline Expr clamp(const Expr &a, const Expr &min_val, const Expr &max_val) { clamp 93 src/Random.cpp return clamp(reinterpret(Float(32), result) - 1.0f, 0.0f, 1.0f); clamp 5479 src/Simplify.cpp check(min(clamp(x, -10, 14), clamp(y, -10, 14)), clamp(min(x, y), -10, 14)); clamp 5488 src/Simplify.cpp check(min(clamp(x+1, y, z), clamp(x-1, y, z)), clamp(x+(-1), y, z)); clamp 5489 src/Simplify.cpp check(max(clamp(x+1, y, z), clamp(x-1, y, z)), clamp(x+1, y, z)); clamp 5596 src/Simplify.cpp clamp(v1, -four, four) clamp 5664 src/Simplify.cpp Expr t1 = clamp(v1, one, four); clamp 5665 src/Simplify.cpp Expr t2 = clamp(v1, -five, -four); clamp 407 src/TrimNoOps.cpp new_min = clamp(i.min, op->min, old_max_var); clamp 412 src/TrimNoOps.cpp new_max = clamp(i.max, new_min_var, old_max_var); clamp 19 test/correctness/argmax.cpp Expr best_so_far = f(clamp(arg_max_f(), 0, 100)); clamp 17 test/correctness/autotune_bug.cpp input(x,y) = in_img(clamp(x, 1, in_img.width()-1), clamp 18 test/correctness/autotune_bug.cpp clamp(y, 1, in_img.height())-1); clamp 16 test/correctness/bounds.cpp h(x, y) = clamp(x+y, 20, 100); clamp 20 test/correctness/bounds_inference_complex.cpp f[i](x, y) = f[j1](x-1, y-1) + f[j2](x+1, clamp(f[j3](x+1, y-1), 0, 7)); clamp 45 test/correctness/bounds_of_abs.cpp f5 = lambda(x, input(cast<int>(clamp(abs(1.0f / (x + .1f)), -50, 50)))); clamp 15 test/correctness/bounds_of_func.cpp f(x) = clamp(x, 10, 20); clamp 35 test/correctness/bounds_of_func.cpp f(x) = clamp(x, 10, p); clamp 76 test/correctness/bounds_of_func.cpp f(x) = Tuple(clamp(x, 0, 2), clamp(x, 1, 3)); clamp 12 test/correctness/computed_index.cpp f(x, y) = in2(x, y, clamp(in1(x, y), 0, 9)); clamp 33 test/correctness/convolution.cpp input(x, y) = in(clamp(x, 0, W-1), clamp(y, 0, H-1)); clamp 22 test/correctness/convolution_multiple_kernels.cpp input(x, y) = in(clamp(x, 0, W-1), clamp(y, 0, H-1)); clamp 21 test/correctness/gpu_large_alloc.cpp g(x, y) = clamp(f(x, y), 20, 100); clamp 29 test/correctness/histogram.cpp hist(clamp(cast<int>(in(r.x, r.y)), 0, 255)) += 1; clamp 70 test/correctness/image_io.cpp f(x, y, c) = cast<uint8_t>(clamp(make_noise(10)(x, y, c), 0.0f, 1.0f) * 255.0f); clamp 60 test/correctness/implicit_args_tests.cpp g(clamp(f(r.x, _), 0, 50), _) += 2; // This means g(f(r.x, _0, _1), _0, _1) += 2 clamp 174 test/correctness/implicit_args_tests.cpp g(clamp(f(r.x, _), 0, 50), _) += Tuple(2); clamp 32 test/correctness/infer_arguments.cpp f(x, y, c) = frac * (input1(clamp(x, 0, height), clamp(y, 0, width), c) + clamp 172 test/correctness/likely.cpp g(x) = f(clamp(x, 0, 10)); // treated as clamp(likely(x), 0, 10) clamp 18 test/correctness/obscure_image_references.cpp RDom r(0, clamp(im2(j), 0, 99)); clamp 230 test/correctness/rfactor.cpp Expr x_clamped = clamp(a(r.x, r.y, r.z), 0, 19); clamp 231 test/correctness/rfactor.cpp Expr y_clamped = clamp(b(r.x, r.y, r.z), 0, 29); clamp 242 test/correctness/rfactor.cpp Expr x_clamped = clamp(a(r.x, r.y, r.z), 0, 19); clamp 243 test/correctness/rfactor.cpp Expr y_clamped = clamp(b(r.x, r.y, r.z), 0, 29); clamp 413 test/correctness/rfactor.cpp hist(clamp(cast<int>(in(r.x, r.y)), 0, 255)) += 1; clamp 631 test/correctness/simd_op_check.cpp check("vpackusdw", 16, u16(clamp(i32_1, 0, max_u16))); clamp 638 test/correctness/simd_op_check.cpp check("vrangeps", 16, clamp(f32_1, 3.0f, 9.0f)); clamp 639 test/correctness/simd_op_check.cpp check("vrangepd", 8, clamp(f64_1, f64(3), f64(9))); clamp 1652 test/correctness/simd_op_check.cpp check("vlut32(v*.b,v*.b,r*)", hvx_width/1, in_u8(clamp(u16_1, 0, 63))); clamp 1654 test/correctness/simd_op_check.cpp check("vlut16(v*.b,v*.h,r*)", hvx_width/2, in_u16(clamp(u16_1, 0, 15))); clamp 27 test/correctness/stream_compaction.cpp Expr bin = clamp(cum_sum(r), 0, 1000); clamp 12 test/correctness/tracing_bounds.cpp f(x) = clamp(x, 0, 100); clamp 125 test/correctness/trim_no_ops.cpp hist(f(clamp(xi, 0, 73), clamp(yi, 0, 73))) += clamp 109 test/correctness/tuple_undef.cpp Expr arg_0 = clamp(select(r.x < 2, 13, undef<int>()), 0, 100); clamp 110 test/correctness/tuple_undef.cpp Expr arg_1 = clamp(select(r.x < 2, 23, undef<int>()), 0, 100); clamp 215 test/correctness/vector_math.cpp Expr xCoord = clamp(cast<int>(input(x, y)), 0, W-1); clamp 216 test/correctness/vector_math.cpp Expr yCoord = clamp(cast<int>(input(x+1, y)), 0, H-1); clamp 261 test/correctness/vector_math.cpp f6(x, clamp(x*x, 0, H-1)) = 1; clamp 283 test/correctness/vector_math.cpp f7(x, y) = clamp(input(x, y), cast<A>(10), cast<A>(20)); clamp 317 test/correctness/vector_math.cpp f9(x, y) = input(x, y) / clamp(input(x+1, y), cast<A>(1), cast<A>(3)); clamp 570 test/correctness/vector_math.cpp weight = clamp(weight, cast<A>(0), cast<A>(1)); clamp 10 test/error/clamp_out_of_range.cpp f(x) = clamp(cast<int8_t>(x), 0, 255); clamp 14 test/error/tuple_arg_select_undef.cpp Expr arg_0 = clamp(select(r.x < 2, 13, undef<int>()), 0, 20); clamp 15 test/error/tuple_arg_select_undef.cpp Expr arg_1 = clamp(select(r.x < 5, 23, undef<int>()), 0, 20); clamp 26 test/opengl/conv_select.cpp Expr coordx = clamp(x + r, 0, input.width() - 1); clamp 45 test/opengl/lut.cpp f0(x, y, c) = lut1d(clamp(e, 0, 7), 0, c); clamp 37 test/opengl/produce.cpp f0(x, y, c) = lut1d(clamp(e, 0, 7)); clamp 96 test/opengl/special_funcs.cpp if (!test_exact<uint8_t>(clamp(x + y, 0, 255), 0, 0)) { clamp 104 test/opengl/special_funcs.cpp clamp(x, 0, 10))) { clamp 23 test/opengl/sum_reduction.cpp Expr coordx = clamp(x + r, 0, input.width() - 1); clamp 69 test/performance/clamped_vector_load.cpp g(x, y) = input(clamp(x, MIN, MAX), y); clamp 83 test/performance/clamped_vector_load.cpp g(x, y) = input(clamp(x, MIN, MAX), y); clamp 97 test/performance/clamped_vector_load.cpp g(x, y) = input(clamp(x, MIN, MAX), y); clamp 27 test/performance/sort.cpp partner = clamp(partner, chunk_start, chunk_end-1); clamp 117 test/performance/sort.cpp Expr value_a = result(clamp(candidate_a, 0, chunk_size-1), 2*y); clamp 118 test/performance/sort.cpp Expr value_b = result(clamp(candidate_b, 0, chunk_size-1), 2*y+1); clamp 110 tutorial/lesson_07_multi_stage_pipelines.cpp Expr clamped_x = clamp(x, 0, input.width()-1); clamp 114 tutorial/lesson_07_multi_stage_pipelines.cpp Expr clamped_y = clamp(y, 0, input.height()-1); clamp 766 tutorial/lesson_09_update_definitions.cpp Expr x_clamped = clamp(x, 0, input.width()-1); clamp 767 tutorial/lesson_09_update_definitions.cpp Expr y_clamped = clamp(y, 0, input.height()-1); clamp 47 tutorial/lesson_12_using_the_gpu.cpp lut(i) = cast<uint8_t>(clamp(pow(i / 255.0f, 1.2f) * 255.0f, 0, 255)); clamp 50 tutorial/lesson_12_using_the_gpu.cpp padded(x, y, c) = input(clamp(x, 0, input.width()-1), clamp 51 tutorial/lesson_12_using_the_gpu.cpp clamp(y, 0, input.height()-1), c);