The generated fortran header is now consistent with fortran conventions. Also cleaned up the C version of the header.

This commit is contained in:
jpekkila
2020-06-29 01:06:30 +03:00
parent d0ca1f8195
commit 6cab3586cf
3 changed files with 65 additions and 46 deletions

View File

@@ -4,38 +4,46 @@
#include "astaroth_utils.h"
#include "errchk.h"
/**
* Utils
*/
void
acupdatebuiltinparams_(AcMeshInfo* info)
{
acUpdateBuiltinParams(info);
}
void
acgetdevicecount_(int* count)
{
ERRCHK_CUDA_ALWAYS(cudaGetDeviceCount(count));
}
/**
* Device
*/
void
acdevicecreate_(const int* id, const AcMeshInfo* info, Device* handle)
{
// TODO errorcheck
acDeviceCreate(*id, *info, handle);
}
void
acdevicedestroy_(Device* device)
{
// TODO errorcheck
acDeviceDestroy(*device);
}
void
acdeviceprintinfo_(const Device* device)
{
// TODO errorcheck
acDevicePrintInfo(*device);
}
void
acupdatebuiltinparams_(AcMeshInfo* info)
acdeviceloadmeshinfo_(const Device* device, const AcMeshInfo* info)
{
// TODO errorcheck
acUpdateBuiltinParams(info);
}
void
acdeviceswapbuffers_(const Device* device)
{
acDeviceSwapBuffers(*device);
acDeviceLoadMeshInfo(*device, *info);
}
void
@@ -81,10 +89,15 @@ void
acdeviceperiodicboundconds_(const Device* device, const Stream* stream, const int3* start,
const int3* end)
{
acDevicePeriodicBoundconds(*device, *stream, *start, *end);
}
void
acdeviceswapbuffers_(const Device* device)
{
acDeviceSwapBuffers(*device);
}
void
acdevicereducescal_(const Device* device, const Stream* stream, const ReductionType* rtype,
const VertexBufferHandle* vtxbuf_handle, AcReal* result)
@@ -105,15 +118,3 @@ acdevicesynchronizestream_(const Device* device, const Stream* stream)
{
acDeviceSynchronizeStream(*device, *stream);
}
void
acdeviceloadmeshinfo_(const Device* device, const AcMeshInfo* info)
{
acDeviceLoadMeshInfo(*device, *info);
}
void
acgetdevicecount_(int* count)
{
ERRCHK_CUDA_ALWAYS(cudaGetDeviceCount(count));
}

View File

@@ -0,0 +1,50 @@
#pragma once
#include "astaroth.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* Utils
*/
void acupdatebuiltinparams_(AcMeshInfo* info);
void acgetdevicecount_(int* count);
/**
* Device
*/
void acdevicecreate_(const int* id, const AcMeshInfo* info, Device* handle);
void acdevicedestroy_(Device* device);
void acdeviceprintinfo_(const Device* device);
void acdeviceloadmeshinfo_(const Device* device, const AcMeshInfo* info);
void acdeviceloadmesh_(const Device* device, const Stream* stream, const AcMeshInfo* info,
const int* num_farrays, AcReal* farray);
void acdevicestoremesh_(const Device* device, const Stream* stream, const AcMeshInfo* info,
const int* num_farrays, AcReal* farray);
void acdeviceintegratesubstep_(const Device* device, const Stream* stream, const int* step_number,
const int3* start, const int3* end, const AcReal* dt);
void acdeviceperiodicboundconds_(const Device* device, const Stream* stream, const int3* start,
const int3* end);
void acdeviceswapbuffers_(const Device* device);
void acdevicereducescal_(const Device* device, const Stream* stream, const ReductionType* rtype,
const VertexBufferHandle* vtxbuf_handle, AcReal* result);
void acdevicereducevec_(const Device* device, const Stream* stream, const ReductionType* rtype,
const VertexBufferHandle* vtxbuf0, const VertexBufferHandle* vtxbuf1,
const VertexBufferHandle* vtxbuf2, AcReal* result);
void acdevicesynchronizestream_(const Device* device, const Stream* stream);
#ifdef __cplusplus
} // extern "C"
#endif