Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 13 additions & 8 deletions examples/fluids/navierstokes.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,28 @@ int main(int argc, char **argv) {
break;
case CEED_MEM_DEVICE: {
const char *resolved;

PetscCallCeed(ceed, CeedGetResource(ceed, &resolved));
if (strstr(resolved, "/gpu/cuda"))
if (strstr(resolved, "/gpu/cuda")) {
vec_type = VECCUDA;
else if (strstr(resolved, "/gpu/hip"))
vec_type = VECKOKKOS;
else if (strstr(resolved, "/gpu/sycl"))
} else if (strstr(resolved, "/gpu/hip")) {
vec_type = VECHIP;
} else if (strstr(resolved, "/gpu/sycl")) {
vec_type = VECKOKKOS;
else
} else {
vec_type = VECSTANDARD;
}
}
}
if (strstr(vec_type, VECCUDA))
if (strstr(vec_type, VECCUDA)) {
mat_type = MATAIJCUSPARSE;
else if (strstr(vec_type, VECKOKKOS))
} else if (strstr(vec_type, VECHIP)) {
mat_type = MATAIJHIPSPARSE;
} else if (strstr(vec_type, VECKOKKOS)) {
mat_type = MATAIJKOKKOS;
else
} else {
mat_type = MATAIJ;
}
PetscCall(CreateDM(comm, problem, mat_type, vec_type, &dm));
user->dm = dm;
PetscCall(DMSetApplicationContext(dm, user));
Expand Down
9 changes: 6 additions & 3 deletions examples/fluids/src/mat-ceed.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,15 @@ PetscErrorCode MatCreateCeed(DM dm_x, DM dm_y, CeedOperator op_mult, CeedOperato
MatType coo_mat_type;

PetscCall(VecGetType(ctx->X_loc, &vec_type));
if (strstr(vec_type, VECCUDA))
if (strstr(vec_type, VECCUDA)) {
coo_mat_type = MATAIJCUSPARSE;
else if (strstr(vec_type, VECKOKKOS))
} else if (strstr(vec_type, VECHIP)) {
coo_mat_type = MATAIJHIPSPARSE;
} else if (strstr(vec_type, VECKOKKOS)) {
coo_mat_type = MATAIJKOKKOS;
else
} else {
coo_mat_type = MATAIJ;
}
PetscCall(PetscStrallocpy(coo_mat_type, &ctx->coo_mat_type));
}
// -- Set mat operations
Expand Down
Loading