Skip to content

[tmva][sofie] Remove explicit function definitions that can be implicit #18379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions tmva/sofie/inc/TMVA/RModel.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ private:
std::unordered_map<std::string_view, size_t> fIntermediateTensorFrequencyLookup; ///<! lookup table for intermediate tensor frequency (transient)

public:
// Rule of five: explicitly define move semantics, disallow copy
RModel(RModel &&other) = default;
RModel &operator=(RModel &&other) = default;
RModel(const RModel &other) = delete;
RModel &operator=(const RModel &other) = delete;
~RModel() = default;

/**
Default constructor. Needed to allow serialization of ROOT objects. See
https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
Expand Down
5 changes: 0 additions & 5 deletions tmva/sofie/inc/TMVA/RModel_Base.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ enum class FunctionRelation { INVALID = 0, NODES_EDGES = 1, NODES_GLOBALS = 2, E

class RModel_GNNBase : public RModel_Base {
public:
/**
Default constructor. Needed to allow serialization of ROOT objects. See
https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
*/
RModel_GNNBase() = default;
virtual void Generate() = 0;
virtual ~RModel_GNNBase() = default;
};
Expand Down
23 changes: 0 additions & 23 deletions tmva/sofie/inc/TMVA/RModel_GNN.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ struct GNN_Init {

std::string filename;

~GNN_Init()
{
edges_update_block.reset();
nodes_update_block.reset();
globals_update_block.reset();

edge_node_agg_block.reset();
edge_global_agg_block.reset();
node_global_agg_block.reset();
}

template <typename T>
void createUpdateFunction(T &updateFunction)
{
Expand Down Expand Up @@ -116,20 +105,8 @@ private:
std::size_t num_global_features;

public:
/**
Default constructor. Needed to allow serialization of ROOT objects. See
https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
*/
RModel_GNN() = default;
RModel_GNN(GNN_Init &graph_input_struct);

// Rule of five: explicitly define move semantics, disallow copy
RModel_GNN(RModel_GNN &&other);
RModel_GNN &operator=(RModel_GNN &&other);
RModel_GNN(const RModel_GNN &other) = delete;
RModel_GNN &operator=(const RModel_GNN &other) = delete;
~RModel_GNN() final = default;

void Generate() final;
};

Expand Down
19 changes: 0 additions & 19 deletions tmva/sofie/inc/TMVA/RModel_GraphIndependent.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ struct GraphIndependent_Init {
}
}
}

~GraphIndependent_Init()
{
edges_update_block.reset();
nodes_update_block.reset();
globals_update_block.reset();
}
};

class RModel_GraphIndependent final : public RModel_GNNBase {
Expand All @@ -80,20 +73,8 @@ private:
std::size_t num_global_features;

public:
/**
Default constructor. Needed to allow serialization of ROOT objects. See
https://root.cern/manual/io_custom_classes/#restrictions-on-types-root-io-can-handle
*/
RModel_GraphIndependent() = default;
RModel_GraphIndependent(GraphIndependent_Init &graph_input_struct);

// Rule of five: explicitly define move semantics, disallow copy
RModel_GraphIndependent(RModel_GraphIndependent &&other);
RModel_GraphIndependent &operator=(RModel_GraphIndependent &&other);
RModel_GraphIndependent(const RModel_GraphIndependent &other) = delete;
RModel_GraphIndependent &operator=(const RModel_GraphIndependent &other) = delete;
~RModel_GraphIndependent() final = default;

void Generate() final;
};

