Skip to content

Commit

Permalink
inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lfield committed Jul 7, 2020
1 parent aba7b26 commit b49c27c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void CPPProcess::initProc(string param_card_name, bool verb) {
//--------------------------------------------------------------------------
// Evaluate |M|^2, part independent of incoming flavour.

void sigmaKin(bool ppar, pars) {
void CPPProcess::sigmaKin(bool ppar) {
// Set the parameters which change event by event
pars->setDependentParameters();
pars->setDependentCouplings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ using namespace std;
// Process: e+ e- > mu+ mu- WEIGHTED<=4 @1
//--------------------------------------------------------------------------

void sigmaKin(bool ppar = true);

class CPPProcess {
public:
// Constructor.
Expand All @@ -33,7 +31,7 @@ class CPPProcess {
virtual void initProc(string param_card_name, bool verb = true);

// Calculate flavour-independent parts of cross section.
// virtual void sigmaKin(bool ppar = true);
virtual void sigmaKin(bool ppar = true);

// Evaluate sigmaHat(sHat).
virtual double sigmaHat();
Expand Down
27 changes: 10 additions & 17 deletions examples/standalone_cpp/eemumu/SubProcesses/check_sa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ int main(int argc, char **argv) {
if (verbose)
std::cout << "num evts: " << numevts << std::endl;

cl::sycl::range<1> work_items{(unsigned long)numevts};

cl::sycl::queue q;

q.submit([&](cl::sycl::handler& cgh){

// Create a process object
CPPProcess process;

Expand All @@ -44,36 +50,24 @@ int main(int argc, char **argv) {
double energy = 1500;
double weight;

/*
Laurence: Moved the getting and setting of momenta out of the
for loop as it is constant for each itteration.
*/

// Get phase space point
vector<double *> p =
get_momenta(process.ninitial, energy, process.getMasses(), weight);

// Set momenta for this event
process.setMomenta(p);

/*
Laurence: Start sycl parallel for.
*/

cl::sycl::queue q;
cl::sycl::range<1> work_items{(unsigned long)numevts};

q.submit([&](cl::sycl::handler& cgh){

cgh.parallel_for<class vector_add>(work_items,
cgh.parallel_for<class vector_add>(work_items,
[=] (cl::sycl::id<1> tid) {

// Evaluate matrix element
sigmaKin(verbose,process.pars);
process.sigmaKin(verbose);

//const double *matrix_elements = process.getMatrixElements();

});
process.printPerformanceStats();

});
/*
if (verbose) {
Expand Down Expand Up @@ -102,5 +96,4 @@ int main(int argc, char **argv) {
}
}
*/
process.printPerformanceStats();
}

0 comments on commit b49c27c

Please sign in to comment.