Skip to content

Commit

Permalink
Tweaks config to enable AlignConsecutiveAssignments
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden committed Oct 11, 2024
1 parent 1f7950a commit 55064cc
Show file tree
Hide file tree
Showing 170 changed files with 1,213 additions and 1,213 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/c-example.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ int main(int argc, char* argv[])
// Mark a code region. Opens region "annotation=init" in Caliper.
CALI_MARK_BEGIN("init");
int count = 4;
double t = 0;
double t = 0;
CALI_MARK_END("init");

// Mark a loop. Opens region "loop=mainloop" in Caliper.
Expand Down
2 changes: 1 addition & 1 deletion examples/apps/cali-functional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ auto minimally_wrapped_free = cali::wrap_function("free", free);

int main(int argc, char* argv[])
{
int seven = sum(3, 4);
int seven = sum(3, 4);
int* int_pointer = (int*) wrapped_malloc(sizeof(int) * 100);
minimally_wrapped_free(int_pointer);
}
12 changes: 6 additions & 6 deletions examples/apps/cali-memtracking-macros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ void do_work(size_t M, size_t W, size_t N)
double* matC = (double*) malloc(sizeof(double) * M * N);

size_t num_dimensions = 2;
size_t A_dims[] = { M, W };
size_t B_dims[] = { W, N };
size_t C_dims[] = { M, N };
size_t A_dims[] = { M, W };
size_t B_dims[] = { W, N };
size_t C_dims[] = { M, N };

CALI_DATATRACKER_TRACK_DIMENSIONAL(matA, sizeof(double), A_dims, num_dimensions);
CALI_DATATRACKER_TRACK_DIMENSIONAL(matB, sizeof(double), B_dims, num_dimensions);
Expand Down Expand Up @@ -99,9 +99,9 @@ int main(int argc, const char* argv[])
return -1;
}

size_t m_size = std::stoul(args.get("m_size", "512"));
size_t w_size = std::stoul(args.get("w_size", "512"));
size_t n_size = std::stoul(args.get("n_size", "512"));
size_t m_size = std::stoul(args.get("m_size", "512"));
size_t w_size = std::stoul(args.get("w_size", "512"));
size_t n_size = std::stoul(args.get("n_size", "512"));
size_t num_iterations = std::stoul(args.get("iterations", "4"));

CALI_MARK_BEGIN("benchmark");
Expand Down
6 changes: 3 additions & 3 deletions examples/apps/cali-memtracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ int main(int argc, const char* argv[])
return -1;
}

size_t m_size = std::stoul(args.get("m_size", "512"));
size_t w_size = std::stoul(args.get("w_size", "512"));
size_t n_size = std::stoul(args.get("n_size", "512"));
size_t m_size = std::stoul(args.get("m_size", "512"));
size_t w_size = std::stoul(args.get("w_size", "512"));
size_t n_size = std::stoul(args.get("n_size", "512"));
size_t num_iterations = std::stoul(args.get("iterations", "4"));

