Skip to content
Snippets Groups Projects
Commit 9d60f13e authored by Koen Hillewaert's avatar Koen Hillewaert
Browse files

compilation fixes:

- explicit declaration of (used) inherited functions is required for templatized
classes such as FaceVector
- protected openmp pragmas
parent 94c12fed
No related branches found
No related tags found
No related merge requests found
...@@ -327,7 +327,9 @@ class FaceAllocator ...@@ -327,7 +327,9 @@ class FaceAllocator
// Allocate the array // Allocate the array
void allocate(const unsigned short nCapacity, T *&faces) void allocate(const unsigned short nCapacity, T *&faces)
{ {
#if defined (_OPENMP)
#pragma omp critical (FaceAllocator_allocate) #pragma omp critical (FaceAllocator_allocate)
#endif
{ {
switch(nCapacity) { switch(nCapacity) {
case 0: case 0:
...@@ -372,7 +374,9 @@ class FaceAllocator ...@@ -372,7 +374,9 @@ class FaceAllocator
// arrays with size 2, 6, and 8. // arrays with size 2, 6, and 8.
void grow(unsigned short &nCapacity, T *&faces) void grow(unsigned short &nCapacity, T *&faces)
{ {
#if defined (_OPENMP)
#pragma omp critical (FaceAllocator_grow) #pragma omp critical (FaceAllocator_grow)
#endif
{ {
switch(nCapacity) { switch(nCapacity) {
case 0: case 0:
...@@ -440,7 +444,9 @@ class FaceAllocator ...@@ -440,7 +444,9 @@ class FaceAllocator
// Deallocate an array // Deallocate an array
void deallocate(unsigned short &nCapacity, T *const faces) void deallocate(unsigned short &nCapacity, T *const faces)
{ {
#if defined (_OPENMP)
#pragma omp critical (FaceAllocator_deallocate) #pragma omp critical (FaceAllocator_deallocate)
#endif
{ {
switch(nCapacity) { switch(nCapacity) {
case 0: case 0:
...@@ -546,6 +552,11 @@ template <typename T> ...@@ -546,6 +552,11 @@ template <typename T>
class FaceVector : public FaceAllocator<T> class FaceVector : public FaceAllocator<T>
{ {
protected:
using FaceAllocator<T>::deallocate;
using FaceAllocator<T>::grow;
public: public:
// Constructor // Constructor
...@@ -557,7 +568,7 @@ class FaceVector : public FaceAllocator<T> ...@@ -557,7 +568,7 @@ class FaceVector : public FaceAllocator<T>
_capacity = valid_capacity(n); _capacity = valid_capacity(n);
allocate(_capacity, faces); allocate(_capacity, faces);
} }
// Destructor // Destructor
~FaceVector() { deallocate(_capacity, faces); } ~FaceVector() { deallocate(_capacity, faces); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment