1616#define GPUCOMMONALGORITHM_H
1717
1818#include " GPUCommonDef.h"
19+ #include " MemLayout.h"
1920
2021#if !defined(GPUCA_GPUCODE) // Could also enable custom search on the CPU, but it is not always faster, so we stick to std::sort
2122#include < algorithm>
@@ -28,19 +29,20 @@ namespace o2::gpu
2829{
2930class GPUCommonAlgorithm
3031{
32+
3133 public:
3234 template <class T >
33- GPUd () static void sort (T* begin, T* end);
35+ GPUd () static void sort (T begin, T end);
3436 template <class T >
3537 GPUd () static void sortInBlock (T* begin, T* end);
3638 template <class T >
37- GPUd () static void sortDeviceDynamic (T* begin, T* end);
39+ GPUd () static void sortDeviceDynamic (T begin, T end);
3840 template <class T , class S >
39- GPUd () static void sort (T* begin, T* end, const S& comp);
41+ GPUd () static void sort (T begin, T end, const S& comp);
4042 template <class T , class S >
4143 GPUd () static void sortInBlock (T* begin, T* end, const S& comp);
4244 template <class T , class S >
43- GPUd () static void sortDeviceDynamic (T* begin, T* end, const S& comp);
45+ GPUd () static void sortDeviceDynamic (T begin, T end, const S& comp);
4446#ifndef __OPENCL__
4547 template <class T , class S >
4648 GPUh () static void sortOnDevice(auto * rec, int32_t stream, T* begin, size_t N, const S& comp);
@@ -224,7 +226,7 @@ namespace o2::gpu
224226{
225227
226228template <class T >
227- GPUdi () void GPUCommonAlgorithm::sortDeviceDynamic (T* begin, T* end)
229+ GPUdi () void GPUCommonAlgorithm::sortDeviceDynamic (T begin, T end)
228230{
229231#ifndef GPUCA_GPUCODE
230232 GPUCommonAlgorithm::sort (begin, end);
@@ -234,7 +236,7 @@ GPUdi() void GPUCommonAlgorithm::sortDeviceDynamic(T* begin, T* end)
234236}
235237
236238template <class T , class S >
237- GPUdi () void GPUCommonAlgorithm::sortDeviceDynamic (T* begin, T* end, const S& comp)
239+ GPUdi () void GPUCommonAlgorithm::sortDeviceDynamic (T begin, T end, const S& comp)
238240{
239241 GPUCommonAlgorithm::sort (begin, end, comp);
240242}
@@ -248,7 +250,7 @@ namespace o2::gpu
248250{
249251
250252template <class T >
251- GPUdi () void GPUCommonAlgorithm::sort (T* begin, T* end)
253+ GPUdi () void GPUCommonAlgorithm::sort (T begin, T end)
252254{
253255#ifdef GPUCA_ALGORITHM_STD
254256 std::sort (begin, end);
@@ -258,7 +260,7 @@ GPUdi() void GPUCommonAlgorithm::sort(T* begin, T* end)
258260}
259261
260262template <class T , class S >
261- GPUdi () void GPUCommonAlgorithm::sort (T* begin, T* end, const S& comp)
263+ GPUdi () void GPUCommonAlgorithm::sort (T begin, T end, const S& comp)
262264{
263265#ifdef GPUCA_ALGORITHM_STD
264266 std::sort (begin, end, comp);
0 commit comments