Skip to content

Commit

Permalink
add error messages for CUDA/CPU backends with mega-wave integrator (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Apr 23, 2024
1 parent f75f1bd commit 55988df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/integrators/megawave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ class MegakernelWaveFrontInstance final : public ProgressiveIntegrator::Instance
};

luisa::unique_ptr<Integrator::Instance> MegakernelWaveFront::build(Pipeline &pipeline, CommandBuffer &command_buffer) const noexcept {
if (auto backend = luisa::string{pipeline.device().backend_name()}; backend == "cuda" || backend == "cpu") {
for (auto &c : backend) { c = static_cast<char>(std::toupper(c)); }
LUISA_ERROR_WITH_LOCATION("The {} backend does not support the 'meagwave' integrator: "
"thread-block synchronization is not supported inside "
"ray-tracing kernels on this backend. "
"You can use 'megapath' or 'wavepath' instead.", backend);
}
return luisa::make_unique<MegakernelWaveFrontInstance>(pipeline, command_buffer, this);
}

Expand Down

0 comments on commit 55988df

Please sign in to comment.