diff --git a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/defines.h b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/defines.h index 01117ab109..00a3ffbc43 100644 --- a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/defines.h +++ b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/defines.h @@ -22,6 +22,8 @@ #pragma once +#include + /** * @defgroup SYMBOL_VERSIONING_GROUP Symbol Versions * @@ -129,3 +131,9 @@ # define ROCPROFILER_EXTERN_C_FINI # define ROCPROFILER_CXX_CODE(...) #endif + +#if __cplusplus +# define ROCPROFILER_UINT64_C(value) uint64_t(value) +#else +# define ROCPROFILER_UINT64_C(value) UINT64_C(value) +#endif diff --git a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/fwd.h b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/fwd.h index 781d4ddded..6fa3f66132 100644 --- a/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/fwd.h +++ b/projects/rocprofiler-sdk/source/include/rocprofiler-sdk/fwd.h @@ -520,9 +520,9 @@ typedef struct } rocprofiler_correlation_id_t; /** - * @brief The NULL correlation ID value. + * @brief The NULL value of an internal correlation ID. */ -#define ROCPROFILER_CORRELATION_ID_VALUE_NONE 0ULL +#define ROCPROFILER_CORRELATION_ID_INTERNAL_NONE ROCPROFILER_UINT64_C(0) /** * @struct rocprofiler_buffer_id_t diff --git a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp index 0add87bbc9..c697bef5d3 100644 --- a/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp +++ b/projects/rocprofiler-sdk/source/lib/rocprofiler-sdk/pc_sampling/parser/correlation.hpp @@ -198,9 +198,9 @@ add_upcoming_samples(const device_handle device, samples[p].correlation_id = corr_map->get(device, trap); } catch(std::exception& e) { - samples[p].correlation_id = {.internal = ROCPROFILER_CORRELATION_ID_VALUE_NONE, + samples[p].correlation_id = {.internal = ROCPROFILER_CORRELATION_ID_INTERNAL_NONE, .external = rocprofiler_user_data_t{ - .value = ROCPROFILER_CORRELATION_ID_VALUE_NONE}}; + .value = ROCPROFILER_CORRELATION_ID_INTERNAL_NONE}}; status = PCSAMPLE_STATUS_PARSER_ERROR; } }