Skip to content

Commit

Permalink
Attempting to resolve NVRTC and HIPRTC compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiangrimberg committed Jul 26, 2023
1 parent 39c9572 commit 52aff1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/ceed/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ typedef ptrdiff_t CeedSize;

/// Integer type, for small integers
/// @ingroup Ceed
typedef int8_t CeedInt8;
typedef signed char CeedInt8;
#define CeedInt8_FMT "d"

/// Scalar (floating point) types
Expand Down
19 changes: 13 additions & 6 deletions interface/ceed-elemrestriction.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,16 @@ int CeedElemRestrictionReference(CeedElemRestriction rstr) {
@ref Backend
**/
int CeedElemRestrictionGetFlopsEstimate(CeedElemRestriction rstr, CeedTransposeMode t_mode, CeedSize *flops) {
CeedInt e_size = rstr->num_blk * rstr->blk_size * rstr->elem_size * rstr->num_comp, scale = 0;
CeedRestrictionType rstr_type;
CeedCall(CeedElemRestrictionGetType(rstr, &rstr_type));
const bool *orients = NULL;
const CeedInt8 *curl_orients = NULL;
CeedInt e_size = rstr->num_blk * rstr->blk_size * rstr->elem_size * rstr->num_comp, scale = 0;

CeedCall(CeedElemRestrictionGetOrientations(rstr, CEED_MEM_HOST, &orients));
CeedCall(CeedElemRestrictionGetCurlOrientations(rstr, CEED_MEM_HOST, &curl_orients));
if (rstr_type == CEED_RESTRICTION_ORIENTED) {
CeedCall(CeedElemRestrictionGetOrientations(rstr, CEED_MEM_HOST, &orients));
} else if (rstr_type == CEED_RESTRICTION_CURL_ORIENTED) {
CeedCall(CeedElemRestrictionGetCurlOrientations(rstr, CEED_MEM_HOST, &curl_orients));
}
if (t_mode == CEED_TRANSPOSE) {
if (!orients && !curl_orients) {
scale = 1;
Expand All @@ -389,8 +393,11 @@ int CeedElemRestrictionGetFlopsEstimate(CeedElemRestriction rstr, CeedTransposeM
scale = 5;
}
}
CeedCall(CeedElemRestrictionRestoreOrientations(rstr, &orients));
CeedCall(CeedElemRestrictionRestoreCurlOrientations(rstr, &curl_orients));
if (rstr_type == CEED_RESTRICTION_ORIENTED) {
CeedCall(CeedElemRestrictionRestoreOrientations(rstr, &orients));
} else if (rstr_type == CEED_RESTRICTION_CURL_ORIENTED) {
CeedCall(CeedElemRestrictionRestoreCurlOrientations(rstr, &curl_orients));
}
*flops = e_size * scale;

return CEED_ERROR_SUCCESS;
Expand Down

0 comments on commit 52aff1d

Please sign in to comment.