Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
if (Test-Path build/_deps) { Remove-Item -Recurse -Force build/_deps }

- name: 🏗️ Compile
run: cmake -DVIENNAPS_BUILD_TESTS=ON -B build && cmake --build build --config ${{ matrix.config }}
run: cmake -DVIENNAPS_BUILD_TESTS=ON -DVIENNAPS_ENABLE_SANITIZER=ON -B build && cmake --build build --config ${{ matrix.config }}

- name: 🧪 Test
run: ctest -E "Benchmark|Performance" -C ${{ matrix.config }} --test-dir build
37 changes: 32 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ endif()

option(VIENNAPS_PRECOMPILE_HEADERS "Enable precompiled headers" OFF)
option(VIENNAPS_STATIC_BUILD "Build ViennaPS as static library" OFF)
option(VIENNAPS_ENABLE_SANITIZER "Enable sanitizers" OFF)
option(VIENNAPS_ENABLE_CLANG_TIDY "Run clang-tidy during build" OFF)

option(VIENNAPS_USE_GPU "Enable GPU support" OFF)

Expand Down Expand Up @@ -68,7 +70,7 @@ if(VIENNAPS_BUILD_PYTHON)
endif()

if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -openmp:llvm /bigobj")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp:llvm /bigobj")
endif()

# --------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -105,7 +107,7 @@ include("cmake/cpm.cmake")

CPMAddPackage(
NAME ViennaCore
VERSION 1.9.4
VERSION 1.9.5
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaCore"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
OPTIONS "VIENNACORE_USE_GPU ${VIENNAPS_USE_GPU}")
Expand All @@ -126,7 +128,8 @@ CPMAddPackage(
NAME ViennaLS
VERSION 5.5.0
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaLS"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON})
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
OPTIONS "VIENNALS_PRECOMPILE_HEADERS ${VIENNAPS_PRECOMPILE_HEADERS}")

CPMAddPackage(
NAME ViennaCS
Expand All @@ -137,6 +140,29 @@ CPMAddPackage(
target_link_libraries(${PROJECT_NAME} INTERFACE ViennaTools::ViennaCore ViennaTools::ViennaLS
ViennaTools::ViennaRay ViennaTools::ViennaCS)

# --------------------------------------------------------------------------------------------------------
# Setup Sanitizer or Clang-Tidy
# --------------------------------------------------------------------------------------------------------

if(VIENNAPS_ENABLE_SANITIZER)
if(VIENNAPS_USE_GPU)
message(WARNING "[ViennaPS] Sanitizers cannot be used with GPU support enabled!")
else()
viennacore_enable_sanitizer()
message(STATUS "[ViennaPS] Enabled Sanitizers")
endif()
endif()

if(VIENNAPS_ENABLE_CLANG_TIDY)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_program(CLANG_TIDY_EXE NAMES clang-tidy)
if(NOT CLANG_TIDY_EXE)
message(FATAL_ERROR "clang-tidy not found")
endif()

set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" "--quiet" "--warnings-as-errors=*")
endif()

# --------------------------------------------------------------------------------------------------------
# Setup Shared/Static Library
# --------------------------------------------------------------------------------------------------------
Expand All @@ -155,8 +181,9 @@ if(VIENNAPS_PRECOMPILE_HEADERS)
target_link_libraries(${LIB_NAME} PRIVATE ${PROJECT_NAME})
target_compile_definitions(${LIB_NAME} PRIVATE VIENNAPS_USE_PRECOMPILED=1
VIENNACORE_COMPILE_SHARED_LIB=1)
target_sources(${LIB_NAME} PRIVATE "lib/specMain.cpp" "lib/specGeometries.cpp"
"lib/specModels.cpp")
target_sources(
${LIB_NAME} PRIVATE "lib/specMain.cpp" "lib/specGeometries.cpp" "lib/specModelsEmulation.cpp"
"lib/specModelsSimulation.cpp" "lib/specProcess.cpp")

set_target_properties(
${LIB_NAME}
Expand Down
2 changes: 1 addition & 1 deletion include/viennaps/models/psCF4O2Etching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class CF4O2Ion final
const NumericType sqrt_E_th_ie_C;
const NumericType sqrt_E_th_ie_Si;

NumericType E;
NumericType E = 0.;
};

template <typename NumericType, int D>
Expand Down
18 changes: 9 additions & 9 deletions include/viennaps/models/psDirectionalProcess.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,6 @@ class DirectionalProcess : public ProcessModelCPU<NumericType, D> {
// Default surface model
auto surfModel = SmartPointer<SurfaceModel<NumericType>>::New();

// Velocity field with multiple rate sets
auto velField =
SmartPointer<impl::DirectionalVelocityField<NumericType, D>>::New(
std::move(rateSets));

this->setSurfaceModel(surfModel);
this->setVelocityField(velField);
this->setProcessName("DirectionalProcess");

// Store process data
processMetaData["DirectionalVelocity"] = std::vector<double>();
processMetaData["IsotropicVelocity"] = std::vector<double>();
Expand All @@ -223,6 +214,15 @@ class DirectionalProcess : public ProcessModelCPU<NumericType, D> {
processMetaData["Direction " + std::to_string(i++)] = std::vector<double>{
rateSet.direction[0], rateSet.direction[1], rateSet.direction[2]};
}

// Velocity field with multiple rate sets
auto velField =
SmartPointer<impl::DirectionalVelocityField<NumericType, D>>::New(
std::move(rateSets));

this->setVelocityField(velField);
this->setSurfaceModel(surfModel);
this->setProcessName("DirectionalProcess");
}

using ProcessModelCPU<NumericType, D>::processMetaData;
Expand Down
2 changes: 1 addition & 1 deletion include/viennaps/models/psFluorocarbonEtching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ class FluorocarbonIon
const FluorocarbonParameters<NumericType> &p;
const NumericType A;
NumericType minEnergy = std::numeric_limits<NumericType>::max();
NumericType E;
NumericType E = 0.;

public:
FluorocarbonIon(const FluorocarbonParameters<NumericType> &parameters)
Expand Down
2 changes: 1 addition & 1 deletion include/viennaps/models/psPlasmaEtching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class PlasmaEtchingIon
const NumericType sqrt_E_th_ie_P;
const NumericType sqrt_E_th_ie_Sub;

NumericType E;
NumericType E = 0.;
};

template <typename NumericType, int D>
Expand Down
4 changes: 4 additions & 0 deletions include/viennaps/process/psProcessModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ class ProcessModelCPU : public ProcessModelBase<NumericType, D> {
}
};

