Skip to content

Commit b7eb770

Browse files
committed
Add header to runtime environment
1 parent 3b73bee commit b7eb770

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

include/gauxc/runtime_environment.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#else
1717
#include <stddef.h>
1818
#endif
19+
#include <gauxc/types.h>
1920
#include <gauxc/status.h>
2021
#include <gauxc/util/mpi.h>
2122

@@ -28,6 +29,7 @@ namespace GauXC::C {
2829
* @brief GauXC C API RuntimeEnvironment handle.
2930
*/
3031
typedef struct GauXCRuntimeEnvironment {
32+
GauXCHeader hdr; ///< Header for internal use.
3133
void* ptr; ///< Pointer to the RuntimeEnvironment instance.
3234
#ifdef GAUXC_HAS_DEVICE
3335
void* device_ptr; ///< Pointer to the DeviceRuntimeEnvironment instance (if applicable).

src/c_runtime_environment.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ GauXCRuntimeEnvironment gauxc_runtime_environment_new(
2828

2929
try {
3030
env.ptr = new RuntimeEnvironment(GAUXC_MPI_CODE(comm));
31+
env.hdr = GauXCHeader{GauXC_Type_RuntimeEnvironment};
3132
status->code = 0;
3233
} catch (...) {
3334
status->code = 1;
@@ -65,6 +66,7 @@ GauXCRuntimeEnvironment gauxc_device_runtime_environment_new(
6566
double fill_fraction
6667
) {
6768
GauXCRuntimeEnvironment env{};
69+
env.hdr = GauXCHeader{GauXC_Type_RuntimeEnvironment};
6870
env.ptr = nullptr;
6971
env.device_ptr = nullptr;
7072

@@ -86,6 +88,7 @@ GauXCRuntimeEnvironment gauxc_device_runtime_environment_new_mem(
8688
size_t mem_sz
8789
) {
8890
GauXCRuntimeEnvironment env{};
91+
env.hdr = GauXCHeader{GauXC_Type_RuntimeEnvironment};
8992
env.ptr = nullptr;
9093
env.device_ptr = nullptr;
9194

0 commit comments

Comments
 (0)