cali::Annotation phase_annotation("phase", CALI_ATTR_SCOPE_PROCESS);
Expand Down
6 changes: 3 additions & 3 deletions examples/apps/cali-print-snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int print_entry(void* user_arg, cali_id_t attr_id, cali_variant_t val)
{
char buf[20];
size_t len = cali_variant_get_size(val);
len = (len < 19 ? len : 19);
len = (len < 19 ? len : 19);

strncpy(buf, (char*) cali_variant_get_data(&val), len);
buf[len] = '\0';
Expand Down Expand Up @@ -112,8 +112,8 @@ void do_work(cali_id_t channel)
int main()
{
const char* cfg[][2] = { { NULL, NULL } };
cali_configset_t cfgset = cali_create_configset(cfg);
cali_id_t channel = cali_create_channel("print-snapshot", 0, cfgset);
cali_configset_t cfgset = cali_create_configset(cfg);
cali_id_t channel = cali_create_channel("print-snapshot", 0, cfgset);
cali_delete_configset(cfgset);

CALI_MARK_FUNCTION_BEGIN;
Expand Down
6 changes: 3 additions & 3 deletions include/caliper/Annotation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Function

Function(const char* name);

Function(const Function&) = delete;
Function(const Function&) = delete;
Function& operator=(const Function&) = delete;

~Function();
Expand All @@ -42,7 +42,7 @@ class ScopeAnnotation

explicit ScopeAnnotation(const char* name);

ScopeAnnotation(const ScopeAnnotation&) = delete;
ScopeAnnotation(const ScopeAnnotation&) = delete;
ScopeAnnotation& operator=(const ScopeAnnotation&) = delete;

~ScopeAnnotation();
Expand Down Expand Up @@ -151,7 +151,7 @@ class Annotation

Guard(Annotation& a);

Guard(const Guard&) = delete;
Guard(const Guard&) = delete;
Guard& operator=(const Guard&) = delete;

~Guard();
Expand Down
16 changes: 8 additions & 8 deletions include/caliper/Caliper.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ class Channel
constexpr Channel() : mP { nullptr } {}

Channel(const Channel&) = default;
Channel(Channel&&) = default;
Channel(Channel&&) = default;

Channel& operator=(const Channel&) = default;
Channel& operator=(Channel&&) = default;
Channel& operator=(Channel&&) = default;

~Channel();

Expand Down Expand Up @@ -305,9 +305,9 @@ class Caliper : public CaliperMetadataAccessInterface
size_t elem_size,
size_t ndim,
const size_t dims[],
size_t n_extra = 0,
size_t n_extra = 0,
const Attribute* extra_attrs = nullptr,
const Variant* extra_vals = nullptr
const Variant* extra_vals = nullptr
);

/// \brief De-register a tracked memory region starting at \a ptr
Expand Down Expand Up @@ -460,9 +460,9 @@ class Caliper : public CaliperMetadataAccessInterface
size_t elem_size,
size_t ndim,
const size_t dims[],
size_t n = 0,
size_t n = 0,
const Attribute* extra_attr = nullptr,
const Variant* extra_val = nullptr
const Variant* extra_val = nullptr
);
void memory_region_end(Channel* chn, const void* ptr);

Expand Down Expand Up @@ -585,8 +585,8 @@ class Caliper : public CaliperMetadataAccessInterface
Attribute create_attribute(
const std::string& name,
cali_attr_type type,
int prop = CALI_ATTR_DEFAULT,
int meta = 0,
int prop = CALI_ATTR_DEFAULT,
int meta = 0,
const Attribute* meta_attr = nullptr,
const Variant* meta_data = nullptr
);
Expand Down
8 changes: 4 additions & 4 deletions include/caliper/SnapshotRecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SnapshotView

SnapshotView(const Entry& e) : m_data { &e }, m_len { 1 } {}

using iterator = Entry*;
using iterator = Entry*;
using const_iterator = const Entry*;

const_iterator begin() const { return m_data; }
Expand Down Expand Up @@ -83,10 +83,10 @@ class SnapshotBuilder
: m_data { data }, m_capacity { capacity }, m_len { 0 }, m_skipped { 0 }
{}

SnapshotBuilder(SnapshotBuilder&&) = default;
SnapshotBuilder(SnapshotBuilder&&) = default;
SnapshotBuilder(const SnapshotBuilder&) = delete;

SnapshotBuilder& operator=(SnapshotBuilder&&) = default;
SnapshotBuilder& operator=(SnapshotBuilder&&) = default;
SnapshotBuilder& operator=(const SnapshotBuilder&) = delete;

size_t capacity() const { return m_capacity; }
Expand Down Expand Up @@ -129,7 +129,7 @@ class FixedSizeSnapshotRecord

FixedSizeSnapshotRecord() : m_builder { N, m_data } {}