PS_PRECOMPILE_PRECISION_DIMENSION(ProcessModelCPU)

} // namespace viennaps

#ifdef VIENNACORE_COMPILE_GPU
Expand Down Expand Up @@ -239,5 +241,7 @@ class ProcessModelGPU : public ProcessModelBase<NumericType, D> {
}
};

PS_PRECOMPILE_PRECISION_DIMENSION(ProcessModelGPU)

} // namespace viennaps::gpu
#endif
4 changes: 4 additions & 0 deletions include/viennaps/psMaterials.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ class MaterialMap {
}

static inline Material mapToMaterial(const int matId) {
if (matId < 0 || matId > static_cast<int>(kMaterialMaxId)) {
VIENNACORE_LOG_ERROR("Invalid material id " + std::to_string(matId));
return Material::GAS;
}
return static_cast<Material>(matId);
}

Expand Down
3 changes: 2 additions & 1 deletion include/viennaps/psReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "psDomain.hpp"
#include "psPreCompileMacros.hpp"

#include <cstring>
#include <fstream>
#include <string>
#include <utility>
Expand Down Expand Up @@ -66,7 +67,7 @@ template <class NumericType, int D> class Reader {
// Check identifier
char identifier[8];
fin.read(identifier, 8);
if (std::string(identifier).compare(0, 8, "psDomain")) {
if (std::memcmp(identifier, "psDomain", 8) != 0) {
VIENNACORE_LOG_ERROR(
"Reading domain from stream failed. Header could not be found.");
return;
Expand Down
4 changes: 2 additions & 2 deletions include/viennaps/psVTKRenderWindow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class Custom3DInteractorStyle : public vtkInteractorStyleTrackballCamera {

private:
viennaps::VTKRenderWindow<double, 3> *Window = nullptr;
}; // namespace viennaps
};

// vtkStandardNewMacro(Custom3DInteractorStyle);

Expand All @@ -651,7 +651,7 @@ class Custom2DInteractorStyle : public vtkInteractorStyleImage {

private:
viennaps::VTKRenderWindow<double, 2> *Window = nullptr;
}; // namespace viennaps
};

// vtkStandardNewMacro(Custom2DInteractorStyle);

Expand Down
7 changes: 2 additions & 5 deletions lib/specMain.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include <gds/psGDSGeometry.hpp>
#include <gds/psGDSReader.hpp>

#include <process/psProcess.hpp>
#include <process/psProcessModel.hpp>

#include <psDomain.hpp>
#include <psDomainSetup.hpp>
#include <psExtrude.hpp>
Expand All @@ -16,16 +13,16 @@

#include <lsPreCompileMacros.hpp>

#ifdef VIENNACORE_COMPILE_GPU
// this include may only appear in a single source file:
#include <optix_function_table_definition.h>
#endif

namespace viennaps {

// Precompile specializations for commonly used classes
PRECOMPILE_SPECIALIZE(Domain)
PRECOMPILE_SPECIALIZE(Process)
PRECOMPILE_SPECIALIZE(Planarize)
PRECOMPILE_SPECIALIZE(ProcessModelCPU)
PRECOMPILE_SPECIALIZE(Reader)
PRECOMPILE_SPECIALIZE(Writer)
PRECOMPILE_SPECIALIZE(GDSGeometry)
Expand Down
24 changes: 24 additions & 0 deletions lib/specModelsEmulation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <models/psCSVFileProcess.hpp>
#include <models/psDirectionalProcess.hpp>
#include <models/psGeometricDistributionModels.hpp>
#include <models/psIsotropicProcess.hpp>
#include <models/psSelectiveEpitaxy.hpp>
#include <models/psWetEtching.hpp>

namespace viennaps {

// Precompile specializations for process models
// Emulation Models
PRECOMPILE_SPECIALIZE(CSVFileProcess)
PRECOMPILE_SPECIALIZE(DirectionalProcess)
PRECOMPILE_SPECIALIZE(IsotropicProcess)

// Geometric Models
PRECOMPILE_SPECIALIZE(BoxDistribution)
PRECOMPILE_SPECIALIZE(SphereDistribution)

// Crystal Anisotropy Models
PRECOMPILE_SPECIALIZE(SelectiveEpitaxy)
PRECOMPILE_SPECIALIZE(WetEtching)

} // namespace viennaps
20 changes: 0 additions & 20 deletions lib/specModels.cpp → lib/specModelsSimulation.cpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
#include <models/psCF4O2Etching.hpp>
#include <models/psCSVFileProcess.hpp>
#include <models/psDirectionalProcess.hpp>
#include <models/psFaradayCageEtching.hpp>
#include <models/psFluorocarbonEtching.hpp>
#include <models/psGeometricDistributionModels.hpp>
#include <models/psHBrO2Etching.hpp>
#include <models/psIonBeamEtching.hpp>
#include <models/psIsotropicProcess.hpp>
#include <models/psMultiParticleProcess.hpp>
#include <models/psOxideRegrowth.hpp>
#include <models/psSF6C4F8Etching.hpp>
#include <models/psSF6O2Etching.hpp>
#include <models/psSelectiveEpitaxy.hpp>
#include <models/psSingleParticleALD.hpp>
#include <models/psSingleParticleProcess.hpp>
#include <models/psTEOSDeposition.hpp>
#include <models/psTEOSPECVD.hpp>
#include <models/psWetEtching.hpp>

namespace viennaps {

// Precompile specializations for process models
// Emulation Models
PRECOMPILE_SPECIALIZE(CSVFileProcess)
PRECOMPILE_SPECIALIZE(DirectionalProcess)
PRECOMPILE_SPECIALIZE(IsotropicProcess)

// Geometric Models
PRECOMPILE_SPECIALIZE(BoxDistribution)
PRECOMPILE_SPECIALIZE(SphereDistribution)

// Plasma Etching Models
PRECOMPILE_SPECIALIZE(CF4O2Etching)
PRECOMPILE_SPECIALIZE(HBrO2Etching)
Expand All @@ -49,10 +33,6 @@ PRECOMPILE_SPECIALIZE(TEOSPECVD)
PRECOMPILE_SPECIALIZE(FaradayCageEtching)
PRECOMPILE_SPECIALIZE(IonBeamEtching)

// Crystal Anisotropy Models
PRECOMPILE_SPECIALIZE(SelectiveEpitaxy)
PRECOMPILE_SPECIALIZE(WetEtching)

// Atomic Layer Processing Models
PRECOMPILE_SPECIALIZE(SingleParticleALD)

Expand Down
18 changes: 18 additions & 0 deletions lib/specProcess.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <process/psProcess.hpp>
#include <process/psProcessModel.hpp>

#include <lsPreCompileMacros.hpp>

namespace viennaps {

// Precompile specializations for commonly used classes
PRECOMPILE_SPECIALIZE(Process)
PRECOMPILE_SPECIALIZE(ProcessModelCPU)

#ifdef VIENNACORE_COMPILE_GPU
namespace gpu {
PRECOMPILE_SPECIALIZE(ProcessModelGPU)
} // namespace gpu
#endif

} // namespace viennaps
Loading