Skip to content

Commit d431a7f

Browse files
committed
Support including the OMPT backend's runtime implementation.
1 parent e1c8335 commit d431a7f

2 files changed

Lines changed: 63 additions & 37 deletions

File tree

include/opdi/backend/ompt/omptBackend.cpp

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -57,41 +57,6 @@ extern "C" ompt_start_tool_result_t* ompt_start_tool(unsigned int ompVersion, ch
5757

5858
/* runtime */
5959

60-
#include "../runtime.cpp" // contains implementations that do not depend on the backend
60+
#include "../runtime.cpp" // contains implementations that do not depend on the backend
6161

62-
namespace opdi {
63-
64-
/* lock routines */
65-
66-
void opdi_destroy_lock(omp_lock_t* lock) {
67-
omp_destroy_lock(lock);
68-
}
69-
70-
void opdi_destroy_nest_lock(omp_nest_lock_t* lock) {
71-
omp_destroy_nest_lock(lock);
72-
}
73-
74-
void opdi_set_lock(omp_lock_t* lock) {
75-
omp_set_lock(lock);
76-
}
77-
78-
void opdi_set_nest_lock(omp_nest_lock_t* lock) {
79-
omp_set_nest_lock(lock);
80-
}
81-
82-
void opdi_unset_lock(omp_lock_t* lock) {
83-
omp_unset_lock(lock);
84-
}
85-
86-
void opdi_unset_nest_lock(omp_nest_lock_t* lock) {
87-
omp_unset_nest_lock(lock);
88-
}
89-
90-
int opdi_test_lock(omp_lock_t* lock) {
91-
return omp_test_lock(lock);
92-
}
93-
94-
int opdi_test_nest_lock(omp_nest_lock_t* lock) {
95-
return omp_test_nest_lock(lock);
96-
}
97-
}
62+
#include "runtime.cpp" // contains backend-specific implementations
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* OpDiLib, an Open Multiprocessing Differentiation Library
3+
*
4+
* Copyright (C) 2020-2022 Chair for Scientific Computing (SciComp), TU Kaiserslautern
5+
* Copyright (C) 2023-2025 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
6+
* Homepage: https://scicomp.rptu.de
7+
* Contact: Prof. Nicolas R. Gauger (opdi@scicomp.uni-kl.de)
8+
*
9+
* Lead developer: Johannes Blühdorn (SciComp, University of Kaiserslautern-Landau)
10+
*
11+
* This file is part of OpDiLib (https://scicomp.rptu.de/software/opdi).
12+
*
13+
* OpDiLib is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
14+
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
15+
* version.
16+
*
17+
* OpDiLib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
18+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
19+
* details.
20+
*
21+
* You should have received a copy of the GNU Lesser General Public License along with OpDiLib. If not, see
22+
* <http://www.gnu.org/licenses/>.
23+
*
24+
*/
25+
26+
namespace opdi {
27+
28+
/* lock routines */
29+
30+
void opdi_destroy_lock(omp_lock_t* lock) {
31+
omp_destroy_lock(lock);
32+
}
33+
34+
void opdi_destroy_nest_lock(omp_nest_lock_t* lock) {
35+
omp_destroy_nest_lock(lock);
36+
}
37+
38+
void opdi_set_lock(omp_lock_t* lock) {
39+
omp_set_lock(lock);
40+
}
41+
42+
void opdi_set_nest_lock(omp_nest_lock_t* lock) {
43+
omp_set_nest_lock(lock);
44+
}
45+
46+
void opdi_unset_lock(omp_lock_t* lock) {
47+
omp_unset_lock(lock);
48+
}
49+
50+
void opdi_unset_nest_lock(omp_nest_lock_t* lock) {
51+
omp_unset_nest_lock(lock);
52+
}
53+
54+
int opdi_test_lock(omp_lock_t* lock) {
55+
return omp_test_lock(lock);
56+
}
57+
58+
int opdi_test_nest_lock(omp_nest_lock_t* lock) {
59+
return omp_test_nest_lock(lock);
60+
}
61+
}

0 commit comments

Comments
 (0)