Skip to content

HIP Fixes - #54

Open
ajaypanyala wants to merge 2 commits into
wavefunction91:masterfrom
ajaypanyala:hip_fixes
Open

HIP Fixes#54
ajaypanyala wants to merge 2 commits into
wavefunction91:masterfrom
ajaypanyala:hip_fixes

Conversation

@ajaypanyala

Copy link
Copy Markdown

HIP: implement missing Fxc/vxc_fxc device stubs and complete builtin functional coverage

The HIP backend (unlike CUDA and SYCL) never implemented Fxc/vxc_fxc (second XC derivative) device evaluation, and separately, builtin.hip's explicit template instantiation list only covered 28 of the 102 functional types CUDA's builtin.cu instantiates. Both left vtable symbols unresolved at link time for any executable that actually links (as opposed to just archiving) against libexchcxx built for HIP -- e.g. ordinary SVWN5/M06-2X calculations, or anything touching Fxc contraction.

  • hip/builtin.hip: add generic (KernelType-templated) stub definitions for the LDA/GGA/MGGA device_eval_{fxc,vxc_fxc}[_inc]helper* function templates, throwing std::runtime_error at call time. Wire them into the {LDA,GGA,MGGA}_GENERATE_DEVICE_HELPERS macros so every instantiated functional type gets them. Also complete the type list itself: append the 74 functional types (mostly GGA/meta-GGA -- PBE, M06 family, TPSS, SCAN-adjacent, etc.) present in cuda/builtin.cu but missing here entirely, so their ordinary EXC/VXC evaluation -- which the shared kernel_traits math already supports -- actually gets compiled for HIP.
  • hip/libxc_device.hip: add the missing LibxcKernelImpl eval_fxc_device_/eval_vxc_fxc_device_ (and inc variants) overrides using the existing UNUSED_DEVICE_(INC_)INTERFACE_GENERATOR macros -- the same idiom already used here for eval_*inc_device and in builtin_kernel.cxx for disabled kernels.
  • hip/xc_functional_device.hip: stub XCFunctional::eval_fxc_device/ eval_vxc_fxc_device (LDA/GGA/MGGA) the same way; these aggregate over each constituent kernel's (now-stubbed) eval_*_fxc_device.

…functional coverage

The HIP backend (unlike CUDA and SYCL) never implemented Fxc/vxc_fxc
(second XC derivative) device evaluation, and separately, builtin.hip's
explicit template instantiation list only covered 28 of the 102
functional types CUDA's builtin.cu instantiates. Both left vtable
symbols unresolved at link time for any executable that actually links
(as opposed to just archiving) against libexchcxx built for HIP -- e.g.
ordinary SVWN5/M06-2X calculations, or anything touching Fxc contraction.

- hip/builtin.hip: add generic (KernelType-templated) stub definitions
  for the LDA/GGA/MGGA device_eval_{fxc,vxc_fxc}[_inc]_helper_* function
  templates, throwing std::runtime_error at call time. Wire them into
  the {LDA,GGA,MGGA}_GENERATE_DEVICE_HELPERS macros so every
  instantiated functional type gets them. Also complete the type list
  itself: append the 74 functional types (mostly GGA/meta-GGA -- PBE,
  M06 family, TPSS, SCAN-adjacent, etc.) present in cuda/builtin.cu but
  missing here entirely, so their ordinary EXC/VXC evaluation -- which
  the shared kernel_traits<T> math already supports -- actually gets
  compiled for HIP.
- hip/libxc_device.hip: add the missing LibxcKernelImpl
  eval_fxc_device_/eval_vxc_fxc_device_ (and _inc_ variants) overrides
  using the existing UNUSED_DEVICE_(INC_)INTERFACE_GENERATOR macros --
  the same idiom already used here for eval_*_inc_device_ and in
  builtin_kernel.cxx for disabled kernels.
- hip/xc_functional_device.hip: stub XCFunctional::eval_fxc_device/
  eval_vxc_fxc_device (LDA/GGA/MGGA) the same way; these aggregate
  over each constituent kernel's (now-stubbed) eval_*_fxc_device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant