Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Re route validation tests #718

Merged
merged 27 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bf0ce79
Update error thrown
figueroa1395 Sep 10, 2024
380c421
[skip ci] working on single-validation - broken atm
figueroa1395 Sep 11, 2024
e63f13b
[skip ci] fix func_selector
figueroa1395 Sep 16, 2024
06fdf5b
[skip ci] working on single-validation - func_selector_broken
figueroa1395 Sep 16, 2024
23e76bc
[skip ci] debugging state - broken
figueroa1395 Sep 18, 2024
6e650c5
Merge branch 'main' into feature/re-route-benchmark-validation-tests
figueroa1395 Sep 19, 2024
963b7e9
[skip ci] fixed buffer deletion - broken: buffer overflow when parsing
figueroa1395 Sep 26, 2024
d8fbcbf
parse to buffer fixed
figueroa1395 Sep 26, 2024
f7deb31
dataset creation working
figueroa1395 Sep 26, 2024
66ffad5
model.calculate working for all single-cases
figueroa1395 Sep 26, 2024
2a6cbd4
[skip ci] single tests compile - running broken
figueroa1395 Sep 27, 2024
b1f54a2
[skip ci] fixed stack overflow - numeric problems now
figueroa1395 Sep 30, 2024
7230835
[skip ci] single sym passes - asym broken
figueroa1395 Sep 30, 2024
0c0633b
[skip ci] asym fixed - new heap overflow issue
figueroa1395 Sep 30, 2024
98f1bfa
single validation tests pass
figueroa1395 Sep 30, 2024
dad4732
full batch tests pass
figueroa1395 Oct 1, 2024
53ace85
cleanup
figueroa1395 Oct 2, 2024
25333ef
Merge branch 'main' into feature/re-route-benchmark-validation-tests
figueroa1395 Oct 2, 2024
0034cfc
removed core dependency
figueroa1395 Oct 2, 2024
aaa0cb5
cleaned up assert_result
figueroa1395 Oct 2, 2024
31c173e
Tests pass
figueroa1395 Oct 4, 2024
635b0f7
Merge branch 'main' into feature/re-route-benchmark-validation-tests
figueroa1395 Oct 4, 2024
6099e47
Addressed comments and sonar
figueroa1395 Oct 4, 2024
b3ca98f
fix aligned malloc bug
TonyXiang8787 Oct 5, 2024
7c2d0bc
sonar
figueroa1395 Oct 7, 2024
d1f29fd
clang tidy manual run
figueroa1395 Oct 7, 2024
e8f0c8b
Addressed comments and clang-tidy
figueroa1395 Oct 7, 2024
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
9 changes: 7 additions & 2 deletions power_grid_model_c/power_grid_model_c/src/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ using meta_data::RawDataPtr;

// buffer control
RawDataPtr PGM_create_buffer(PGM_Handle* /* handle */, PGM_MetaComponent const* component, PGM_Idx size) {
// alignment should be maximum of alignment of the component and alignment of void*
size_t const alignment = std::max(component->alignment, sizeof(void*));
// total bytes should be multiple of alignment
size_t const requested_bytes = component->size * size;
size_t const rounded_bytes = ((requested_bytes + alignment - 1) / alignment) * alignment;
#ifdef _WIN32
return _aligned_malloc(component->size * size, component->alignment);
return _aligned_malloc(rounded_bytes, alignment);
#else
return std::aligned_alloc(component->alignment, component->size * size);
return std::aligned_alloc(alignment, rounded_bytes);
TonyXiang8787 marked this conversation as resolved.
Show resolved Hide resolved
#endif
}
void PGM_destroy_buffer(RawDataPtr ptr) {
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp_validation_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ add_executable(power_grid_model_validation_tests ${PROJECT_SOURCES})

target_link_libraries(power_grid_model_validation_tests
PRIVATE
power_grid_model
power_grid_model_cpp
doctest::doctest
nlohmann_json nlohmann_json::nlohmann_json
)
Expand Down
Loading
Loading