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);
    }
}
예제 #2
0
  /** 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);
  }
예제 #3
0
파일: MultiJittered.cpp 프로젝트: dicta/ray
MultiJittered::MultiJittered(const int ns, const int sets) : Sampler(ns, sets) {
   generateSamples();
}
예제 #4
0
Jittered::Jittered(uint numSamples)
	:Sampler(numSamples)
{
	generateSamples();
}
예제 #5
0
Hammersley::Hammersley(uint numSamples)
	:Sampler(numSamples)
{
	generateSamples();
}
예제 #6
0
Regular::Regular(uint numSamples)
	:Sampler(numSamples)
{
	generateSamples();
}
예제 #7
0
//  generate the samples
void SSRings::generateSamples(Array<Point3D> *pts) const{
  generateSamples(pts, numRings);
}
예제 #8
0
RegularSampler::RegularSampler(const int numSamples) : Sampler(numSamples) {
    generateSamples();
}
예제 #9
0
RegularSampler::RegularSampler() : Sampler() {
    generateSamples();
}
예제 #10
0
//==============================================================================
FaaRay::RegularSampler::RegularSampler(const GFA::Size &numSamplesRef) :
    Sampler(numSamplesRef)
{
    generateSamples();
}
예제 #11
0
//==============================================================================
FaaRay::RegularSampler::RegularSampler()
{
    generateSamples();
}
예제 #12
0
MultiJittered::MultiJittered(const MultiJittered& mj) : Sampler(mj) {
	generateSamples();
}
예제 #13
0
MultiJittered::MultiJittered(const int n_samples) :Sampler(n_samples) {
	generateSamples();
}