Skip to content

Commit

Permalink
Merge pull request #1249 from CEED/jeremy/memcheck-isnan
Browse files Browse the repository at this point in the history
Memcheck - warn or error on NaN after write-only access
  • Loading branch information
jedbrown authored Jul 8, 2023
2 parents b3d4ed2 + 1f97d2f commit 63ca180
Show file tree
Hide file tree
Showing 29 changed files with 166 additions and 84 deletions.
8 changes: 4 additions & 4 deletions backends/cuda-gen/ceed-cuda-gen-operator-build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ extern "C" int CeedOperatorBuildKernel_Cuda_gen(CeedOperator op) {
if ((prop.major < 6) && (CEED_SCALAR_TYPE != CEED_SCALAR_FP32)) {
char *atomic_add_path, *atomic_add_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-atomic-add-fallback.h", &atomic_add_path));
CeedDebug256(ceed, 2, "----- Loading Atomic Add Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Atomic Add Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, atomic_add_path, &atomic_add_source));
code << atomic_add_source;
CeedCallBackend(CeedFree(&atomic_add_path));
Expand All @@ -88,7 +88,7 @@ extern "C" int CeedOperatorBuildKernel_Cuda_gen(CeedOperator op) {
{
char *tensor_basis_kernel_path, *tensor_basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-shared-basis-tensor-templates.h", &tensor_basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Tensor Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Tensor Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, tensor_basis_kernel_path, &tensor_basis_kernel_source));
code << tensor_basis_kernel_source;
CeedCallBackend(CeedFree(&tensor_basis_kernel_path));
Expand All @@ -97,7 +97,7 @@ extern "C" int CeedOperatorBuildKernel_Cuda_gen(CeedOperator op) {
{
char *cuda_gen_template_path, *cuda_gen_template_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-gen-templates.h", &cuda_gen_template_path));
CeedDebug256(ceed, 2, "----- Loading Cuda-Gen Template Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Cuda-Gen Template Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, cuda_gen_template_path, &cuda_gen_template_source));
code << cuda_gen_template_source;
CeedCallBackend(CeedFree(&cuda_gen_template_path));
Expand Down Expand Up @@ -679,7 +679,7 @@ extern "C" int CeedOperatorBuildKernel_Cuda_gen(CeedOperator op) {
code << "// -----------------------------------------------------------------------------\n\n";

// View kernel for debugging
CeedDebug256(ceed, 2, "Generated Operator Kernels:\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "Generated Operator Kernels:\n");
CeedDebug(ceed, code.str().c_str());

CeedCallBackend(CeedCompile_Cuda(ceed, code.str().c_str(), &data->module, 1, "T_1D", CeedIntMax(Q_1d, data->max_P_1d)));
Expand Down
4 changes: 2 additions & 2 deletions backends/cuda-gen/ceed-cuda-gen-qfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ int CeedQFunctionCreate_Cuda_gen(CeedQFunction qf) {

// Read QFunction source
CeedCallBackend(CeedQFunctionGetKernelName(qf, &data->q_function_name));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction User Source -----\n");
CeedCallBackend(CeedQFunctionLoadSourceToBuffer(qf, &data->q_function_source));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction User Source Complete! -----\n");
CeedCheck(data->q_function_source, ceed, CEED_ERROR_UNSUPPORTED, "/gpu/cuda/gen backend requires QFunction source code file");

CeedCallBackend(CeedSetBackendFunction(ceed, "QFunction", qf, "Apply", CeedQFunctionApply_Cuda_gen));
Expand Down
8 changes: 4 additions & 4 deletions backends/cuda-ref/ceed-cuda-ref-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ int CeedBasisCreateTensorH1_Cuda(CeedInt dim, CeedInt P_1d, CeedInt Q_1d, const
CeedCallBackend(CeedBasisGetNumComponents(basis, &num_comp));
char *basis_kernel_path, *basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-ref-basis-tensor.h", &basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, basis_kernel_path, &basis_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source Complete! -----\n");
CeedCallBackend(CeedCompile_Cuda(ceed, basis_kernel_source, &data->module, 7, "BASIS_Q_1D", Q_1d, "BASIS_P_1D", P_1d, "BASIS_BUF_LEN",
num_comp * CeedIntPow(Q_1d > P_1d ? Q_1d : P_1d, dim), "BASIS_DIM", dim, "BASIS_NUM_COMP", num_comp,
"BASIS_NUM_NODES", CeedIntPow(P_1d, dim), "BASIS_NUM_QPTS", CeedIntPow(Q_1d, dim)));
Expand Down Expand Up @@ -275,9 +275,9 @@ int CeedBasisCreateH1_Cuda(CeedElemTopology topo, CeedInt dim, CeedInt num_nodes
CeedCallBackend(CeedBasisGetNumComponents(basis, &num_comp));
char *basis_kernel_path, *basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-ref-basis-nontensor.h", &basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, basis_kernel_path, &basis_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source Complete! -----\n");
CeedCallCuda(ceed, CeedCompile_Cuda(ceed, basis_kernel_source, &data->module, 4, "BASIS_Q", num_qpts, "BASIS_P", num_nodes, "BASIS_DIM", dim,
"BASIS_NUM_COMP", num_comp));
CeedCallCuda(ceed, CeedGetKernel_Cuda(ceed, data->module, "Interp", &data->Interp));
Expand Down
8 changes: 4 additions & 4 deletions backends/cuda-ref/ceed-cuda-ref-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ static inline int CeedOperatorAssembleDiagonalSetup_Cuda(CeedOperator op, const
// Assemble kernel
char *diagonal_kernel_path, *diagonal_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-ref-operator-assemble-diagonal.h", &diagonal_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Diagonal Assembly Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Diagonal Assembly Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, diagonal_kernel_path, &diagonal_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Diagonal Assembly Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Diagonal Assembly Source Complete! -----\n");
CeedInt nnodes, nqpts;
CeedCallBackend(CeedBasisGetNumNodes(basisin, &nnodes));
CeedCallBackend(CeedBasisGetNumQuadraturePoints(basisin, &nqpts));
Expand Down Expand Up @@ -978,9 +978,9 @@ static int CeedSingleOperatorAssembleSetup_Cuda(CeedOperator op, CeedInt use_cee
CeedCallBackend(CeedGetData(ceed, &cuda_data));
char *assembly_kernel_path, *assembly_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-ref-operator-assemble.h", &assembly_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Assembly Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Assembly Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, assembly_kernel_path, &assembly_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Assembly Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Assembly Source Complete! -----\n");
bool fallback = block_size > cuda_data->device_prop.maxThreadsPerBlock;
if (fallback) {
// Use fallback kernel with 1D threadblock
Expand Down
6 changes: 3 additions & 3 deletions backends/cuda-ref/ceed-cuda-ref-qfunction-load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ extern "C" int CeedQFunctionBuildKernel_Cuda_ref(CeedQFunction qf) {
// Build strings for final kernel
char *read_write_kernel_path, *read_write_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-ref-qfunction.h", &read_write_kernel_path));
CeedDebug256(ceed, 2, "----- Loading QFunction Read/Write Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction Read/Write Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, read_write_kernel_path, &read_write_kernel_source));
CeedDebug256(ceed, 2, "----- Loading QFunction Read/Write Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction Read/Write Kernel Source Complete! -----\n");
string qfunction_source(data->qfunction_source);
string qfunction_name(data->qfunction_name);
string read_write(read_write_kernel_source);
Expand Down Expand Up @@ -105,7 +105,7 @@ extern "C" int CeedQFunctionBuildKernel_Cuda_ref(CeedQFunction qf) {
code << "}\n";

// View kernel for debugging
CeedDebug256(ceed, 2, "Generated QFunction Kernels:\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "Generated QFunction Kernels:\n");
CeedDebug(ceed, code.str().c_str());

// Compile kernel
Expand Down
4 changes: 2 additions & 2 deletions backends/cuda-ref/ceed-cuda-ref-qfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ int CeedQFunctionCreate_Cuda(CeedQFunction qf) {

// Read QFunction source
CeedCallBackend(CeedQFunctionGetKernelName(qf, &data->qfunction_name));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction User Source -----\n");
CeedCallBackend(CeedQFunctionLoadSourceToBuffer(qf, &data->qfunction_source));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction User Source Complete! -----\n");

// Register backend functions
CeedCallBackend(CeedSetBackendFunction(ceed, "QFunction", qf, "Apply", CeedQFunctionApply_Cuda));
Expand Down
4 changes: 2 additions & 2 deletions backends/cuda-ref/ceed-cuda-ref-restriction.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ int CeedElemRestrictionCreate_Cuda(CeedMemType mem_type, CeedCopyMode copy_mode,
CeedInt num_nodes = impl->num_nodes;
char *restriction_kernel_path, *restriction_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-ref-restriction.h", &restriction_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Restriction Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Restriction Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, restriction_kernel_path, &restriction_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Restriction Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Restriction Kernel Source Complete! -----\n");
CeedCallBackend(CeedCompile_Cuda(ceed, restriction_kernel_source, &impl->module, 8, "RESTR_ELEM_SIZE", elem_size, "RESTR_NUM_ELEM", num_elem,
"RESTR_NUM_COMP", num_comp, "RESTR_NUM_NODES", num_nodes, "RESTR_COMP_STRIDE", comp_stride, "RESTR_STRIDE_NODES",
strides[0], "RESTR_STRIDE_COMP", strides[1], "RESTR_STRIDE_ELEM", strides[2]));
Expand Down
4 changes: 2 additions & 2 deletions backends/cuda-shared/ceed-cuda-shared-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ int CeedBasisCreateTensorH1_Cuda_shared(CeedInt dim, CeedInt P_1d, CeedInt Q_1d,
CeedCallBackend(CeedBasisGetNumComponents(basis, &num_comp));
char *basis_kernel_path, *basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/cuda/cuda-shared-basis-tensor.h", &basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, basis_kernel_path, &basis_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source Complete -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source Complete -----\n");
CeedCallBackend(CeedCompile_Cuda(ceed, basis_kernel_source, &data->module, 8, "BASIS_Q_1D", Q_1d, "BASIS_P_1D", P_1d, "T_1D",
CeedIntMax(Q_1d, P_1d), "BASIS_DIM", dim, "BASIS_NUM_COMP", num_comp, "BASIS_NUM_NODES", CeedIntPow(P_1d, dim),
"BASIS_NUM_QPTS", CeedIntPow(Q_1d, dim), "BASIS_HAS_COLLOCATED_GRAD", has_collocated_grad));
Expand Down
6 changes: 3 additions & 3 deletions backends/hip-gen/ceed-hip-gen-operator-build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ extern "C" int CeedOperatorBuildKernel_Hip_gen(CeedOperator op) {
{
char *tensor_basis_kernel_path, *tensor_basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-shared-basis-tensor-templates.h", &tensor_basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Tensor Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Tensor Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, tensor_basis_kernel_path, &tensor_basis_kernel_source));
code << tensor_basis_kernel_source;
CeedCallBackend(CeedFree(&tensor_basis_kernel_path));
Expand All @@ -101,7 +101,7 @@ extern "C" int CeedOperatorBuildKernel_Hip_gen(CeedOperator op) {
{
char *hip_gen_template_path, *hip_gen_template_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-gen-templates.h", &hip_gen_template_path));
CeedDebug256(ceed, 2, "----- Loading Hip-Gen Template Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Hip-Gen Template Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, hip_gen_template_path, &hip_gen_template_source));
code << hip_gen_template_source;
CeedCallBackend(CeedFree(&hip_gen_template_path));
Expand Down Expand Up @@ -676,7 +676,7 @@ extern "C" int CeedOperatorBuildKernel_Hip_gen(CeedOperator op) {
code << "// -----------------------------------------------------------------------------\n\n";

// View kernel for debugging
CeedDebug256(ceed, 2, "Generated Operator Kernels:\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "Generated Operator Kernels:\n");
CeedDebug(ceed, code.str().c_str());

CeedInt block_sizes[3] = {0, 0, 0};
Expand Down
4 changes: 2 additions & 2 deletions backends/hip-gen/ceed-hip-gen-qfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ int CeedQFunctionCreate_Hip_gen(CeedQFunction qf) {

// Read QFunction source
CeedCallBackend(CeedQFunctionGetKernelName(qf, &data->q_function_name));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction User Source -----\n");
CeedCallBackend(CeedQFunctionLoadSourceToBuffer(qf, &data->q_function_source));
CeedDebug256(ceed, 2, "----- Loading QFunction User Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction User Source Complete! -----\n");
CeedCheck(data->q_function_source, ceed, CEED_ERROR_UNSUPPORTED, "/gpu/hip/gen backend requires QFunction source code file");

CeedCallBackend(CeedSetBackendFunction(ceed, "QFunction", qf, "Apply", CeedQFunctionApply_Hip_gen));
Expand Down
8 changes: 4 additions & 4 deletions backends/hip-ref/ceed-hip-ref-basis.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ int CeedBasisCreateTensorH1_Hip(CeedInt dim, CeedInt P_1d, CeedInt Q_1d, const C
CeedCallBackend(CeedBasisGetNumComponents(basis, &ncomp));
char *basis_kernel_path, *basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-ref-basis-tensor.h", &basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, basis_kernel_path, &basis_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source Complete! -----\n");
CeedCallBackend(CeedCompile_Hip(ceed, basis_kernel_source, &data->module, 7, "BASIS_Q_1D", Q_1d, "BASIS_P_1D", P_1d, "BASIS_BUF_LEN",
ncomp * CeedIntPow(Q_1d > P_1d ? Q_1d : P_1d, dim), "BASIS_DIM", dim, "BASIS_NUM_COMP", ncomp, "BASIS_NUM_NODES",
CeedIntPow(P_1d, dim), "BASIS_NUM_QPTS", CeedIntPow(Q_1d, dim)));
Expand Down Expand Up @@ -271,9 +271,9 @@ int CeedBasisCreateH1_Hip(CeedElemTopology topo, CeedInt dim, CeedInt num_nodes,
CeedCallBackend(CeedBasisGetNumComponents(basis, &ncomp));
char *basis_kernel_path, *basis_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-ref-basis-nontensor.h", &basis_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, basis_kernel_path, &basis_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Basis Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Basis Kernel Source Complete! -----\n");
CeedCallBackend(CeedCompile_Hip(ceed, basis_kernel_source, &data->module, 4, "BASIS_Q", num_qpts, "BASIS_P", num_nodes, "BASIS_DIM", dim,
"BASIS_NUM_COMP", ncomp));
CeedCallBackend(CeedGetKernel_Hip(ceed, data->module, "Interp", &data->Interp));
Expand Down
8 changes: 4 additions & 4 deletions backends/hip-ref/ceed-hip-ref-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ static inline int CeedOperatorAssembleDiagonalSetup_Hip(CeedOperator op, const b

char *diagonal_kernel_path, *diagonal_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-ref-operator-assemble-diagonal.h", &diagonal_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Diagonal Assembly Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Diagonal Assembly Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, diagonal_kernel_path, &diagonal_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Diagonal Assembly Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Diagonal Assembly Source Complete! -----\n");
CeedInt nnodes, nqpts;
CeedCallBackend(CeedBasisGetNumNodes(basisin, &nnodes));
CeedCallBackend(CeedBasisGetNumQuadraturePoints(basisin, &nqpts));
Expand Down Expand Up @@ -976,9 +976,9 @@ static int CeedSingleOperatorAssembleSetup_Hip(CeedOperator op, CeedInt use_ceed
CeedInt block_size = esize * esize * elemsPerBlock;
char *assembly_kernel_path, *assembly_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-ref-operator-assemble.h", &assembly_kernel_path));
CeedDebug256(ceed, 2, "----- Loading Assembly Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Assembly Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, assembly_kernel_path, &assembly_kernel_source));
CeedDebug256(ceed, 2, "----- Loading Assembly Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading Assembly Source Complete! -----\n");
bool fallback = block_size > 1024;
if (fallback) { // Use fallback kernel with 1D threadblock
block_size = esize * elemsPerBlock;
Expand Down
6 changes: 3 additions & 3 deletions backends/hip-ref/ceed-hip-ref-qfunction-load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ extern "C" int CeedQFunctionBuildKernel_Hip_ref(CeedQFunction qf) {
// Build strings for final kernel
char *read_write_kernel_path, *read_write_kernel_source;
CeedCallBackend(CeedGetJitAbsolutePath(ceed, "ceed/jit-source/hip/hip-ref-qfunction.h", &read_write_kernel_path));
CeedDebug256(ceed, 2, "----- Loading QFunction Read/Write Kernel Source -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction Read/Write Kernel Source -----\n");
CeedCallBackend(CeedLoadSourceToBuffer(ceed, read_write_kernel_path, &read_write_kernel_source));
CeedDebug256(ceed, 2, "----- Loading QFunction Read/Write Kernel Source Complete! -----\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "----- Loading QFunction Read/Write Kernel Source Complete! -----\n");
string qfunction_source(data->qfunction_source);
string qfunction_name(data->qfunction_name);
string read_write(read_write_kernel_source);
Expand Down Expand Up @@ -109,7 +109,7 @@ extern "C" int CeedQFunctionBuildKernel_Hip_ref(CeedQFunction qf) {
code << "}\n";

// View kernel for debugging
CeedDebug256(ceed, 2, "Generated QFunction Kernels:\n");
CeedDebug256(ceed, CEED_DEBUG_COLOR_SUCCESS, "Generated QFunction Kernels:\n");
CeedDebug(ceed, code.str().c_str());

// Compile kernel
Expand Down
Loading

0 comments on commit 63ca180

Please sign in to comment.