Skip to content

Commit

Permalink
Merge pull request CEED#1638 from CEED/jeremy/min-qf-size
Browse files Browse the repository at this point in the history
gpu - minimum input/output array size of 1
  • Loading branch information
jeremylt authored Jul 16, 2024
2 parents a8d16bd + 9b443e3 commit 80859cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backends/cuda-ref/ceed-cuda-ref-qfunction-load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern "C" int CeedQFunctionBuildKernel_Cuda_ref(CeedQFunction qf) {
code << " const CeedInt size_input_" << i << " = " << size << ";\n";
code << " CeedScalar input_" << i << "[size_input_" << i << "];\n";
}
code << " const CeedScalar* inputs[" << num_input_fields << "];\n";
code << " const CeedScalar *inputs[" << CeedIntMax(num_input_fields, 1) << "];\n";
for (CeedInt i = 0; i < num_input_fields; i++) {
code << " inputs[" << i << "] = input_" << i << ";\n";
}
Expand All @@ -82,7 +82,7 @@ extern "C" int CeedQFunctionBuildKernel_Cuda_ref(CeedQFunction qf) {
code << " const CeedInt size_output_" << i << " = " << size << ";\n";
code << " CeedScalar output_" << i << "[size_output_" << i << "];\n";
}
code << " CeedScalar* outputs[" << num_output_fields << "];\n";
code << " CeedScalar *outputs[" << CeedIntMax(num_output_fields, 1) << "];\n";
for (CeedInt i = 0; i < num_output_fields; i++) {
code << " outputs[" << i << "] = output_" << i << ";\n";
}
Expand Down
4 changes: 2 additions & 2 deletions backends/hip-ref/ceed-hip-ref-qfunction-load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern "C" int CeedQFunctionBuildKernel_Hip_ref(CeedQFunction qf) {
code << " const CeedInt size_input_" << i << " = " << size << ";\n";
code << " CeedScalar input_" << i << "[size_input_" << i << "];\n";
}
code << " const CeedScalar* inputs[" << num_input_fields << "];\n";
code << " const CeedScalar *inputs[" << CeedIntMax(num_input_fields, 1) << "];\n";
for (CeedInt i = 0; i < num_input_fields; i++) {
code << " inputs[" << i << "] = input_" << i << ";\n";
}
Expand All @@ -82,7 +82,7 @@ extern "C" int CeedQFunctionBuildKernel_Hip_ref(CeedQFunction qf) {
code << " const CeedInt size_output_" << i << " = " << size << ";\n";
code << " CeedScalar output_" << i << "[size_output_" << i << "];\n";
}
code << " CeedScalar* outputs[" << num_output_fields << "];\n";
code << " CeedScalar *outputs[" << CeedIntMax(num_output_fields, 1) << "];\n";
for (CeedInt i = 0; i < num_output_fields; i++) {
code << " outputs[" << i << "] = output_" << i << ";\n";
}
Expand Down
4 changes: 2 additions & 2 deletions backends/sycl-ref/ceed-sycl-ref-qfunction-load.sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extern "C" int CeedQFunctionBuildKernel_Sycl(CeedQFunction qf) {
for (CeedInt i = 0; i < num_input_fields; ++i) {
code << " CeedScalar U_" << i << "[" << input_sizes[i] << "];\n";
}
code << " const CeedScalar *inputs[" << num_input_fields << "] = {U_0";
code << " const CeedScalar *inputs[" << CeedIntMax(num_input_fields, 1) << "] = {U_0";
for (CeedInt i = 1; i < num_input_fields; i++) {
code << ", U_" << i << "\n";
}
Expand All @@ -129,7 +129,7 @@ extern "C" int CeedQFunctionBuildKernel_Sycl(CeedQFunction qf) {
for (CeedInt i = 0; i < num_output_fields; i++) {
code << " CeedScalar V_" << i << "[" << output_sizes[i] << "];\n";
}
code << " CeedScalar *outputs[" << num_output_fields << "] = {V_0";
code << " CeedScalar *outputs[" << CeedIntMax(num_output_fields, 1) << "] = {V_0";
for (CeedInt i = 1; i < num_output_fields; i++) {
code << ", V_" << i << "\n";
}
Expand Down

0 comments on commit 80859cf

Please sign in to comment.