working metadata reading

This commit is contained in:
Robin
2024-12-23 23:42:51 +01:00
parent 7b3c87c656
commit 109566d7b6
6 changed files with 186 additions and 64 deletions

View File

@@ -54,22 +54,27 @@ int main() {
auto dataHandle = buffer.getDataHandle(0);
// std::cout << "got a data handle\n";
std::cout << "got a data handle\n";
auto x = buffer.getAxis<int>(0, "time");
std::cout << "size of x=" << x.first << "\n";
std::cout << "x[1]= " <<x.second[1] << "\n";
// GPUBufferHandler buffer{path, variable};
// auto fd = buffer.nextFieldData();
// float *ptr_mean;
// cudaMallocManaged(&ptr_mean, sizeof(float));
float *ptr_mean;
cudaMallocManaged(&ptr_mean, sizeof(float));
// computeMean<<<1, 1>>>(ptr_mean, dataHandle);
computeMean<<<1, 1>>>(ptr_mean, dataHandle);
// cudaDeviceSynchronize();
cudaDeviceSynchronize();
// std::cout << "Mean = " << std::fixed << std::setprecision(6) << *ptr_mean << "\n";
std::cout << "Mean = " << std::fixed << std::setprecision(6) << *ptr_mean << "\n";
// // cudaFree(fd.valArrays[0]);
// cudaFree(ptr_mean);
// cudaFree(fd.valArrays[0]);
cudaFree(ptr_mean);
return 0;
}