Expand Down
2 changes: 0 additions & 2 deletions tmva/sofie/inc/TMVA/SOFIE_common.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace TMVA{
namespace Experimental{
namespace SOFIE{

//typedef RTensor tensor_t;

enum class ETensorType{
UNDEFINED = 0, FLOAT = 1, UINT8 = 2, INT8 = 3, UINT16 = 4, INT16 = 5, INT32 = 6, INT64 = 7, STRING = 8, BOOL = 9, //order sensitive
FLOAT16 = 10, DOUBLE = 11, UINT32 = 12, UINT64 = 13, COMPLEX64 = 14, COMPLEX28 = 15, BFLOAT16 = 16
Expand Down
8 changes: 4 additions & 4 deletions tmva/sofie/src/RModel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1298,13 +1298,13 @@ void RModel::OutputGenerated(std::string filename, bool append) {
void RModel::Streamer(TBuffer &R__b) {
if (R__b.IsReading()) {
RModel::Class()->ReadBuffer(R__b, this);
for(auto i=RModel::fInitializedTensors.begin(); i!=RModel::fInitializedTensors.end(); ++i) {
i->second.CastPersistentToShared();
for (auto & i : fInitializedTensors) {
i.second.CastPersistentToShared();
}
}
else {
for(auto i=RModel::fInitializedTensors.begin(); i!=RModel::fInitializedTensors.end(); ++i) {
i->second.CastSharedToPersistent();
for (auto & i : fInitializedTensors) {
i.second.CastSharedToPersistent();
}
RModel::Class()->WriteBuffer(R__b, this);
}
Expand Down
36 changes: 0 additions & 36 deletions tmva/sofie/src/RModel_GNN.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,6 @@ namespace TMVA {
namespace Experimental {
namespace SOFIE {

RModel_GNN::RModel_GNN(RModel_GNN&& other) {
edges_update_block = std::move(other.edges_update_block);
nodes_update_block = std::move(other.nodes_update_block);
globals_update_block = std::move(other.globals_update_block);

edge_node_agg_block = std::move(other.edge_node_agg_block);
edge_global_agg_block = std::move(other.edge_global_agg_block);
node_global_agg_block = std::move(other.node_global_agg_block);

num_nodes = std::move(other.num_nodes);
num_edges = std::move(other.num_edges);

fName = std::move(other.fName);
fFileName = std::move(other.fFileName);
fParseTime = std::move(other.fParseTime);
}

RModel_GNN& RModel_GNN::operator=(RModel_GNN&& other) {
edges_update_block = std::move(other.edges_update_block);
nodes_update_block = std::move(other.nodes_update_block);
globals_update_block = std::move(other.globals_update_block);

edge_node_agg_block = std::move(other.edge_node_agg_block);
edge_global_agg_block = std::move(other.edge_global_agg_block);
node_global_agg_block = std::move(other.node_global_agg_block);

num_nodes = std::move(other.num_nodes);
num_edges = std::move(other.num_edges);

fName = std::move(other.fName);
fFileName = std::move(other.fFileName);
fParseTime = std::move(other.fParseTime);

return *this;
}

RModel_GNN::RModel_GNN(GNN_Init& graph_input_struct) {
edges_update_block = std::move(graph_input_struct.edges_update_block);
nodes_update_block = std::move(graph_input_struct.nodes_update_block);
Expand Down
28 changes: 0 additions & 28 deletions tmva/sofie/src/RModel_GraphIndependent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,6 @@ namespace TMVA {
namespace Experimental {
namespace SOFIE {

RModel_GraphIndependent::RModel_GraphIndependent(RModel_GraphIndependent&& other) {
edges_update_block = std::move(other.edges_update_block);
nodes_update_block = std::move(other.nodes_update_block);
globals_update_block = std::move(other.globals_update_block);

num_nodes = std::move(other.num_nodes);
num_edges = std::move(other.num_edges);

fName = std::move(other.fName);
fFileName = std::move(other.fFileName);
fParseTime = std::move(other.fParseTime);
}

RModel_GraphIndependent& RModel_GraphIndependent::operator=(RModel_GraphIndependent&& other) {
edges_update_block = std::move(other.edges_update_block);
nodes_update_block = std::move(other.nodes_update_block);
globals_update_block = std::move(other.globals_update_block);

num_nodes = std::move(other.num_nodes);
num_edges = std::move(other.num_edges);

fName = std::move(other.fName);
fFileName = std::move(other.fFileName);
fParseTime = std::move(other.fParseTime);

return *this;
}

RModel_GraphIndependent::RModel_GraphIndependent(GraphIndependent_Init& graph_input_struct) {
edges_update_block = std::move(graph_input_struct.edges_update_block);
nodes_update_block = std::move(graph_input_struct.nodes_update_block);
Expand Down
Loading