void UniformSampleGenerator2DCL::generateNextSamples(SampleBuffer& positionSamplesOut, const VECTOR_CLASS<cl::Event>* waitForEvents /*= nullptr*/, cl::Event* event /*= nullptr*/) { if (kernel_ == NULL) { return throw Exception("Invalid kernel: Kernel not found or failed to compile"); } size2_t nSamples{static_cast<size_t>(std::sqrt(static_cast<double>(positionSamplesOut.getSize())))}; if (getUseGLSharing()) { SyncCLGL glSync; BufferCLGL* samples = positionSamplesOut.getEditableRepresentation<BufferCLGL>(); // Acquire shared representations before using them in OpenGL // The SyncCLGL object will take care of synchronization between OpenGL and OpenCL glSync.addToAquireGLObjectList(samples); glSync.aquireAllObjects(); generateSamples(nSamples, positionSamplesOut.getSize(), samples, waitForEvents, event); } else { BufferCL* samples = positionSamplesOut.getEditableRepresentation<BufferCL>(); generateSamples(nSamples, positionSamplesOut.getSize(), samples, waitForEvents, event); } }
/** Reimplement QMCDriver::run */ bool QMCOptimize::run() { optTarget->initCommunicator(myComm); //close files automatically generated by QMCDriver //branchEngine->finalize(); //generate samples generateSamples(); //cleanup walkers //W.destroyWalkers(W.begin(), W.end()); app_log() << "<opt stage=\"setup\">" << endl; app_log() << " <log>"<<endl; //reset the rootname optTarget->setRootName(RootName); optTarget->setWaveFunctionNode(wfNode); app_log() << " Reading configurations from h5FileRoot " << endl; //get configuration from the previous run Timer t1; optTarget->getConfigurations(h5FileRoot); optTarget->checkConfigurations(); app_log() << " Execution time = " << t1.elapsed() << endl; app_log() << " </log>"<<endl; app_log() << "</opt>" << endl; app_log() << "<opt stage=\"main\" walkers=\""<< optTarget->getNumSamples() << "\">" << endl; app_log() << " <log>" << endl; optTarget->setTargetEnergy(branchEngine->getEref()); t1.restart(); bool success=optSolver->optimize(optTarget); app_log() << " Execution time = " << t1.elapsed() << endl;; app_log() << " </log>" << endl; optTarget->reportParameters(); app_log() << "</opt>" << endl; app_log() << "</optimization-report>" << endl; MyCounter++; return (optTarget->getReportCounter() > 0); }
MultiJittered::MultiJittered(const int ns, const int sets) : Sampler(ns, sets) { generateSamples(); }
Jittered::Jittered(uint numSamples) :Sampler(numSamples) { generateSamples(); }
Hammersley::Hammersley(uint numSamples) :Sampler(numSamples) { generateSamples(); }
Regular::Regular(uint numSamples) :Sampler(numSamples) { generateSamples(); }
// generate the samples void SSRings::generateSamples(Array<Point3D> *pts) const{ generateSamples(pts, numRings); }
RegularSampler::RegularSampler(const int numSamples) : Sampler(numSamples) { generateSamples(); }
RegularSampler::RegularSampler() : Sampler() { generateSamples(); }
//============================================================================== FaaRay::RegularSampler::RegularSampler(const GFA::Size &numSamplesRef) : Sampler(numSamplesRef) { generateSamples(); }
//============================================================================== FaaRay::RegularSampler::RegularSampler() { generateSamples(); }
MultiJittered::MultiJittered(const MultiJittered& mj) : Sampler(mj) { generateSamples(); }
MultiJittered::MultiJittered(const int n_samples) :Sampler(n_samples) { generateSamples(); }