Skip to content

Commit dff43f5

Browse files
committed
Moving utils.hpp under tests/ and added DBG print in Init/Finalize
Signed-off-by: Loic Pottier <[email protected]>
1 parent 6adf9c2 commit dff43f5

14 files changed

+20
-11
lines changed

src/AMSlib/AMS.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,14 @@ static std::unique_ptr<AMSWrap> _amsWrap;
604604

605605
void AMSInit() {
606606
std::call_once(_amsInitFlag, [&]() {
607+
DBG(AMS, "Initialization of AMS")
607608
_amsWrap = std::make_unique<AMSWrap>();
608609
});
609610
}
610611

611612
void AMSFinalize() {
612613
std::call_once(_amsFinalizeFlag, [&]() {
614+
DBG(AMS, "Finalization of AMS")
613615
_amsWrap.reset();
614616
});
615617
}

tests/AMSlib/ams_allocate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ constexpr int SUCCESS = 0;
1717
#include <umpire/strategy/QuickPool.hpp>
1818
#include <wf/resource_manager.hpp>
1919

20-
#include "utils.hpp"
20+
#include "../utils.hpp"
2121

2222
int test_allocation(AMSResourceType resource, std::string pool_name)
2323
{

tests/AMSlib/ams_bench_db.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "AMS.h"
2020

21-
#include "utils.hpp"
21+
#include "../utils.hpp"
2222

2323
AMSDType getDataType(const char *d_type)
2424
{

tests/AMSlib/ams_ete.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "AMS.h"
1717
#include "wf/debug.h"
1818

19-
#include "utils.hpp"
19+
#include "../utils.hpp"
2020

2121
void createUmpirePool(std::string parent_name, std::string pool_name)
2222
{

tests/AMSlib/ams_ete_env.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "AMS.h"
1717
#include "wf/debug.h"
1818

19-
#include "utils.hpp"
19+
#include "../utils.hpp"
2020

2121
void createUmpirePool(std::string parent_name, std::string pool_name)
2222
{

tests/AMSlib/ams_rmq_env.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "AMS.h"
1717
#include "wf/debug.h"
1818

19-
#include "utils.hpp"
19+
#include "../utils.hpp"
2020

2121
void createUmpirePool(std::string parent_name, std::string pool_name)
2222
{

tests/AMSlib/ams_update_model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <vector>
1212
#include <wf/resource_manager.hpp>
1313

14-
#include "utils.hpp"
14+
#include "../utils.hpp"
1515

1616
#define SIZE (32L)
1717

tests/AMSlib/ams_uq_model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <vector>
1010
#include <wf/resource_manager.hpp>
1111

12-
#include "utils.hpp"
12+
#include "../utils.hpp"
1313

1414
#define SIZE (32L * 1024L + 3L)
1515

tests/AMSlib/cpu_packing_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <wf/data_handler.hpp>
1414
#include <wf/resource_manager.hpp>
1515

16-
#include "utils.hpp"
16+
#include "../utils.hpp"
1717

1818
#define SIZE (32 * 1024 + 1)
1919

tests/AMSlib/gpu_packing_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "utils/allocator.hpp"
1414
#include "utils/utils_data.hpp"
1515

16-
#include "utils.hpp"
16+
#include "../utils.hpp"
1717

1818
// All allocations and operations will happen on top of this 'SIZE'.
1919
// Keep a small value for test to be 'fast'.

tests/AMSlib/lb.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#include "wf/redist_load.hpp"
1212

13+
#include "../utils.hpp"
14+
1315
#define SIZE (10)
1416

1517
void init(double *data, int elements, double value)
@@ -34,6 +36,10 @@ int main(int argc, char *argv[])
3436
{
3537
using namespace ams;
3638
int device = std::atoi(argv[1]);
39+
40+
installSignals();
41+
AMSInit();
42+
3743
MPI_Init(&argc, &argv);
3844
AMSSetupAllocator(AMSResourceType::AMS_HOST);
3945
AMSResourceType resource = AMSResourceType::AMS_HOST;
@@ -101,5 +107,6 @@ int main(int argc, char *argv[])
101107
ResourceManager::deallocate(srcHData, AMSResourceType::AMS_HOST);
102108

103109
MPI_Finalize();
110+
AMSFinalize();
104111
return ret;
105112
}

tests/AMSlib/test_hdcache.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <vector>
1717
#include <wf/resource_manager.hpp>
1818

19-
#include "utils.hpp"
19+
#include "../utils.hpp"
2020

2121
template <typename T>
2222
std::vector<const T *> generate_vectors(const int num_clusters,

tests/AMSlib/torch_model.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <vector>
1616
#include <wf/resource_manager.hpp>
1717

18-
#include "utils.hpp"
18+
#include "../utils.hpp"
1919

2020
#define SIZE (32L * 1024L + 3L)
2121

File renamed without changes.

0 commit comments

Comments
 (0)