mirror of
https://github.com/MartinOpat/cuda-based-raytrace.git
synced 2025-06-07 02:13:10 +02:00
FieldData structs implemented
This commit is contained in:
10
src/hurricanedata/gpubufferhelper.h
Normal file
10
src/hurricanedata/gpubufferhelper.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <netcdf>
|
||||
#include <cassert>
|
||||
template <typename T>
|
||||
void readAndAllocateAxis(T** axis_ptr, size_t *size, const netCDF::NcVar &var) {
|
||||
assert(var.getDimCount() == 1);
|
||||
netCDF::NcDim dim = var.getDim(0);
|
||||
*size = dim.getSize();
|
||||
cudaError_t status = cudaMallocManaged(axis_ptr, *size*sizeof(T));
|
||||
var.getVar(*axis_ptr);
|
||||
}
|
||||
Reference in New Issue
Block a user