From ff22cfd3378dbf525f83d1e3bf38da8d0b3fbeeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:32:44 -0500 Subject: [PATCH 1/2] Bump rocm-docs-core from 1.13.0 to 1.14.1 in /docs/sphinx (#3774) --- docs/sphinx/requirements.in | 2 +- docs/sphinx/requirements.txt | 141 +++++++++++++++++++++++++++++++++-- 2 files changed, 137 insertions(+), 6 deletions(-) diff --git a/docs/sphinx/requirements.in b/docs/sphinx/requirements.in index 19cbfd58c81..a2c043ff03e 100644 --- a/docs/sphinx/requirements.in +++ b/docs/sphinx/requirements.in @@ -1,2 +1,2 @@ -rocm-docs-core==1.13.0 +rocm-docs-core==1.14.1 sphinx-collapse diff --git a/docs/sphinx/requirements.txt b/docs/sphinx/requirements.txt index 75030b2d219..7eb815be8bf 100644 --- a/docs/sphinx/requirements.txt +++ b/docs/sphinx/requirements.txt @@ -1,7 +1,7 @@ ##################################################################################### # The MIT License (MIT) # -# Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -32,6 +32,13 @@ accessible-pygments==0.0.5 # via pydata-sphinx-theme alabaster==0.7.16 # via sphinx +asttokens==3.0.0 + # via stack-data +attrs==24.3.0 + # via + # jsonschema + # jupyter-cache + # referencing babel==2.15.0 # via # pydata-sphinx-theme @@ -49,9 +56,17 @@ cffi==1.16.0 charset-normalizer==3.3.2 # via requests click==8.1.7 - # via sphinx-external-toc + # via + # jupyter-cache + # sphinx-external-toc +comm==0.2.2 + # via ipykernel cryptography==43.0.1 # via pyjwt +debugpy==1.8.12 + # via ipykernel +decorator==5.1.1 + # via ipython deprecated==1.2.14 # via pygithub docutils==0.21.2 @@ -60,36 +75,104 @@ docutils==0.21.2 # myst-parser # pydata-sphinx-theme # sphinx +exceptiongroup==1.2.2 + # via ipython +executing==2.1.0 + # via stack-data fastjsonschema==2.20.0 - # via rocm-docs-core + # via + # nbformat + # rocm-docs-core gitdb==4.0.11 # via gitpython gitpython==3.1.43 # via rocm-docs-core +greenlet==3.1.1 + # via sqlalchemy idna==3.7 # via requests imagesize==1.4.1 # via sphinx +importlib-metadata==8.6.1 + # via + # jupyter-cache + # myst-nb +ipykernel==6.29.5 + # via myst-nb +ipython==8.31.0 + # via + # ipykernel + # myst-nb +jedi==0.19.2 + # via ipython jinja2==3.1.4 # via # myst-parser # sphinx +jsonschema==4.23.0 + # via nbformat +jsonschema-specifications==2024.10.1 + # via jsonschema +jupyter-cache==1.0.1 + # via myst-nb +jupyter-client==8.6.3 + # via + # ipykernel + # nbclient +jupyter-core==5.7.2 + # via + # ipykernel + # jupyter-client + # nbclient + # nbformat markdown-it-py==3.0.0 # via # mdit-py-plugins # myst-parser markupsafe==2.1.5 # via jinja2 +matplotlib-inline==0.1.7 + # via + # ipykernel + # ipython mdit-py-plugins==0.4.1 # via myst-parser mdurl==0.1.2 # via markdown-it-py -myst-parser==3.0.1 +myst-nb==1.1.2 # via rocm-docs-core +myst-parser==3.0.1 + # via myst-nb +nbclient==0.10.2 + # via + # jupyter-cache + # myst-nb +nbformat==5.10.4 + # via + # jupyter-cache + # myst-nb + # nbclient +nest-asyncio==1.6.0 + # via ipykernel packaging==24.1 # via + # ipykernel # pydata-sphinx-theme # sphinx +parso==0.8.4 + # via jedi +pexpect==4.9.0 + # via ipython +platformdirs==4.3.6 + # via jupyter-core +prompt-toolkit==3.0.50 + # via ipython +psutil==6.1.1 + # via ipykernel +ptyprocess==0.7.0 + # via pexpect +pure-eval==0.2.3 + # via stack-data pycparser==2.22 # via cffi pydata-sphinx-theme==0.15.4 @@ -101,23 +184,42 @@ pygithub==2.3.0 pygments==2.18.0 # via # accessible-pygments + # ipython # pydata-sphinx-theme # sphinx pyjwt[crypto]==2.8.0 # via pygithub pynacl==1.5.0 # via pygithub +python-dateutil==2.9.0.post0 + # via jupyter-client pyyaml==6.0.1 # via + # jupyter-cache + # myst-nb # myst-parser # rocm-docs-core # sphinx-external-toc +pyzmq==26.2.0 + # via + # ipykernel + # jupyter-client +referencing==0.36.1 + # via + # jsonschema + # jsonschema-specifications requests==2.32.3 # via # pygithub # sphinx -rocm-docs-core==1.13.0 +rocm-docs-core==1.14.1 # via -r requirements.in +rpds-py==0.22.3 + # via + # jsonschema + # referencing +six==1.17.0 + # via python-dateutil smmap==5.0.1 # via gitdb snowballstemmer==2.2.0 @@ -127,6 +229,7 @@ soupsieve==2.5 sphinx==7.4.7 # via # breathe + # myst-nb # myst-parser # pydata-sphinx-theme # rocm-docs-core @@ -160,15 +263,43 @@ sphinxcontrib-qthelp==1.0.8 # via sphinx sphinxcontrib-serializinghtml==1.1.10 # via sphinx +sqlalchemy==2.0.37 + # via jupyter-cache +stack-data==0.6.3 + # via ipython +tabulate==0.9.0 + # via jupyter-cache tomli==2.0.1 # via sphinx +tornado==6.4.2 + # via + # ipykernel + # jupyter-client +traitlets==5.14.3 + # via + # comm + # ipykernel + # ipython + # jupyter-client + # jupyter-core + # matplotlib-inline + # nbclient + # nbformat typing-extensions==4.12.2 # via + # ipython + # myst-nb # pydata-sphinx-theme # pygithub + # referencing + # sqlalchemy urllib3==2.2.2 # via # pygithub # requests +wcwidth==0.2.13 + # via prompt-toolkit wrapt==1.16.0 # via deprecated +zipp==3.21.0 + # via importlib-metadata From 8389304ae4bf1ae878cdab84f0aedfd21eedc384 Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Wed, 22 Jan 2025 12:52:13 -0600 Subject: [PATCH 2/2] Use and keyword consistently (#3676) --- .clang-tidy | 4 +++ src/apply_alpha_beta.cpp | 4 +-- src/driver/argument_parser.hpp | 4 +-- src/driver/perf.cpp | 4 +-- src/include/migraphx/op/nonmaxsuppression.hpp | 4 +-- src/include/migraphx/raw_data.hpp | 6 ++-- src/include/migraphx/requires.hpp | 10 +++---- src/include/migraphx/tensor_view.hpp | 6 ++-- src/instruction.cpp | 6 ++-- src/program.cpp | 6 ++-- src/simplify_algebra.cpp | 2 +- src/targets/cpu/lowering.cpp | 9 +++--- .../kernels/include/migraphx/kernels/dpp.hpp | 4 +-- .../include/migraphx/kernels/float8.hpp | 7 +++-- .../kernels/include/migraphx/kernels/math.hpp | 30 +++++++++++++------ src/targets/ref/lowering.cpp | 9 +++--- test/gpu/fuse_mlir.cpp | 4 +-- test/simplify_algebra_test.cpp | 4 +-- 18 files changed, 72 insertions(+), 51 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index f4262fd3c13..ef195c60ac9 100755 --- a/.clang-tidy +++ b/.clang-tidy @@ -117,3 +117,7 @@ CheckOptions: value: MIGRAPHX_ - key: readability-identifier-naming.ConstexprMethodIgnoredRegexp value: 'quiet_NaN|signaling_NaN' + - key: readability-operators-representation.BinaryOperators + value: 'and;or;not' + - key: readability-operators-representation.OverloadedOperators + value: 'and;or;not' diff --git a/src/apply_alpha_beta.cpp b/src/apply_alpha_beta.cpp index 7947ce29758..5f86a1dc1a6 100644 --- a/src/apply_alpha_beta.cpp +++ b/src/apply_alpha_beta.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -51,7 +51,7 @@ instruction_ref insert_apply_alpha_beta(module& m, auto op_res = m.insert_instruction(pos, op, a, b); if(args.size() == 3) { - if(not float_equal(beta.at(0), 0.0) && args[2]->get_shape().elements() > 0) + if(not float_equal(beta.at(0), 0.0) and args[2]->get_shape().elements() > 0) { auto out_lens = op_res->get_shape().lens(); auto c = args[2]; diff --git a/src/driver/argument_parser.hpp b/src/driver/argument_parser.hpp index b1b3f5a4f4c..f7f951f5c4f 100644 --- a/src/driver/argument_parser.hpp +++ b/src/driver/argument_parser.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -433,7 +433,7 @@ struct argument_parser argument* input_argument = self.find_argument([](const auto& arg) { return arg.flags.empty(); }); auto required_usages = get_argument_usages(get_required_arguments()); - if(required_usages.empty() && input_argument) + if(required_usages.empty() and input_argument) required_usages.push_back(input_argument->metavar); required_usages.insert(required_usages.begin(), ""); print_usage(required_usages); diff --git a/src/driver/perf.cpp b/src/driver/perf.cpp index d9e53b1705e..47dbe0fc4d0 100644 --- a/src/driver/perf.cpp +++ b/src/driver/perf.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,7 +127,7 @@ bool is_offload_copy_set(const program& p) for(const auto& j : return_args) { auto alias_ins = instruction::get_output_alias(j, true); - if((alias_ins->name() == "@param" && param_ins.erase(alias_ins) == 0) or + if((alias_ins->name() == "@param" and param_ins.erase(alias_ins) == 0) or (alias_ins->name() != "hip::copy_from_gpu")) return false; } diff --git a/src/include/migraphx/op/nonmaxsuppression.hpp b/src/include/migraphx/op/nonmaxsuppression.hpp index 59fd2d0d750..d212dcbba3c 100644 --- a/src/include/migraphx/op/nonmaxsuppression.hpp +++ b/src/include/migraphx/op/nonmaxsuppression.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -335,7 +335,7 @@ struct nonmaxsuppression auto batch_boxes_start = boxes.begin() + batch_idx * num_boxes * 4; auto boxes_heap = filter_boxes_by_score(scores_start, num_boxes, score_threshold); int64_t selected_boxes_inside_class = 0; - while(not boxes_heap.empty() && + while(not boxes_heap.empty() and selected_boxes_inside_class < max_output_boxes_per_class) { // select next top scorer box and remove any boxes from boxes_heap that exceeds IOU diff --git a/src/include/migraphx/raw_data.hpp b/src/include/migraphx/raw_data.hpp index 19373bab6d4..3d3a7be081f 100644 --- a/src/include/migraphx/raw_data.hpp +++ b/src/include/migraphx/raw_data.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -275,7 +275,7 @@ auto visit_all(const std::vector& x) template {} && + MIGRAPHX_REQUIRES(std::is_base_of{} and std::is_base_of{})> bool operator==(const T& x, const U& y) { @@ -294,7 +294,7 @@ bool operator==(const T& x, const U& y) template {} && + MIGRAPHX_REQUIRES(std::is_base_of{} and std::is_base_of{})> bool operator!=(const T& x, const U& y) { diff --git a/src/include/migraphx/requires.hpp b/src/include/migraphx/requires.hpp index 2d8607129cd..8b5e333b574 100644 --- a/src/include/migraphx/requires.hpp +++ b/src/include/migraphx/requires.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,10 +47,10 @@ using bool_c = std::integral_constant; #define MIGRAPHX_REQUIRES(...) class = void #define MIGRAPHX_CLASS_REQUIRES(...) void #else -#define MIGRAPHX_REQUIRES(...) \ - long MIGRAPHX_REQUIRES_VAR() = __LINE__, \ - typename std::enable_if<(MIGRAPHX_REQUIRES_VAR() == __LINE__ && \ - (migraphx::and_<__VA_ARGS__>{})), \ +#define MIGRAPHX_REQUIRES(...) \ + long MIGRAPHX_REQUIRES_VAR() = __LINE__, \ + typename std::enable_if<(MIGRAPHX_REQUIRES_VAR() == __LINE__ and \ + (migraphx::and_<__VA_ARGS__>{})), \ int>::type = 0 #define MIGRAPHX_CLASS_REQUIRES(...) typename std::enable_if<(migraphx::and_<__VA_ARGS__>{})>::type #endif diff --git a/src/include/migraphx/tensor_view.hpp b/src/include/migraphx/tensor_view.hpp index 9c5ff978e83..a8a3579d4f6 100644 --- a/src/include/migraphx/tensor_view.hpp +++ b/src/include/migraphx/tensor_view.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -101,13 +101,13 @@ struct tensor_view T& operator[](std::size_t i) { - assert(not this->empty() && i < this->size()); + assert(not this->empty() and i < this->size()); return m_data[m_shape.index(i)]; } const T& operator[](std::size_t i) const { - assert(not this->empty() && i < this->size()); + assert(not this->empty() and i < this->size()); return m_data[m_shape.index(i)]; } diff --git a/src/instruction.cpp b/src/instruction.cpp index 235c551d709..9c2d59f97da 100644 --- a/src/instruction.cpp +++ b/src/instruction.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -127,7 +127,7 @@ bool operator==(const instruction& i, instruction_ref ref) bool instruction::valid(instruction_ref start, bool check_order) const { - return valid() && std::all_of(arguments.begin(), arguments.end(), [&](instruction_ref i) { + return valid() and std::all_of(arguments.begin(), arguments.end(), [&](instruction_ref i) { auto self = std::find(i->outputs().begin(), i->outputs().end(), *this); bool ret = self != i->outputs().end(); if(check_order) @@ -162,7 +162,7 @@ bool instruction::valid() const } } - return (result == computed) && + return (result == computed) and std::all_of(output.begin(), output.end(), [&](instruction_ref i) { return std::find(i->inputs().begin(), i->inputs().end(), *this) != i->inputs().end(); }); diff --git a/src/program.cpp b/src/program.cpp index 5cfb62baf39..0170809c1de 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1242,12 +1242,12 @@ bool references_instruction(Map& m, const instruction& ins, const std::string& n void program::remove_module(const std::string& name) { // cppcheck-suppress assertWithSideEffect - assert(is_unused_module(impl->modules, generic_get_modules(this->get_main_module()), name) && + assert(is_unused_module(impl->modules, generic_get_modules(this->get_main_module()), name) and "Module used in program"); assert(std::none_of( impl->modules.at(name).begin(), impl->modules.at(name).end(), - [&](auto&& ins) { return references_instruction(impl->modules, ins, name); }) && + [&](auto&& ins) { return references_instruction(impl->modules, ins, name); }) and "Instruction referenced in another module"); // if an instruction has an input out side of the current module, need to remove diff --git a/src/simplify_algebra.cpp b/src/simplify_algebra.cpp index 469d1dd50d6..e79d4d48628 100644 --- a/src/simplify_algebra.cpp +++ b/src/simplify_algebra.cpp @@ -1281,7 +1281,7 @@ struct find_splits { assert(not std::none_of(start->inputs().begin(), start->inputs().end(), [](auto i) { return i->name() == "slice"; - }) && "one argument must be a split"); + }) and "one argument must be a split"); split_idx = get_binary_op_split_idx(group, splits); assert(split_idx < 2); diff --git a/src/targets/cpu/lowering.cpp b/src/targets/cpu/lowering.cpp index debea49bb37..a68eae82023 100644 --- a/src/targets/cpu/lowering.cpp +++ b/src/targets/cpu/lowering.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -132,9 +132,10 @@ struct cpu_im2col kernel_w)([&](std::size_t c, std::size_t koffset, std::size_t loffset) { auto idx = iinput + long(koffset) - kdiv2_h; auto jdx = jinput + long(loffset) - kdiv2_w; - col(ldx, p) = ((idx >= 0) && (idx < height) && (jdx >= 0) && (jdx < width)) - ? input(0, c, idx, jdx) - : 0; + col(ldx, p) = + ((idx >= 0) and (idx < height) and (jdx >= 0) and (jdx < width)) + ? input(0, c, idx, jdx) + : 0; p++; }); } diff --git a/src/targets/gpu/kernels/include/migraphx/kernels/dpp.hpp b/src/targets/gpu/kernels/include/migraphx/kernels/dpp.hpp index 8cf950f2d24..5ae4c6866f9 100644 --- a/src/targets/gpu/kernels/include/migraphx/kernels/dpp.hpp +++ b/src/targets/gpu/kernels/include/migraphx/kernels/dpp.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,7 @@ namespace migraphx { -constexpr bool is_power_of_2(unsigned int x) { return x > 0 && (x & (x - 1)) == 0u; } +constexpr bool is_power_of_2(unsigned int x) { return x > 0 and (x & (x - 1)) == 0u; } #ifndef MIGRAPHX_HAS_DPP #define MIGRAPHX_HAS_DPP 1 diff --git a/src/targets/gpu/kernels/include/migraphx/kernels/float8.hpp b/src/targets/gpu/kernels/include/migraphx/kernels/float8.hpp index e94d3573fd6..8227ae22017 100644 --- a/src/targets/gpu/kernels/include/migraphx/kernels/float8.hpp +++ b/src/targets/gpu/kernels/include/migraphx/kernels/float8.hpp @@ -1,5 +1,8 @@ /* ************************************************************************ - * Copyright (C) 2016-2023 Advanced Micro Devices, Inc. All rights reserved. + * + * The MIT License (MIT) + * + * Copyright (C) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -296,7 +299,7 @@ struct float8 } else { - return (data == 0x00) || (data == 0x80); + return (data == 0x00) or (data == 0x80); } } diff --git a/src/targets/gpu/kernels/include/migraphx/kernels/math.hpp b/src/targets/gpu/kernels/include/migraphx/kernels/math.hpp index 368ee9bc5fa..5052d661114 100644 --- a/src/targets/gpu/kernels/include/migraphx/kernels/math.hpp +++ b/src/targets/gpu/kernels/include/migraphx/kernels/math.hpp @@ -121,18 +121,30 @@ __device__ auto wrap(F f, T x, Ts... xs) #define MIGRAPHX_DEVICE_MATH_BINARY_FOR(type, name, fname) \ inline auto __device__ name(type x, type y) -> type { return fname(x, y); } +// NOLINTNEXTLINE +#define MIGRAPHX_DEVICE_MATH_HALF2(name, fname) \ + template \ + auto __device__ name(migraphx::vec x, Ts... xs) \ + MIGRAPHX_RETURNS(migraphx::vec{fname(x, xs...)}); \ + template 2))> \ + auto __device__ name(migraphx::vec x, Ts... xs) \ + { \ + return vec_packed_transform<2>(x, xs...)( \ + [](auto... ys) -> migraphx::vec { return fname(ys...); }); \ + } + // Template with two overloads for math functions, one for half2 type and one for more generic // vectorization where N is 4 or another even number. // NOLINTNEXTLINE -#define MIGRAPHX_DEVICE_MATH_VEC2(type, name, fname) \ - template \ - auto __device__ name(migraphx::vec x, Ts... xs) \ - MIGRAPHX_RETURNS(migraphx::vec{fname(x, xs...)}); \ - template 2))> \ - auto __device__ name(migraphx::vec x, Ts... xs) \ - { \ - return vec_packed_transform<2>(x, xs...)( \ - [](auto... ys) -> migraphx::vec { return fname(ys...); }); \ +#define MIGRAPHX_DEVICE_MATH_VEC2(type, name, fname) \ + template \ + auto __device__ name(migraphx::vec x, Ts... xs) \ + MIGRAPHX_RETURNS(migraphx::vec{fname(x, xs...)}); \ + template 2))> \ + auto __device__ name(migraphx::vec x, Ts... xs) \ + { \ + return vec_packed_transform<2>(x, xs...)( \ + [](auto... ys) -> migraphx::vec { return fname(ys...); }); \ } MIGRAPHX_DEVICE_MATH_WRAP(acos, (double)::acos, (float)::acosf); diff --git a/src/targets/ref/lowering.cpp b/src/targets/ref/lowering.cpp index cbeed44bb9f..a0b6b4bd09f 100644 --- a/src/targets/ref/lowering.cpp +++ b/src/targets/ref/lowering.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -184,9 +184,10 @@ struct ref_im2col kernel_w)([&](std::size_t c, std::size_t koffset, std::size_t loffset) { auto idx = iinput + long(koffset) - kdiv2_h; auto jdx = jinput + long(loffset) - kdiv2_w; - col(ldx, p) = ((idx >= 0) && (idx < height) && (jdx >= 0) && (jdx < width)) - ? input(0, c, idx, jdx) - : 0; + col(ldx, p) = + ((idx >= 0) and (idx < height) and (jdx >= 0) and (jdx < width)) + ? input(0, c, idx, jdx) + : 0; p++; }); } diff --git a/test/gpu/fuse_mlir.cpp b/test/gpu/fuse_mlir.cpp index 7532cc5f914..41751b87d04 100644 --- a/test/gpu/fuse_mlir.cpp +++ b/test/gpu/fuse_mlir.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -60,7 +60,7 @@ migraphx::instruction_ref add_mlir(migraphx::program& p, std::vector arg_names, F f) { - assert(inputs.size() == arg_names.size() && "One interior parameter name given per input."); + assert(inputs.size() == arg_names.size() and "One interior parameter name given per input."); auto* mm = p.get_main_module(); auto* pm = p.create_module(name); pm->set_bypass(); diff --git a/test/simplify_algebra_test.cpp b/test/simplify_algebra_test.cpp index a0c5d51690b..6975748a195 100644 --- a/test/simplify_algebra_test.cpp +++ b/test/simplify_algebra_test.cpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -146,7 +146,7 @@ TEST_CASE(simplify_zero_add_constant) } run_pass(m3); - EXPECT((m1 == m2) && (m2 == m3)); + EXPECT((m1 == m2) and (m2 == m3)); } TEST_CASE(simplify_add_broadcast1)