void PhotonTracerCL::compileKernels() {
    removeKernel(photonTracerKernel_);
    removeKernel(recomputePhotonTracerKernel_);
    std::string defines = "";
    if (onlyMultipleScattering_) {
        defines = " -D NO_SINGLE_SCATTERING";
    }
    if (isProgressive()) {
        defines = " -D PROGRESSIVE_PHOTON_MAPPING";
    }
    photonTracerKernel_ = addKernel("photontracer.cl", "photonTracerKernel", "", defines);
    recomputePhotonTracerKernel_ = addKernel("photontracer.cl", "photonTracerKernel", "", defines + " -D PHOTON_RECOMPUTATION");
}
Esempio n. 2
0
void VolumeRaycasterCL::compileKernel() {
    if (kernel_) {
        removeKernel(kernel_);
    }
    std::stringstream defines;
    if (light_.shadingMode != 0) defines << " -D SHADING_MODE=" << light_.shadingMode;
    // Will compile kernel and make sure that it it
    // recompiled whenever the file changes
    // If the kernel fails to compile it will be set to nullptr
    kernel_ = addKernel("volumeraycaster.cl", "raycaster", defines.str());
    setKernelArguments();
}
Esempio n. 3
0
void
SKIRSingleThreadSched::stop(void)
{
    if (!main_thread) return;

    if (running.compare_and_swap(0,1) == 1) {
	assert(main_thread && main_thread->joinable() && "not running");
	main_thread->join();
	main_thread = NULL;
    }

    SKIRRuntimeKernel *k;
    while (runq.try_pop(k))
	removeKernel(k);
}