Skip to content

Use std::less for comparison in GenericSorter. #2002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
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
11 changes: 3 additions & 8 deletions arcane/src/arcane/accelerator/GenericSorter.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2.0
//-----------------------------------------------------------------------------
/*---------------------------------------------------------------------------*/
/* GenericSorter.h (C) 2000-2024 */
/* GenericSorter.h (C) 2000-2025 */
/* */
/* Algorithme de tri. */
/*---------------------------------------------------------------------------*/
Expand Down Expand Up @@ -134,8 +134,6 @@ namespace Arcane::Accelerator
/*---------------------------------------------------------------------------*/
/*!
* \brief Algorithme générique de tri sur accélérateur.
*
* \warning API en cours de développement. Ne pas utiliser en dehors d'Arcane
*/
class GenericSorter
: private impl::GenericSorterBase
Expand Down Expand Up @@ -166,10 +164,7 @@ class GenericSorter
if (output.size() < nb_item)
ARCANE_FATAL("Output size '{0}' is smaller than input size '{1}'",
output.size(), nb_item);
auto compare_lambda = [] ARCCORE_HOST_DEVICE(const DataType& a, const DataType& b) {
return a < b;
};
gf.apply(*base_ptr, nb_item, input.data(), output.data(), compare_lambda);
gf.apply(*base_ptr, nb_item, input.data(), output.data(), std::less<DataType>{});
}
};

Expand Down
Loading