FixedSizeSnapshotRecord(const FixedSizeSnapshotRecord<N>&) = delete;
FixedSizeSnapshotRecord(const FixedSizeSnapshotRecord<N>&) = delete;
FixedSizeSnapshotRecord<N> operator=(const FixedSizeSnapshotRecord<N>&) = delete;

SnapshotBuilder& builder() { return m_builder; }
Expand Down
4 changes: 2 additions & 2 deletions include/caliper/cali_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ extern "C"

typedef enum {
CALI_SCOPE_PROCESS = 1,
CALI_SCOPE_THREAD = 2,
CALI_SCOPE_TASK = 4,
CALI_SCOPE_THREAD = 2,
CALI_SCOPE_TASK = 4,
CALI_SCOPE_CHANNEL = 8
} cali_context_scope_t;

Expand Down
6 changes: 3 additions & 3 deletions include/caliper/common/CaliperMetadataAccessInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CaliperMetadataAccessInterface

virtual Node* node(cali_id_t) const = 0;

virtual Attribute get_attribute(cali_id_t id) const = 0;
virtual Attribute get_attribute(cali_id_t id) const = 0;
virtual Attribute get_attribute(const std::string& str) const = 0;

/// \brief Return all attributes
Expand All @@ -44,8 +44,8 @@ class CaliperMetadataAccessInterface
virtual Attribute create_attribute(
const std::string& name,
cali_attr_type type,
int prop = CALI_ATTR_DEFAULT,
int meta = 0,
int prop = CALI_ATTR_DEFAULT,
int meta = 0,
const Attribute* meta_attr = nullptr,
const Variant* meta_data = nullptr
) = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/caliper/common/Entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Entry
inline bool operator==(const Entry& lhs, const Entry& rhs)
{
bool node_eq = lhs.m_node == rhs.m_node || (lhs.m_node && rhs.m_node && lhs.m_node->id() == rhs.m_node->id());
bool is_imm = lhs.is_immediate();
bool is_imm = lhs.is_immediate();

return node_eq && (!is_imm || (is_imm && lhs.m_value == rhs.m_value));
}
Expand Down
16 changes: 8 additions & 8 deletions include/caliper/common/cali_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ typedef uint64_t cali_id_t;
* \brief Data type of an attribute.
*/
typedef enum {
CALI_TYPE_INV = 0, /**< Invalid type */
CALI_TYPE_USR = 1, /**< User-defined type (pointer to binary data) */
CALI_TYPE_INT = 2, /**< 64-bit signed integer */
CALI_TYPE_UINT = 3, /**< 64-bit unsigned integer */
CALI_TYPE_INV = 0, /**< Invalid type */
CALI_TYPE_USR = 1, /**< User-defined type (pointer to binary data) */
CALI_TYPE_INT = 2, /**< 64-bit signed integer */
CALI_TYPE_UINT = 3, /**< 64-bit unsigned integer */
CALI_TYPE_STRING = 4, /**< String (\a char*) */
CALI_TYPE_ADDR = 5, /**< 64-bit address */
CALI_TYPE_ADDR = 5, /**< 64-bit address */
CALI_TYPE_DOUBLE = 6, /**< Double-precision floating point type */
CALI_TYPE_BOOL = 7, /**< C or C++ boolean */
CALI_TYPE_TYPE = 8, /**< Instance of cali_attr_type */
CALI_TYPE_PTR = 9 /**< Raw pointer. Internal use only. */
CALI_TYPE_BOOL = 7, /**< C or C++ boolean */
CALI_TYPE_TYPE = 8, /**< Instance of cali_attr_type */
CALI_TYPE_PTR = 9 /**< Raw pointer. Internal use only. */
} cali_attr_type;

#define CALI_MAXTYPE CALI_TYPE_PTR
Expand Down
22 changes: 11 additions & 11 deletions include/caliper/common/cali_variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ inline cali_variant_t cali_make_empty_variant()
{
cali_variant_t v;
v.type_and_size = 0;
v.value.v_uint = 0;
v.value.v_uint = 0;
return v;
}

