Commit 99f7387a authored by Jonas Hahnfeld's avatar Jonas Hahnfeld
Browse files

Unify construction of Quadrilaterals

The default constructor of Planes was marked for the device, but
the constructor of Quadrilaterals was also marked for the host
(despite having a different implementation there). Get rid of this
problem by properly initializing the arrays in Quadrilaterals.
parent f7797d82
......@@ -35,6 +35,7 @@ public:
VECCORE_ATT_HOST_DEVICE
AOS3D(Vector3D<T> *data, size_t size);
VECCORE_ATT_HOST_DEVICE
AOS3D(size_t size);
VECCORE_ATT_HOST_DEVICE
......@@ -141,6 +142,7 @@ AOS3D<T>::AOS3D(Vector3D<T> *in_content, size_t in_size)
}
template <typename T>
VECCORE_ATT_HOST_DEVICE
AOS3D<T>::AOS3D(size_t sz) : fAllocated(true), fSize(sz), fCapacity(sz), fContent(NULL)
{
reserve(fCapacity);
......
......@@ -35,11 +35,6 @@ public:
VECCORE_ATT_HOST_DEVICE
Planes(int size);
#ifdef VECCORE_CUDA
VECCORE_ATT_DEVICE Planes();
VECCORE_ATT_DEVICE Planes(Precision *a, Precision *b, Precision *c, Precision *d, int size);
#endif
VECCORE_ATT_HOST_DEVICE
~Planes();
......
......@@ -8,19 +8,6 @@ Planes::Planes(int size) : fNormals(size), fDistances(size)
{
}
#ifdef VECCORE_CUDA
VECCORE_ATT_DEVICE
Planes::Planes() : fNormals(), fDistances()
{
}
VECCORE_ATT_DEVICE
Planes::Planes(Precision *a, Precision *b, Precision *c, Precision *d, int size)
: fNormals(a, b, c, size), fDistances(d, size)
{
}
#endif
VECCORE_ATT_HOST_DEVICE
Planes::~Planes()
{
......
......@@ -7,32 +7,12 @@ namespace vecgeom {
inline namespace VECGEOM_IMPL_NAMESPACE {
#ifdef VECCORE_CUDA
// NVCC does not seem to handle array initialization yet.
// cuda_src/Rectangles.cu(9): internal error: assertion failed: adjust_cleanup_state_for_aggregate_init: NULL dip
// (/dvs/p4/build/sw/rel/gpu_drv/r340/r340_00/drivers/compiler_CUREL/edg/EDG_4.8/src/lower_init.c, line 7369)
VECCORE_ATT_HOST_DEVICE
Quadrilaterals::Quadrilaterals(int size) : fPlanes(size)
{
if (size > 0) {
fSideVectors[0].reserve(size);
fSideVectors[1].reserve(size);
fSideVectors[2].reserve(size);
fSideVectors[3].reserve(size);
fCorners[0].reserve(size);
fCorners[1].reserve(size);
fCorners[2].reserve(size);
fCorners[3].reserve(size);
}
}
#else
Quadrilaterals::Quadrilaterals(int size)
: fPlanes(size), fSideVectors{size, size, size, size}, fCorners{size, size, size, size}
: fPlanes(size), fSideVectors{{size}, {size}, {size}, {size}},
fCorners{{(size_t)size}, {(size_t)size}, {(size_t)size}, {(size_t)size}}
{
}
#endif
VECCORE_ATT_HOST_DEVICE
Quadrilaterals::~Quadrilaterals()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment