Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
samayala22 committed Feb 20, 2024
1 parent 6817bac commit dff4254
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 54 deletions.
22 changes: 12 additions & 10 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Checks: '-*,clang-diagnostic-*,misc-*,performance-*,clang-analyzer-*,bugprone-*'
Checks: '-*,clang-diagnostic-*,misc-*,performance-*,clang-analyzer-*,bugprone-*,
-bugprone-easily-swappable-parameters'
CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.MemberCase, value: lower_case }
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
- { key: readability-simplify-boolean-expr, value: true }
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: m_ }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.MemberCase, value: lower_case }
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
- { key: readability-simplify-boolean-expr, value: true }
- { key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables, value: true }
34 changes: 0 additions & 34 deletions headeronly/simpletimer.hpp

This file was deleted.

1 change: 0 additions & 1 deletion vlm/backends/cpu/include/vlm_backend_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace vlm {
class BackendCPU : public Backend {
public:
std::vector<f32> lhs;
std::vector<f32> lhs_dummy;
std::vector<f32> rhs;
std::vector<i32> ipiv;
std::vector<f32> gamma;
Expand Down
3 changes: 1 addition & 2 deletions vlm/backends/cpu/src/vlm_backend_cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ BackendCPU::~BackendCPU() = default; // Destructor definition

BackendCPU::BackendCPU(Mesh& mesh) : Backend(mesh) {
lhs.resize(mesh.nb_panels_wing() * mesh.nb_panels_wing());
lhs_dummy.resize(mesh.nb_panels_wing() * mesh.nb_panels_wing());
rhs.resize(mesh.nb_panels_wing());
ipiv.resize(mesh.nb_panels_wing());
gamma.resize(mesh.nb_panels_wing());
Expand All @@ -39,7 +38,7 @@ void BackendCPU::reset() {
}

void BackendCPU::compute_delta_gamma() {
std::copy(gamma.begin(), gamma.begin()+mesh.ns, delta_gamma.begin());
std::copy(gamma.data(), gamma.data()+mesh.ns, delta_gamma.data());

// note: this is efficient as the memory is contiguous
for (u64 i = 1; i < mesh.nc; i++) {
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions vlm/backends/cuda/src/vlm_backend_cuda.cu
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "vlm_backend_cpu.hpp"
#include "vlm_backend_cuda.hpp"

#include "simpletimer.hpp"
#include "tinytimer.hpp"

#include <cusolverDn.h>
#include <cublas_v2.h>
#include <cuda_runtime.h>
#include "helper_math.h"
#include "helper_math.cuh"

#include <cstdio>
#include <stdlib.h>
Expand Down Expand Up @@ -284,7 +284,7 @@ constexpr u64 get_grid_size(u64 length, u64 block_size) {
}

void BackendCUDA::compute_lhs(const FlowData& flow) {
SimpleTimer timer("LHS");
tiny::ScopedTimer timer("LHS");
// Copy the latest mesh that has been corrected for the aoa
u64 npt = mesh.nb_panels_total();
u64 nvt = mesh.nb_vertices_total();
Expand Down Expand Up @@ -331,7 +331,7 @@ void BackendCUDA::compute_rhs(const FlowData& flow, const std::vector<f32>& sect
}

void BackendCUDA::lu_factor() {
SimpleTimer timer("Factor");
tiny::ScopedTimer timer("Factor");
int n = (int)mesh.nb_panels_wing();
int h_info = 0;

Expand All @@ -341,7 +341,7 @@ void BackendCUDA::lu_factor() {
};

void BackendCUDA::lu_solve() {
SimpleTimer timer("Solve");
tiny::ScopedTimer timer("Solve");
//default_backend.solve();
int n = (int)mesh.nb_panels_wing();
int h_info = 0;
Expand Down
2 changes: 1 addition & 1 deletion vlm/include/vlm_mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ class Mesh {
};

// todo, update this to mirror the constructor
std::unique_ptr<Mesh> create_mesh(const std::string filename);
std::unique_ptr<Mesh> create_mesh(const std::string& filename);

} // namespace vlm
2 changes: 1 addition & 1 deletion vlm/src/vlm_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Mesh::Mesh(
init();
}

std::unique_ptr<Mesh> vlm::create_mesh(const std::string filename) {
std::unique_ptr<Mesh> vlm::create_mesh(const std::string& filename) {
return std::make_unique<Mesh>(filename);
}

Expand Down

0 comments on commit dff4254

Please sign in to comment.