Skip to content
Open
Show file tree
Hide file tree
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
33 changes: 31 additions & 2 deletions GPU/GPUTracking/Base/GPUReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,37 @@ struct GPUMemoryReuse;

namespace gpu_reconstruction_kernels
{
struct deviceEvent;
class threadContext;
struct deviceEvent {
constexpr deviceEvent() = default;
constexpr deviceEvent(std::nullptr_t p) : v(nullptr){};
template <class T>
void set(T val)
{
v = reinterpret_cast<void*&>(val);
}
template <class T>
T& get()
{
return reinterpret_cast<T&>(v);
}
template <class T>
T* getEventList()
{
return reinterpret_cast<T*>(this);
}
bool isSet() const { return v; }

private:
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.
};

class threadContext
{
public:
threadContext();
virtual ~threadContext();
};

} // namespace gpu_reconstruction_kernels

class GPUReconstruction
Expand Down
35 changes: 0 additions & 35 deletions GPU/GPUTracking/Base/GPUReconstructionProcessing.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,6 @@ namespace o2::gpu

struct GPUDefParameters;

namespace gpu_reconstruction_kernels // TODO: Get rid of this namespace
{
struct deviceEvent {
constexpr deviceEvent() = default;
constexpr deviceEvent(std::nullptr_t p) : v(nullptr) {};
template <class T>
void set(T val)
{
v = reinterpret_cast<void*&>(val);
}
template <class T>
T& get()
{
return reinterpret_cast<T&>(v);
}
template <class T>
T* getEventList()
{
return reinterpret_cast<T*>(this);
}
bool isSet() const { return v; }

private:
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.
};

class threadContext
{
public:
threadContext();
virtual ~threadContext();
};

} // namespace gpu_reconstruction_kernels

class GPUReconstructionProcessing : public GPUReconstruction
{
public:
Expand Down