Skip to content

Commit

Permalink
performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
AAAlvesJr committed May 23, 2016
1 parent b0cd98b commit 2a5479e
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 73 deletions.
10 changes: 5 additions & 5 deletions mcbooster/Generate.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ class PhaseSpace {
fAccRejFlags.shrink_to_fit();
}

void Generate(Particles_d fMothers);
void Generate(const Vector4R fMother);
inline void Generate(Particles_d fMothers);
inline void Generate(const Vector4R fMother);

/**
* Get the daughter with index 'i' in the mass array. It return a device vector of particles by reference.
Expand Down Expand Up @@ -311,11 +311,11 @@ class PhaseSpace {
* Export the events and all related information to host.
*/
void Export(Events *_Events);
void ExportUnweighted(Events *_Events);
inline void ExportUnweighted(Events *_Events);
/**
* Flag the accepted and rejected events
*/
GULong_t Unweight();
inline GULong_t Unweight();

//
public:
Expand All @@ -336,7 +336,7 @@ class PhaseSpace {
/**
* PDK function
*/
GReal_t PDK(const GReal_t a, const GReal_t b, const GReal_t c) const {
inline GReal_t PDK(const GReal_t a, const GReal_t b, const GReal_t c) const {
//the PDK function
GReal_t x = (a - b - c) * (a + b + c) * (a - b + c) * (a + b - c);
x = sqrt(x) / (2 * a);
Expand Down
8 changes: 4 additions & 4 deletions mcbooster/Vector3R.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ namespace mcbooster
class Vector3R
{

__host__ __device__ friend Vector3R rotateEuler(const Vector3R& v,
__host__ __device__ inline friend Vector3R rotateEuler(const Vector3R& v,
GReal_t phi, GReal_t theta, GReal_t ksi);

__host__ __device__ inline friend Vector3R operator*(GReal_t c,
__host__ __device__ inline friend Vector3R operator*(GReal_t c,
const Vector3R& v2);
__host__ __device__ inline friend GReal_t operator*(const Vector3R& v1,
__host__ __device__ inline friend GReal_t operator*(const Vector3R& v1,
const Vector3R& v2);
__host__ __device__ inline friend Vector3R operator+(const Vector3R& v1,
const Vector3R& v2);
Expand All @@ -56,7 +56,7 @@ class Vector3R
GReal_t c);
__host__ __device__ inline friend Vector3R operator/(const Vector3R& v1,
GReal_t c);
__host__ __device__ friend Vector3R cross(const Vector3R& v1,
__host__ __device__ inline friend Vector3R cross(const Vector3R& v1,
const Vector3R& v2);

public:
Expand Down
52 changes: 26 additions & 26 deletions mcbooster/functors/Calculate.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct Calculate
}


__host__ __device__ RESULT operator()(GT2 &particles)
__host__ __device__ inline RESULT operator()(GT2 &particles)
{

Vector4R* _Particles[2];
Expand All @@ -68,7 +68,7 @@ struct Calculate
return Function(2, _Particles);
}

__host__ __device__ RESULT operator()(GT3 &particles)
__host__ __device__ inline RESULT operator()(GT3 &particles)
{

Vector4R* _Particles[3];
Expand All @@ -80,7 +80,7 @@ struct Calculate
return Function(3, _Particles);
}

__host__ __device__ RESULT operator()(GT4 &particles)
__host__ __device__ inline RESULT operator()(GT4 &particles)
{

Vector4R* _Particles[4];
Expand All @@ -94,7 +94,7 @@ struct Calculate

}

__host__ __device__ RESULT operator()(GT5 &particles)
__host__ __device__ inline RESULT operator()(GT5 &particles)
{

Vector4R* _Particles[5];
Expand All @@ -108,7 +108,7 @@ struct Calculate
return Function(5, _Particles);
}

__host__ __device__ RESULT operator()(GT6 &particles)
__host__ __device__ inline RESULT operator()(GT6 &particles)
{

Vector4R* _Particles[6];
Expand All @@ -123,7 +123,7 @@ struct Calculate
return Function(6, _Particles);
}

__host__ __device__ RESULT operator()(GT7 &particles)
__host__ __device__ inline RESULT operator()(GT7 &particles)
{

Vector4R* _Particles[7];
Expand All @@ -139,7 +139,7 @@ struct Calculate
return Function(7, _Particles);
}

__host__ __device__ RESULT operator()(GT8 &particles)
__host__ __device__ inline RESULT operator()(GT8 &particles)
{

Vector4R* _Particles[8];
Expand All @@ -157,7 +157,7 @@ struct Calculate

}

__host__ __device__ RESULT operator()(GT9 &particles)
__host__ __device__ inline RESULT operator()(GT9 &particles)
{

Vector4R* _Particles[9];
Expand All @@ -175,7 +175,7 @@ struct Calculate
return Function(9, _Particles);
}

__host__ __device__ RESULT operator()(GT10 &particles)
__host__ __device__ inline RESULT operator()(GT10 &particles)
{

Vector4R* _Particles[10];
Expand Down Expand Up @@ -216,7 +216,7 @@ struct Calculate2
}


__host__ __device__ void operator()(GT2 particles)
__host__ __device__ inline void operator()(GT2 particles)
{

Vector4R* _Particles[2];
Expand All @@ -227,7 +227,7 @@ struct Calculate2
Function(2, _Particles);
}

__host__ __device__ void operator()(GT3 particles)
__host__ __device__ inline void operator()(GT3 particles)
{

Vector4R* _Particles[3];
Expand All @@ -239,7 +239,7 @@ struct Calculate2
Function(3, _Particles);
}

__host__ __device__ void operator()(GT4 particles)
__host__ __device__ inline void operator()(GT4 particles)
{

Vector4R* _Particles[4];
Expand All @@ -253,7 +253,7 @@ struct Calculate2

}

__host__ __device__ void operator()(GT5 particles)
__host__ __device__ inline void operator()(GT5 particles)
{

Vector4R* _Particles[5];
Expand All @@ -267,7 +267,7 @@ struct Calculate2
Function(5, _Particles);
}

__host__ __device__ void operator()(GT6 particles)
__host__ __device__ inline void operator()(GT6 particles)
{

Vector4R* _Particles[6];
Expand All @@ -282,7 +282,7 @@ struct Calculate2
Function(6, _Particles);
}

__host__ __device__ void operator()(GT7 particles)
__host__ __device__ inline void operator()(GT7 particles)
{

Vector4R* _Particles[7];
Expand All @@ -298,7 +298,7 @@ struct Calculate2
Function(7, _Particles);
}

__host__ __device__ void operator()(GT8 particles)
__host__ __device__ inline void operator()(GT8 particles)
{

Vector4R* _Particles[8];
Expand All @@ -316,7 +316,7 @@ struct Calculate2

}

__host__ __device__ void operator()(GT9 particles)
__host__ __device__ inline void operator()(GT9 particles)
{

Vector4R* _Particles[9];
Expand All @@ -334,7 +334,7 @@ struct Calculate2
Function(9, _Particles);
}

__host__ __device__ void operator()(GT10 particles)
__host__ __device__ inline void operator()(GT10 particles)
{

Vector4R* _Particles[10];
Expand Down Expand Up @@ -375,7 +375,7 @@ struct Calculate3
}


__host__ __device__ void operator()(GTR3 tuples)
__host__ __device__ inline void operator()(GTR3 tuples)
{

GReal_t* _real;
Expand All @@ -388,7 +388,7 @@ struct Calculate3
Function(2, _Particles, _real);
}

__host__ __device__ void operator()(GTR4 tuples)
__host__ __device__ inline void operator()(GTR4 tuples)
{

GReal_t* _real;
Expand All @@ -404,7 +404,7 @@ struct Calculate3

}

__host__ __device__ void operator()(GTR5 tuples)
__host__ __device__ inline void operator()(GTR5 tuples)
{

GReal_t* _real;
Expand All @@ -420,7 +420,7 @@ struct Calculate3
Function(4, _Particles, _real);
}

__host__ __device__ void operator()(GTR6 tuples)
__host__ __device__ inline void operator()(GTR6 tuples)
{

GReal_t* _real;
Expand All @@ -437,7 +437,7 @@ struct Calculate3
Function(5, _Particles, _real);
}

__host__ __device__ void operator()(GTR7 tuples)
__host__ __device__ inline void operator()(GTR7 tuples)
{

GReal_t* _real;
Expand All @@ -455,7 +455,7 @@ struct Calculate3
Function(6, _Particles, _real);
}

__host__ __device__ void operator()(GTR8 tuples)
__host__ __device__ inline void operator()(GTR8 tuples)
{

GReal_t* _real;
Expand All @@ -475,7 +475,7 @@ struct Calculate3

}

__host__ __device__ void operator()(GTR9 tuples)
__host__ __device__ inline void operator()(GTR9 tuples)
{

GReal_t* _real;
Expand All @@ -495,7 +495,7 @@ struct Calculate3
Function(8, _Particles, _real);
}

__host__ __device__ void operator()(GTR10 tuples)
__host__ __device__ inline void operator()(GTR10 tuples)
{

GReal_t* _real;
Expand Down
Loading

0 comments on commit 2a5479e

Please sign in to comment.