Skip to content

Commit

Permalink
Merge with wavefunction91#127
Browse files Browse the repository at this point in the history
  • Loading branch information
mikovtun committed May 20, 2024
1 parent 792322a commit 683f0aa
Show file tree
Hide file tree
Showing 24 changed files with 989 additions and 1,007 deletions.
1 change: 1 addition & 0 deletions src/xc_integrator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
add_subdirectory(integrator_util)
add_subdirectory(local_work_driver)
add_subdirectory(shell_batched)
add_subdirectory(replicated)
add_subdirectory(xc_data)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class IncoreReplicatedXCDeviceIntegrator :

public:

static constexpr bool is_device = true;
using value_type = typename base_type::value_type;
using basis_type = typename base_type::basis_type;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/**
* GauXC Copyright (c) 2020-2024, The Regents of the University of California,
* GauXC Copyright (c) 2020-2023, The Regents of the University of California,
* through Lawrence Berkeley National Laboratory (subject to receipt of
* any required approvals from the U.S. Dept. of Energy). All rights reserved.
*
* See LICENSE.txt for details
*/
#include "shellbatched_replicated_xc_device_integrator_integrate_den.hpp"
#include "shellbatched_replicated_xc_device_integrator_exc_vxc.hpp"
#include "shellbatched_replicated_xc_device_integrator_exc_grad.hpp"
#include "shellbatched_replicated_xc_device_integrator_exx.hpp"
#include "shellbatched_replicated_xc_device_integrator.hpp"
#include "shell_batched_replicated_xc_integrator_integrate_den.hpp"
#include "shell_batched_replicated_xc_integrator_exc_vxc.hpp"
#include "shell_batched_replicated_xc_integrator_exc_grad.hpp"
#include "shell_batched_replicated_xc_integrator_exx.hpp"

namespace GauXC {
namespace detail {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,113 +1,30 @@
/**
* GauXC Copyright (c) 2020-2024, The Regents of the University of California,
* GauXC Copyright (c) 2020-2023, The Regents of the University of California,
* through Lawrence Berkeley National Laboratory (subject to receipt of
* any required approvals from the U.S. Dept. of Energy). All rights reserved.
*
* See LICENSE.txt for details
*/
#pragma once
#include <gauxc/xc_integrator/replicated/replicated_xc_device_integrator.hpp>
#include "device/xc_device_data.hpp"
#include "incore_replicated_xc_device_integrator.hpp"
#include "shell_batched_replicated_xc_integrator.hpp"

namespace GauXC {
namespace detail {

template <typename ValueType>
class ShellBatchedReplicatedXCDeviceIntegrator :
public ReplicatedXCDeviceIntegrator<ValueType> {
public ShellBatchedReplicatedXCIntegrator<
ReplicatedXCDeviceIntegrator<ValueType>,
IncoreReplicatedXCDeviceIntegrator<ValueType>
> {

using base_type = ReplicatedXCDeviceIntegrator<ValueType>;
using base_type = ShellBatchedReplicatedXCIntegrator<
ReplicatedXCDeviceIntegrator<ValueType>,
IncoreReplicatedXCDeviceIntegrator<ValueType>
>;

public:

using value_type = typename base_type::value_type;
using basis_type = typename base_type::basis_type;

using host_task_container = std::vector<XCTask>;
using host_task_iterator = typename host_task_container::iterator;

protected:

using incore_integrator_type =
IncoreReplicatedXCDeviceIntegrator<ValueType>;

// Struct to manage data associated with task subset to execute on the device
struct incore_device_task {
host_task_iterator task_begin;
host_task_iterator task_end;
std::vector<int32_t> shell_list;
};

void integrate_den_( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* integrate_den ) override;

void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* VXC, int64_t ldvxc,
value_type* EXC, const IntegratorSettingsXC& settings ) override;

void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps,
int64_t ldps,
const value_type* Pz,
int64_t ldpz,
value_type* VXCs, int64_t ldvxcs,
value_type* VXCz, int64_t ldvxcz,
value_type* EXC, const IntegratorSettingsXC& settings ) override;

void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps,
int64_t ldps,
const value_type* Pz,
int64_t ldpz,
const value_type* Py,
int64_t ldpy,
const value_type* Px,
int64_t ldpx,
value_type* VXCs, int64_t ldvxcs,
value_type* VXCz, int64_t ldvxcz,
value_type* VXCy, int64_t ldvxcy,
value_type* VXCx, int64_t ldvxcx,
value_type* EXC, const IntegratorSettingsXC& settings ) override;

void eval_exc_grad_( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* EXC_GRAD ) override;

void eval_exx_( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* K, int64_t ldk,
const IntegratorSettingsEXX& settings ) override;
void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps,
const value_type* Pz, int64_t ldpz,
const value_type* Py, int64_t ldpy,
const value_type* Px, int64_t ldpx,
value_type* VXC, int64_t ldvxc,
value_type* VXCz, int64_t ldvxcz,
value_type* VXCy, int64_t ldvxcy,
value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL,
host_task_iterator task_begin, host_task_iterator task_end,
incore_integrator_type& incore_integrator,
XCDeviceData& device_data );

void eval_exc_grad_local_work_( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* EXC_GRAD,
host_task_iterator task_begin, host_task_iterator task_end,
incore_integrator_type& incore_integrator,
XCDeviceData& device_data );


incore_device_task generate_incore_device_task( const uint32_t nbf_threshold,
const basis_type& basis,
host_task_iterator task_begin,
host_task_iterator task_end );

void execute_task_batch( incore_device_task& task, const basis_type& basis, const Molecule& mol,
const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz,
const value_type* Py, int64_t ldpy, const value_type* Px, int64_t ldpx,
value_type* VXCs, int64_t ldvxcs,
value_type* VXCz, int64_t ldvxcz,
value_type* VXCy, int64_t ldvxcy,
value_type* VXCx, int64_t ldvxcx,
value_type* EXC,
value_type* N_EL, incore_integrator_type& incore_integrator,
XCDeviceData& device_data );
public:

template <typename... Args>
Expand All @@ -122,3 +39,4 @@ extern template class ShellBatchedReplicatedXCDeviceIntegrator<double>;

}
}

Loading

0 comments on commit 683f0aa

Please sign in to comment.