Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b8d025d
Add initial rocm cxx tests
pfultz2 Feb 11, 2026
3cfc07e
Format
pfultz2 Feb 11, 2026
89747b1
Add more type traits
pfultz2 Feb 11, 2026
99cbeb0
Format
pfultz2 Feb 11, 2026
e9b8a6a
Add more type traits tests
pfultz2 Feb 11, 2026
706b2d5
Format
pfultz2 Feb 11, 2026
2676ef7
Move declval
pfultz2 Feb 11, 2026
aa49111
Add operations class
pfultz2 Feb 11, 2026
c0acd27
Format
pfultz2 Feb 11, 2026
5764ba7
Add reverse iterator
pfultz2 Feb 11, 2026
4330fb6
Format
pfultz2 Feb 11, 2026
032c06d
Add array class
pfultz2 Feb 11, 2026
140a37d
Format
pfultz2 Feb 11, 2026
3bc95ac
Add algorithm header
pfultz2 Feb 12, 2026
b488046
Format
pfultz2 Feb 12, 2026
8fb398a
Update algorithm header
pfultz2 Feb 13, 2026
825515b
Format
pfultz2 Feb 13, 2026
8cb326a
Add remove_pointer
pfultz2 Feb 13, 2026
8abb772
Format
pfultz2 Feb 13, 2026
0abfa7d
Add remove_cvref
pfultz2 Feb 13, 2026
13e37c5
FOrmat
pfultz2 Feb 13, 2026
9583af1
Add is_pointer trait
pfultz2 Feb 13, 2026
7ae6f56
Format
pfultz2 Feb 13, 2026
a491154
Use builtin
pfultz2 Feb 13, 2026
1e0c7ef
Add bit_cast
pfultz2 Feb 13, 2026
b228e3b
Format
pfultz2 Feb 13, 2026
c9f2730
Add more bit functions
pfultz2 Feb 13, 2026
dbf5b7d
Format
pfultz2 Feb 13, 2026
63f025f
Simplify rotr
pfultz2 Feb 13, 2026
9ddf29f
Add more type traits
pfultz2 Feb 13, 2026
af9fbe7
Format
pfultz2 Feb 13, 2026
2c15d57
Add is_aritmetic
pfultz2 Feb 13, 2026
1e2c312
Add move and forward functions
pfultz2 Feb 13, 2026
c080a49
Format
pfultz2 Feb 13, 2026
bf26a69
Merge branch 'develop' into rocm-cxx
pfultz2 Apr 19, 2026
4ef0ff1
Add bf16
pfultz2 Apr 19, 2026
13d3162
Add license
pfultz2 Apr 19, 2026
5011c05
Format
pfultz2 Apr 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/targets/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ else()
set(MIGRAPHX_USE_HIPRTC ON CACHE BOOL "Use hipRTC APIs")
endif()

file(GLOB KERNEL_FILES CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/kernels/include/migraphx/kernels/*.hpp)
file(GLOB_RECURSE KERNEL_FILES CONFIGURE_DEPENDS LIST_DIRECTORIES false
${CMAKE_CURRENT_SOURCE_DIR}/kernels/include/*.hpp
)

if(NOT MIGRAPHX_USE_COMPOSABLEKERNEL)
list(REMOVE_ITEM KERNEL_FILES
Expand Down Expand Up @@ -124,15 +125,17 @@ endif()

add_library(migraphx_gpu_kernel_file_check EXCLUDE_FROM_ALL)

set(CK_TIDY_SKIP_KERNEL_FILES "ck" "ck_gemm" "ck_gemm_softmax_gemm")
set(CK_TIDY_SKIP_KERNEL_FILES ck ck_gemm ck_gemm_softmax_gemm)
foreach(KERNEL_FILE ${KERNEL_FILES})
get_filename_component(KERNEL_BASE_FILE ${KERNEL_FILE} NAME_WE)
file(RELATIVE_PATH KERNEL_FILE_REL ${CMAKE_CURRENT_SOURCE_DIR}/kernels/include/ ${KERNEL_FILE})
get_filename_component(KERNEL_BASE_FILE ${KERNEL_FILE_REL} NAME_WE)
get_filename_component(KERNEL_DIR ${KERNEL_FILE_REL} DIRECTORY)
# Temporary workaround for tidy issue that arises from the fact that CK no longer exposes headers to the host code
if(${KERNEL_BASE_FILE} IN_LIST CK_TIDY_SKIP_KERNEL_FILES)
continue()
endif()
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/kernels/include/migraphx/kernels/${KERNEL_BASE_FILE}.cpp "#include <migraphx/kernels/${KERNEL_BASE_FILE}.hpp>\n")
target_sources(migraphx_gpu_kernel_file_check PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/kernels/include/migraphx/kernels/${KERNEL_BASE_FILE}.cpp)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/kernels/include/${KERNEL_DIR}/${KERNEL_BASE_FILE}.cpp "#include <${KERNEL_DIR}/${KERNEL_BASE_FILE}.hpp>\n")
target_sources(migraphx_gpu_kernel_file_check PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/kernels/include/${KERNEL_DIR}/${KERNEL_BASE_FILE}.cpp)
endforeach()

target_link_libraries(migraphx_gpu_kernel_file_check compile_migraphx_gpu_kernels)
Expand Down
8 changes: 8 additions & 0 deletions src/targets/gpu/kernels/include/migraphx/kernels/test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ struct test_manager
__device__ [[maybe_unused]] static void __VA_ARGS__( \
[[maybe_unused]] migraphx::test::test_manager& migraphx_private_test_manager)

// NOLINTNEXTLINE
#define TEST_CASE_TEMPLATE(...) \
__device__ [[maybe_unused]] static void __VA_ARGS__( \
[[maybe_unused]] migraphx::test::test_manager& migraphx_private_test_manager)

// NOLINTNEXTLINE
#define TEST_CASE_REGISTER(...)

} // namespace test
} // namespace migraphx
#endif // MIGRAPHX_GUARD_KERNELS_TEST_HPP
55 changes: 55 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_HPP' [readability-identifier-naming,-warnings-as-errors]

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm.hpp

View workflow job for this annotation

GitHub Actions / cppcheck

style: Macros must be prefixed with MIGRAPHX_ [definePrefix]

#include <rocm/algorithm/iter_swap.hpp>
#include <rocm/algorithm/fill.hpp>
#include <rocm/algorithm/accumulate.hpp>
#include <rocm/algorithm/copy.hpp>
#include <rocm/algorithm/copy_if.hpp>
#include <rocm/algorithm/transform.hpp>
#include <rocm/algorithm/is_sorted_until.hpp>
#include <rocm/algorithm/is_sorted.hpp>
#include <rocm/algorithm/for_each.hpp>
#include <rocm/algorithm/find_if.hpp>
#include <rocm/algorithm/find.hpp>
#include <rocm/algorithm/any_of.hpp>
#include <rocm/algorithm/none_of.hpp>
#include <rocm/algorithm/all_of.hpp>
#include <rocm/algorithm/search.hpp>
#include <rocm/algorithm/inner_product.hpp>
#include <rocm/algorithm/equal.hpp>
#include <rocm/algorithm/iota.hpp>
#include <rocm/algorithm/min_element.hpp>
#include <rocm/algorithm/max_element.hpp>
#include <rocm/algorithm/rotate.hpp>
#include <rocm/algorithm/upper_bound.hpp>
#include <rocm/algorithm/lower_bound.hpp>
#include <rocm/algorithm/sort.hpp>
#include <rocm/algorithm/stable_sort.hpp>
#include <rocm/algorithm/merge.hpp>

#endif // ROCM_GUARD_ROCM_ALGORITHM_HPP
51 changes: 51 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm/accumulate.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_ACCUMULATE_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_ACCUMULATE_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm/accumulate.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_ACCUMULATE_HPP' [readability-identifier-naming,-warnings-as-errors]

#include <rocm/config.hpp>

namespace rocm {
inline namespace ROCM_INLINE_NS {

template <class InputIt, class T, class BinaryOperation>
constexpr T accumulate(InputIt first, InputIt last, T init, BinaryOperation op)
{
for(; first != last; ++first)
{
init = op(static_cast<T&&>(init), *first);
}
return init;
}

template <class InputIt, class T>
constexpr T accumulate(InputIt first, InputIt last, T init)
{
return accumulate(first, last, init, [](auto x, auto y) { return x + y; });
}

} // namespace ROCM_INLINE_NS
} // namespace rocm
#endif // ROCM_GUARD_ROCM_ALGORITHM_ACCUMULATE_HPP
42 changes: 42 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm/all_of.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_ALL_OF_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_ALL_OF_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm/all_of.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_ALL_OF_HPP' [readability-identifier-naming,-warnings-as-errors]

#include <rocm/config.hpp>
#include <rocm/algorithm/none_of.hpp>

namespace rocm {
inline namespace ROCM_INLINE_NS {

template <class InputIt, class UnaryPredicate>
constexpr bool all_of(InputIt first, InputIt last, UnaryPredicate p)
{
return none_of(first, last, [=](auto&& x) { return not p(x); });
}

} // namespace ROCM_INLINE_NS
} // namespace rocm
#endif // ROCM_GUARD_ROCM_ALGORITHM_ALL_OF_HPP
42 changes: 42 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm/any_of.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_ANY_OF_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_ANY_OF_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm/any_of.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_ANY_OF_HPP' [readability-identifier-naming,-warnings-as-errors]

#include <rocm/config.hpp>
#include <rocm/algorithm/find_if.hpp>

namespace rocm {
inline namespace ROCM_INLINE_NS {

template <class InputIt, class UnaryPredicate>
constexpr bool any_of(InputIt first, InputIt last, UnaryPredicate p)
{
return find_if(first, last, p) != last;
}

} // namespace ROCM_INLINE_NS
} // namespace rocm
#endif // ROCM_GUARD_ROCM_ALGORITHM_ANY_OF_HPP
45 changes: 45 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm/copy.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_COPY_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_COPY_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm/copy.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_COPY_HPP' [readability-identifier-naming,-warnings-as-errors]

#include <rocm/config.hpp>

namespace rocm {
inline namespace ROCM_INLINE_NS {

template <class InputIt, class OutputIt>
constexpr OutputIt copy(InputIt first, InputIt last, OutputIt d_first)
{
while(first != last)
{
*d_first++ = *first++;
}
return d_first;
}

} // namespace ROCM_INLINE_NS
} // namespace rocm
#endif // ROCM_GUARD_ROCM_ALGORITHM_COPY_HPP
49 changes: 49 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm/copy_if.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_COPY_IF_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_COPY_IF_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm/copy_if.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_COPY_IF_HPP' [readability-identifier-naming,-warnings-as-errors]

#include <rocm/config.hpp>

namespace rocm {
inline namespace ROCM_INLINE_NS {

template <class InputIt, class OutputIt, class UnaryPredicate>
constexpr OutputIt copy_if(InputIt first, InputIt last, OutputIt d_first, UnaryPredicate pred)
{
for(; first != last; ++first)
{
if(pred(*first))
{
*d_first = *first;
++d_first;
}
}
return d_first;
}

} // namespace ROCM_INLINE_NS
} // namespace rocm
#endif // ROCM_GUARD_ROCM_ALGORITHM_COPY_IF_HPP
52 changes: 52 additions & 0 deletions src/targets/gpu/kernels/include/rocm/algorithm/equal.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
#ifndef ROCM_GUARD_ROCM_ALGORITHM_EQUAL_HPP
#define ROCM_GUARD_ROCM_ALGORITHM_EQUAL_HPP

Check warning on line 26 in src/targets/gpu/kernels/include/rocm/algorithm/equal.hpp

View workflow job for this annotation

GitHub Actions / tidy

invalid case style for macro definition 'ROCM_GUARD_ROCM_ALGORITHM_EQUAL_HPP' [readability-identifier-naming,-warnings-as-errors]

#include <rocm/config.hpp>

namespace rocm {
inline namespace ROCM_INLINE_NS {

template <class Iterator1, class Iterator2, class BinaryPred>
constexpr bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2, BinaryPred p)
{
for(; first1 != last1; ++first1, ++first2)
if(not p(*first1, *first2))
{
return false;
}
return true;
}

template <class Iterator1, class Iterator2>
constexpr bool equal(Iterator1 first1, Iterator1 last1, Iterator2 first2)
{
return equal(first1, last1, first2, [](auto&& x, auto&& y) { return x == y; });
}

} // namespace ROCM_INLINE_NS
} // namespace rocm
#endif // ROCM_GUARD_ROCM_ALGORITHM_EQUAL_HPP
Loading
Loading