From f679e28a23960535ee8c6f8a9424b6366fcb0b1e Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Mon, 30 Mar 2026 13:57:48 +0200 Subject: [PATCH 1/2] feat: add flux engine benchmarks --- tests/fluxEngineBenchmarks/CMakeLists.txt | 6 ++ tests/fluxEngineBenchmarks/ibeEtching.cpp | 57 +++++++++++++++++ tests/fluxEngineBenchmarks/plasmaEtching.cpp | 67 ++++++++++++++++++++ tests/fluxEngineBenchmarks/spDeposition.cpp | 52 +++++++++++++++ tests/fluxEngineBenchmarks/spEtching.cpp | 49 ++++++++++++++ 5 files changed, 231 insertions(+) create mode 100644 tests/fluxEngineBenchmarks/CMakeLists.txt create mode 100644 tests/fluxEngineBenchmarks/ibeEtching.cpp create mode 100644 tests/fluxEngineBenchmarks/plasmaEtching.cpp create mode 100644 tests/fluxEngineBenchmarks/spDeposition.cpp create mode 100644 tests/fluxEngineBenchmarks/spEtching.cpp diff --git a/tests/fluxEngineBenchmarks/CMakeLists.txt b/tests/fluxEngineBenchmarks/CMakeLists.txt new file mode 100644 index 00000000..ea3794a6 --- /dev/null +++ b/tests/fluxEngineBenchmarks/CMakeLists.txt @@ -0,0 +1,6 @@ +project(fluxEngineBenchmarks LANGUAGES CXX) + +viennaps_add_executable(plasmaEtchingBenchmark "plasmaEtching.cpp") +viennaps_add_executable(spDepositionBenchmark "spDeposition.cpp") +viennaps_add_executable(spEtchingBenchmark "spEtching.cpp") +viennaps_add_executable(ibeEtchingBenchmark "ibeEtching.cpp") diff --git a/tests/fluxEngineBenchmarks/ibeEtching.cpp b/tests/fluxEngineBenchmarks/ibeEtching.cpp new file mode 100644 index 00000000..97031728 --- /dev/null +++ b/tests/fluxEngineBenchmarks/ibeEtching.cpp @@ -0,0 +1,57 @@ +#include +#include + +#include +#include + +using namespace viennaps; + +int main(int argc, char *argv[]) { + using NumericType = double; + constexpr int D = 2; + + Logger::setLogLevel(LogLevel::WARNING); + + auto run = [&](FluxEngineType fluxEngine) { + auto geometry = Domain::New( + 0.09, 10.0, BoundaryType::REFLECTIVE_BOUNDARY); + MakeTrench(geometry, 5.0, 0.0, 0.0, 2.0).apply(); + + IBEParameters ibeParams; + ibeParams.exponent = 100; + ibeParams.thetaRMin = 89.; + ibeParams.thetaRMax = 90.; + + // ibeParams.meanEnergy = 100; + // ibeParams.sigmaEnergy = 10; + // ibeParams.thresholdEnergy = 10; + + ibeParams.planeWaferRate = 1.0; + + // ibeParams.cos4Yield.isDefined = true; + // ibeParams.cos4Yield.a1 = 1.075; + // ibeParams.cos4Yield.a2 = -1.55; + // ibeParams.cos4Yield.a3 = 0.65; + + auto model = SmartPointer>::New( + ibeParams, std::vector{Material::Mask}); + + AdvectionParameters advectionParams; + advectionParams.spatialScheme = + viennals::SpatialSchemeEnum::LAX_FRIEDRICHS_2ND_ORDER; + + Process process(geometry, model); + process.setProcessDuration(10); + process.setParameters(advectionParams); + process.setFluxEngineType(fluxEngine); + + process.apply(); + + geometry->saveSurfaceMesh("ibeEtching_" + util::toString(fluxEngine)); + }; + + run(FluxEngineType::GPU_TRIANGLE); + run(FluxEngineType::GPU_DISK); + run(FluxEngineType::CPU_TRIANGLE); + run(FluxEngineType::CPU_DISK); +} diff --git a/tests/fluxEngineBenchmarks/plasmaEtching.cpp b/tests/fluxEngineBenchmarks/plasmaEtching.cpp new file mode 100644 index 00000000..c1a53496 --- /dev/null +++ b/tests/fluxEngineBenchmarks/plasmaEtching.cpp @@ -0,0 +1,67 @@ +#include +#include + +#include +#include + +using namespace viennaps; + +int main(int argc, char *argv[]) { + using NumericType = double; + constexpr int D = 2; + + Logger::setLogLevel(LogLevel::WARNING); + // set parameter units + units::Length::setUnit("um"); + units::Time::setUnit("min"); + + auto run = [&](FluxEngineType fluxEngine) { + // geometry setup + auto geometry = Domain::New( + 0.03, 1.0, + BoundaryType::REFLECTIVE_BOUNDARY); // gridDelta, xExtent, boundary + MakeHole(geometry, 0.175, + 0.0, // holeDepth + 0.0, // holeTaperAngle + 1.2, 1.193, HoleShape::QUARTER) + .apply(); + + // use pre-defined model SF6O2 etching model + auto modelParams = SF6O2Etching::defaultParameters(); + modelParams.beta_E[static_cast(Material::Si)] = 1.0; + modelParams.beta_E[static_cast(Material::Mask)] = 1.0; + modelParams.beta_P[static_cast(Material::Si)] = 1.0; + modelParams.beta_P[static_cast(Material::Mask)] = 1.0; + + modelParams.ionFlux = 1.; + modelParams.etchantFlux = 4.5e3; + modelParams.passivationFlux = 8e2; + modelParams.Ions.meanEnergy = 100; + modelParams.Ions.sigmaEnergy = 10; + modelParams.Ions.exponent = 1000; + modelParams.Passivation.A_ie = 2.0; + modelParams.Substrate.A_ie = 7; + auto model = SmartPointer>::New(modelParams); + + CoverageParameters coverageParams; + coverageParams.tolerance = 1e-4; + + RayTracingParameters rayTracingParams; + rayTracingParams.raysPerPoint = 10000; + + Process process(geometry, model); + process.setProcessDuration(1.0); + process.setParameters(coverageParams); + process.setFluxEngineType(fluxEngine); + process.setParameters(rayTracingParams); + + process.apply(); + + geometry->saveSurfaceMesh("PlasmaEtching_" + util::toString(fluxEngine)); + }; + + run(FluxEngineType::GPU_TRIANGLE); + run(FluxEngineType::GPU_DISK); + run(FluxEngineType::CPU_TRIANGLE); + run(FluxEngineType::CPU_DISK); +} diff --git a/tests/fluxEngineBenchmarks/spDeposition.cpp b/tests/fluxEngineBenchmarks/spDeposition.cpp new file mode 100644 index 00000000..3b4ebc26 --- /dev/null +++ b/tests/fluxEngineBenchmarks/spDeposition.cpp @@ -0,0 +1,52 @@ +#include +#include + +#include +#include + +using namespace viennaps; + +int main(int argc, char *argv[]) { + using NumericType = double; + constexpr int D = 2; + +#ifndef NDEBUG + Logger::setLogLevel(LogLevel::INTERMEDIATE); +// omp_set_num_threads(1); +#else + Logger::setLogLevel(LogLevel::WARNING); +#endif + + auto run = [&](FluxEngineType fluxEngine) { + auto geometry = Domain::New( + 0.14, 10, BoundaryType::REFLECTIVE_BOUNDARY); + MakeTrench(geometry, 4.0, 20.0, 0.0, 0.0, 0.0, true) + .apply(); + + geometry->duplicateTopLevelSet(Material::SiO2); + + auto model = + SmartPointer>::New(1.0, 0.01); + model->setProcessName(util::toString(fluxEngine)); + + RayTracingParameters rayTracingParams; + rayTracingParams.raysPerPoint = 10000; + + Process process(geometry, model); + process.setProcessDuration(5); + process.setParameters(rayTracingParams); + process.setFluxEngineType(fluxEngine); + process.apply(); + // auto flux = process.calculateFlux(); + // viennals::VTKWriter( + // flux, "flux_" + util::toString(fluxEngine) + ".vtp") + // .apply(); + + geometry->saveSurfaceMesh("spDeposition_" + util::toString(fluxEngine)); + }; + + run(FluxEngineType::GPU_TRIANGLE); + run(FluxEngineType::GPU_DISK); + run(FluxEngineType::CPU_TRIANGLE); + run(FluxEngineType::CPU_DISK); +} diff --git a/tests/fluxEngineBenchmarks/spEtching.cpp b/tests/fluxEngineBenchmarks/spEtching.cpp new file mode 100644 index 00000000..d5e2ae5e --- /dev/null +++ b/tests/fluxEngineBenchmarks/spEtching.cpp @@ -0,0 +1,49 @@ +#include +#include + +#include +#include + +using namespace viennaps; + +int main(int argc, char *argv[]) { + using NumericType = double; + constexpr int D = 2; + +#ifndef NDEBUG + Logger::setLogLevel(LogLevel::INTERMEDIATE); +// omp_set_num_threads(1); +#else + Logger::setLogLevel(LogLevel::WARNING); +#endif + + auto run = [&](FluxEngineType fluxEngine) { + auto geometry = Domain::New( + 0.14, 16, BoundaryType::REFLECTIVE_BOUNDARY); + MakeTrench(geometry, 4.0, 0.0, 0.0, 1.0, 0.0, true).apply(); + + auto model = SmartPointer>::New( + -1.0, 0.05, 10.0, Material::Mask); + model->setProcessName(util::toString(fluxEngine)); + + RayTracingParameters rayTracingParams; + rayTracingParams.raysPerPoint = 10000; + + Process process(geometry, model); + process.setProcessDuration(5); + process.setParameters(rayTracingParams); + process.setFluxEngineType(fluxEngine); + process.apply(); + // auto flux = process.calculateFlux(); + // viennals::VTKWriter( + // flux, "flux_" + util::toString(fluxEngine) + ".vtp") + // .apply(); + + geometry->saveSurfaceMesh("spEtching_" + util::toString(fluxEngine)); + }; + + run(FluxEngineType::GPU_TRIANGLE); + run(FluxEngineType::GPU_DISK); + run(FluxEngineType::CPU_TRIANGLE); + run(FluxEngineType::CPU_DISK); +} From 72f41292c06f5aacbaa51a3ff2310fd42fadaacd Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Mon, 30 Mar 2026 15:14:51 +0200 Subject: [PATCH 2/2] chore: bump ViennaRay --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d38250b3..68b27698 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ CPMAddPackage( CPMAddPackage( NAME ViennaRay - VERSION 4.1.1 + VERSION 4.1.2 GIT_REPOSITORY "https://github.com/ViennaTools/ViennaRay" EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON} OPTIONS "VIENNARAY_USE_GPU ${VIENNAPS_USE_GPU}")