Skip to content
Closed
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 @@ -58,7 +58,7 @@ jobs:
path: build

- 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
29 changes: 27 additions & 2 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.2
VERSION 1.9.4
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaCore"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON}
OPTIONS "VIENNACORE_USE_GPU ${VIENNAPS_USE_GPU}")
Expand Down Expand Up @@ -137,6 +139,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 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/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
2 changes: 2 additions & 0 deletions lib/specMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

#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 {

Expand Down
Loading