Expand Down Expand Up @@ -81,39 +81,39 @@ inline cali_variant_t cali_make_variant_from_bool(bool value)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_BOOL;
v.value.v_uint = 0;
v.value.v_bool = value;
v.value.v_uint = 0;
v.value.v_bool = value;
return v;
}

inline cali_variant_t cali_make_variant_from_int(int value)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_INT;
v.value.v_int = value;
v.value.v_int = value;
return v;
}

inline cali_variant_t cali_make_variant_from_int64(int64_t value)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_INT;
v.value.v_int = value;
v.value.v_int = value;
return v;
}

inline cali_variant_t cali_make_variant_from_uint(uint64_t value)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_UINT;
v.value.v_uint = value;
v.value.v_uint = value;
return v;
}

inline cali_variant_t cali_make_variant_from_double(double value)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_DOUBLE;
v.type_and_size = CALI_TYPE_DOUBLE;
v.value.v_double = value;
return v;
}
Expand All @@ -133,7 +133,7 @@ inline cali_variant_t cali_make_variant_from_string(const char* value)

cali_variant_t v;

v.type_and_size = (size << 32) | hash | (CALI_TYPE_STRING & CALI_VARIANT_TYPE_MASK);
v.type_and_size = (size << 32) | hash | (CALI_TYPE_STRING & CALI_VARIANT_TYPE_MASK);
v.value.unmanaged_const_ptr = value;

return v;
Expand All @@ -143,15 +143,15 @@ inline cali_variant_t cali_make_variant_from_type(cali_attr_type value)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_TYPE;
v.value.v_uint = 0;
v.value.v_type = value;
v.value.v_uint = 0;
v.value.v_type = value;
return v;
}

inline cali_variant_t cali_make_variant_from_ptr(void* ptr)
{
cali_variant_t v;
v.type_and_size = CALI_TYPE_PTR;
v.type_and_size = CALI_TYPE_PTR;
v.value.unmanaged_ptr = ptr;
return v;
}
Expand Down
2 changes: 1 addition & 1 deletion include/caliper/reader/CaliperMetadataDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CaliperMetadataDB : public CaliperMetadataAccessInterface
const std::string& name,
cali_attr_type type,
int prop,
int meta = 0,
int meta = 0,
const Attribute* meta_attr = nullptr,
const Variant* meta_data = nullptr
);
Expand Down
2 changes: 1 addition & 1 deletion src/caliper/AnnotationBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void AnnotationBinding::end_cb(Caliper* c, Channel* chn, const Attribute& attr,

void AnnotationBinding::base_pre_initialize(Caliper* c, Channel* chn)
{
const char* tag = service_tag();
const char* tag = service_tag();
std::string cfgname = std::string(tag) + "_binding";

m_config = chn->config().init(cfgname.c_str(), s_configdata);
Expand Down
8 changes: 4 additions & 4 deletions src/caliper/Blackboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void Blackboard::add(cali_id_t key, const Entry& value, bool include_in_snapshot
return;
}

hashtable[I].key = key;
hashtable[I].key = key;
hashtable[I].value = value;

if (include_in_snapshots) {
Expand Down Expand Up @@ -91,12 +91,12 @@ void Blackboard::del(cali_id_t key)
size_t k = hashtable[j].key % Nmax;
if ((j > I && (k <= I || k > j)) || (j < I && (k <= I && k > j))) {
hashtable[I] = hashtable[j];
I = j;
I = j;
}
}
}

hashtable[I].key = CALI_INV_ID;
hashtable[I].key = CALI_INV_ID;
hashtable[I].value = Entry();

--num_entries;
Expand All @@ -115,7 +115,7 @@ Entry Blackboard::exchange(cali_id_t key, const Entry& value, bool include_in_sn
Entry ret;

if (hashtable[I].key == key) {
ret = hashtable[I].value;
ret = hashtable[I].value;
hashtable[I].value = value;
} else
add(key, value, include_in_snapshots);
Expand Down
Loading

0 comments on commit 55064cc

Please sign in to comment.