Skip to content

Commit 90633fa

Browse files
committed
Moved namespace gpu_reconstruction_kernels defination in GPUReconstruction class
1 parent 1d620f2 commit 90633fa

File tree

2 files changed

+31
-37
lines changed

2 files changed

+31
-37
lines changed

GPU/GPUTracking/Base/GPUReconstruction.h

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,37 @@ struct GPUMemoryReuse;
6363

6464
namespace gpu_reconstruction_kernels
6565
{
66-
struct deviceEvent;
67-
class threadContext;
66+
struct deviceEvent {
67+
constexpr deviceEvent() = default;
68+
constexpr deviceEvent(std::nullptr_t p) : v(nullptr){};
69+
template <class T>
70+
void set(T val)
71+
{
72+
v = reinterpret_cast<void*&>(val);
73+
}
74+
template <class T>
75+
T& get()
76+
{
77+
return reinterpret_cast<T&>(v);
78+
}
79+
template <class T>
80+
T* getEventList()
81+
{
82+
return reinterpret_cast<T*>(this);
83+
}
84+
bool isSet() const { return v; }
85+
86+
private:
87+
void* v = nullptr; // We use only pointers anyway, and since cl_event and cudaEvent_t and hipEvent_t are actually pointers, we can cast them to deviceEvent (void*) this way.
88+
};
89+
90+
class threadContext
91+
{
92+
public:
93+
threadContext();
94+
virtual ~threadContext();
95+
};
96+
6897
} // namespace gpu_reconstruction_kernels
6998

7099
class GPUReconstruction

GPU/GPUTracking/Base/GPUReconstructionProcessing.h

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,6 @@ namespace o2::gpu
3131

3232
struct GPUDefParameters;
3333

34-
namespace gpu_reconstruction_kernels // TODO: Get rid of this namespace
35-
{
36-
struct deviceEvent {
37-
constexpr deviceEvent() = default;
38-
constexpr deviceEvent(std::nullptr_t p) : v(nullptr) {};
39-
template <class T>
40-
void set(T val)
41-
{
42-
v = reinterpret_cast<void*&>(val);
43-
}
44-
template <class T>
45-
T& get()
46-
{
47-
return reinterpret_cast<T&>(v);
48-
}
49-
template <class T>
50-
T* getEventList()
51-
{
52-
return reinterpret_cast<T*>(this);
53-
}
54-
bool isSet() const { return v; }
55-
56-
private:
57-
void* v = nullptr; // We use only pointers anyway, and since cl_event and cudaEvent_t and hipEvent_t are actually pointers, we can cast them to deviceEvent (void*) this way.
58-
};
59-
60-
class threadContext
61-
{
62-
public:
63-
threadContext();
64-
virtual ~threadContext();
65-
};
66-
67-
} // namespace gpu_reconstruction_kernels
68-
6934
class GPUReconstructionProcessing : public GPUReconstruction
7035
{
7136
public:

0 commit comments

Comments
 (0)