Repository navigation
Refactor: use explicit C++ types and validate device_exx choices - #58
Closed
Stardust0831 wants to merge 6 commits into
Closed
Stardust0831 wants to merge 6 commits into
Stardust0831 wants to merge 6 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by two independent draft pull requests from the same base.
Applying both drafts in either order reproduces the tree at
f4fb7bd43.Reminder
AGENTS.mdand the full governance guide.Linked Issue
Follows the maintainer review of the EXX device selector.
What's changed?
The first five commits make 55
autodeclarations explicit. They cover all five EXX review sites, 33 INPUT declarations, four Wannier spin-output declarations, 12 LCAO radial-table declarations and one CUDA buffer pointer. The types preserve the existing copies, references, iterator constness and shared ownership.The sixth commit declares
cpuandgpuas the allowed values fordevice_exxin itsInput_Itemregistration. Invalid input now reports the supplied value and both choices. The regression forddlareads an LCAOINPUTfile. The existing EXX test helper checks the GPU restrictions onbasis_type,deviceandENABLE_LIBRI_GPU. The default remainscpu.An audit of the original patches and surviving lines from 44 merged PRs targeting
developfound 76 introductions. The remaining 21 are insource/source_lcao/test/test_center2orb_orb11.cpp(19) andsource/source_io/module_parameter/test/test_input_domain.cpp(2). Editing either legacy test requires a move tounittests/and a change to its build registration. The existingrelax_methoditerator was moved by an earlier PR and is excluded from the count.Across tracked C/C++ and accelerator sources and headers, the inventory changes from 3,112
autotokens in 573 files to 3,057 in 564 files. The 105 occurrences in comments and 30 in literals are counted separately. Examples of other uses include generic lambda parameters and structured bindings.Unit Tests and/or Case Tests for my changes
__GPU_RIdisabled and enabled each passed all 53 tests fromOMP_NUM_THREADS=1 ./input-testsand the EXX test fromOMP_NUM_THREADS=1 ./exx-input-test --gtest_filter=DeviceExxInput.SelectionAndValidation.cpu.OMP_NUM_THREADS=1 ../cpu/read-device-exx INPUT.ddlaexited with status 1 and printedInvalid INPUT parameter 'device_exx': supplied 'ddla'. Expected one String from {cpu, gpu}.Parameter help listed both choices. The EXX test exercised the incompatible basis and device, the missing GPU RI build capability and the supported selection path when__GPU_RIis enabled.OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 ./radial-testspassed all four CPU radial-table tests on the base and the refactored code. FourExx_LRI_Interface::set_gpuspecializations passed a GCC C++14 syntax check with the LibRI v0.3.0.0 and DDLA v0.0.7 GPU API headers. The additional--gtest_death_test_style=threadsafecontrol lost captured stdout on the base and the refactored code with Google Test 1.11.cmpfound byte-identical GCC objects for the eight CPU production translation units under test, including the three.spnwriter instantiations. CUDA 12.9.86 compiled the Wang-Teter translation unit forsm_70.cmpmatched its PTX and its host object afterobjcopy --strip-debugremoved the compiler-generated temporary filename.git diff --checkpassed. Full-program MPI, on-device GPU execution and HIP builds were outside these focused checks.Governance Notes
No documentation update required because the built-in help and generated INPUT manual obtain the allowed values from the updated
device_exxregistration. No governance exception is requested.