Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for different data types in arrays, also on GPU #324

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CarpetX: add const in cast for output
  • Loading branch information
rhaas80 committed Jan 1, 2025
commit 6b7d888f0809579f7379ea1a4eb02cce184f7e8e
12 changes: 6 additions & 6 deletions CarpetX/src/io_tsv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ void WriteTSVScalars(const cGH *restrict cctkGH, const std::string &filename,
for (int vi = 0; vi < arraygroupdata.numvars; ++vi)
switch (cgroup.vartype) {
case CCTK_VARIABLE_REAL:
file << sep << *(CCTK_REAL *)arraygroupdata.data.at(tl).data_at(vi);
file << sep << *(const CCTK_REAL *)arraygroupdata.data.at(tl).data_at(vi);
break;
case CCTK_VARIABLE_INT:
file << sep << *(CCTK_INT *)arraygroupdata.data.at(tl).data_at(vi);
file << sep << *(const CCTK_INT *)arraygroupdata.data.at(tl).data_at(vi);
break;
case CCTK_VARIABLE_COMPLEX: {
CCTK_COMPLEX value =
*(CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(vi);
*(const CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(vi);
file << sep << value.real() << sep << value.imag();
} break;
default:
Expand Down Expand Up @@ -247,17 +247,17 @@ void WriteTSVArrays(const cGH *restrict cctkGH, const std::string &filename,
switch (cgroup.vartype) {
case CCTK_VARIABLE_REAL:
file << sep
<< *(CCTK_REAL *)arraygroupdata.data.at(tl).data_at(
<< *(const CCTK_REAL *)arraygroupdata.data.at(tl).data_at(
np * vi + DI[out_dir] * i);
break;
case CCTK_VARIABLE_INT:
file << sep
<< *(CCTK_INT *)arraygroupdata.data.at(tl).data_at(
<< *(const CCTK_INT *)arraygroupdata.data.at(tl).data_at(
np * vi + DI[out_dir] * i);
break;
case CCTK_VARIABLE_COMPLEX: {
CCTK_COMPLEX value =
*(CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(
*(const CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(
np * vi + DI[out_dir] * i);
file << sep << value.real() << sep << value.imag();
} break;
Expand Down