BioDynaMo  v1.05.120-25dc9790
vtune_op_wrapper.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef CORE_OPERATION_VTUNE_OP_WRAPPER_H_
16 #define CORE_OPERATION_VTUNE_OP_WRAPPER_H_
17 
18 #include "core/util/vtune.h"
19 
20 namespace bdm {
21 
22 template <typename Op>
23 class VTuneOpWrapper : public Op {
24  public:
26  template <typename... Args>
27  explicit VTuneOpWrapper(Args&&... args) : Op{std::forward<Args>(args)...} {
28  domain_ = __itt_domain_create("MyTraces.MyDomain");
29  task_ = __itt_string_handle_create(typeid(Op).name());
30  }
31 
32  template <typename daosoa>
33  void Compute(daosoa* cells) const {
34  __itt_task_begin(domain_, __itt_null, __itt_null, task_);
35  Op::Compute(cells);
37  }
38 
39  private:
42 };
43 
44 } // namespace bdm
45 
46 #endif // CORE_OPERATION_VTUNE_OP_WRAPPER_H_
bdm
Definition: agent.cc:39
bdm::VTuneOpWrapper::Compute
void Compute(daosoa *cells) const
Definition: vtune_op_wrapper.h:33
__itt_domain_create
__itt_domain * __itt_domain_create(const char *)
Definition: vtune.h:46
__itt_task_begin
void __itt_task_begin(__itt_domain *, __itt_null_t, __itt_null_t, __itt_string_handle *)
Definition: vtune.h:56
__itt_string_handle_create
__itt_string_handle * __itt_string_handle_create(const char *)
Definition: vtune.h:51
bdm::VTuneOpWrapper::task_
__itt_string_handle * task_
Definition: vtune_op_wrapper.h:41
bdm::VTuneOpWrapper::domain_
__itt_domain * domain_
Definition: vtune_op_wrapper.h:40
__itt_string_handle
Definition: vtune.h:41
vtune.h
__itt_task_end
void __itt_task_end(__itt_domain *)
Definition: vtune.h:61
__itt_domain
Definition: vtune.h:40
bdm::VTuneOpWrapper::VTuneOpWrapper
VTuneOpWrapper(Args &&... args)
perfect forwarding ctor
Definition: vtune_op_wrapper.h:27
bdm::VTuneOpWrapper
Definition: vtune_op_wrapper.h:23