(git:3f0d10b)
Loading...
Searching...
No Matches
nnp_gpu.F File Reference

Go to the source code of this file.

Modules

module  nnp_gpu
 GPU offload driver for the NNP force evaluation. Hosts the ISO_C_BINDING interfaces to the CUDA launchers in src/nnp/gpu/ and the whole-step device pipeline called from nnp_force. All GPU entry points compile to inert stubs unless the build enables the NNP GPU backend (__OFFLOAD without __NO_OFFLOAD_NNP).

Functions/Subroutines

logical function, public nnp_gpu::nnp_gpu_available ()
 Report whether the NNP GPU backend can run: the build must enable it and at least one offload device must be visible. Builds without the backend always report .FALSE., so USE_GPU AUTO resolves to the CPU path there.
subroutine, public nnp_gpu::nnp_gpu_init_device (gpu_precision, accepted)
 Claim the offload device for this NNP environment and push the requested compute precision to the device side.
logical function, public nnp_gpu::nnp_gpu_model_capacity_ok (nnp, reason)
 Test whether the model fits the compiled-in device-table capacities: NNP_MAX_SE (group, element) slots per symmetry-function kind, and NNP_SPLINE_CACHE_MAX run-constant parameter tables, of which each radial group holds two (spline values and derivatives) and each angular group four (the packed parameter tables). Called before the device is claimed, so an oversized model is turned away before any upload rather than in the first force evaluation.
subroutine, public nnp_gpu::nnp_gpu_upload_descriptor_statics (nnp)
 Upload the model-static descriptor tables to the device once at NNP initialization: the per-element symmetry-function scaling parameters (average, minimum, maximum, sigma) and the per-(group, element) symmetry-function to descriptor-row maps. Both are immutable after the input parse, so the device copies are valid for the whole environment lifetime and the per-step descriptor kernels read them without any further host-to-device traffic.
subroutine, public nnp_gpu::nnp_gpu_upload_network (nnp)
 Upload the committee network to the device once at NNP initialization: the per-element layer topology, the shared activation-function codes, the per-element atomic reference energies and the packed per-committee weights and biases. These are immutable after the weights are read, so the device copies serve every MD step and the per-step network launcher needs no further weight traffic. The weights and biases are packed into zero-padded max_n_nodes-wide slabs so a single stride addresses every (element, layer, committee) block regardless of that block's true size.
subroutine, public nnp_gpu::nnp_gpu_energy_force (nnp, istart, mecalc, n_input_max, calc_stress)
 Run the whole per-step NNP force evaluation on the device: the cell-list walk, the descriptor build, the committee network and the force scatter, in that order. The walk builds the device neighbour lists, the descriptor build fills the scaled device descriptor, the network fills nnpatomic_energy and leaves its descriptor gradient on the device, and the scatter multiplies that gradient by the descriptor derivatives and reads the total forces back into nnpmyforce. The scatter accumulator is seeded from nnpmyforce, which the caller has zeroed, so on return it holds the complete NNP forces for this window.