@@ -23,21 +23,29 @@ void _testArraySwap(bool use_own_swap)
23
23
{
24
24
std::cout << " ** TestArraySwap is_own=" << use_own_swap << " \n " ;
25
25
26
+ String c1_name = " TestC1" ;
26
27
UniqueArray<IntSubClass> c1 (7 );
27
- IntSubClass* x1 = c1.unguardedBasePointer ();
28
+ c1.setDebugName (c1_name);
29
+ IntSubClass* x1 = c1.data ();
28
30
std::cout << " ** C1_this = " << &c1 << " \n " ;
29
31
std::cout << " ** C1_BASE = " << x1 << " \n " ;
30
32
UniqueArray<IntSubClass> c2 (3 );
31
- IntSubClass* x2 = c2.unguardedBasePointer ();
33
+ IntSubClass* x2 = c2.data ();
32
34
std::cout << " ** C2_this = " << &c2 << " \n " ;
33
35
std::cout << " ** C2_BASE = " << x2 << " \n " ;
34
36
37
+ ASSERT_EQ (c1.debugName (), c1_name);
38
+ ASSERT_EQ (c2.debugName (), String{});
39
+
35
40
if (use_own_swap) {
36
41
swap (c1, c2);
37
42
}
38
43
else
39
44
std::swap (c1, c2);
40
45
46
+ ASSERT_EQ (c2.debugName (), c1_name);
47
+ ASSERT_EQ (c1.debugName (), String{});
48
+
41
49
IntSubClass* after_x1 = c1.data ();
42
50
IntSubClass* after_x2 = c2.data ();
43
51
std::cout << " ** C1_BASE_AFTER = " << after_x1 << " size=" << c1.size () << " \n " ;
@@ -990,6 +998,9 @@ TEST(Array, AllocatorV2)
990
998
}
991
999
}
992
1000
1001
+ /* ---------------------------------------------------------------------------*/
1002
+ /* ---------------------------------------------------------------------------*/
1003
+
993
1004
TEST (Array, DebugInfo)
994
1005
{
995
1006
using namespace Arccore ;
@@ -1034,6 +1045,30 @@ TEST(Array, DebugInfo)
1034
1045
/* ---------------------------------------------------------------------------*/
1035
1046
/* ---------------------------------------------------------------------------*/
1036
1047
1048
+ TEST (Collections, Memory)
1049
+ {
1050
+ using namespace Arccore ;
1051
+ std::cout << eHostDeviceMemoryLocation::Unknown << " "
1052
+ << eHostDeviceMemoryLocation::Device << " "
1053
+ << eHostDeviceMemoryLocation::Host << " "
1054
+ << eHostDeviceMemoryLocation::ManagedMemoryDevice << " "
1055
+ << eHostDeviceMemoryLocation::ManagedMemoryHost << " \n " ;
1056
+
1057
+ std::cout << eMemoryResource::Unknown << " "
1058
+ << eMemoryResource::Host << " "
1059
+ << eMemoryResource::HostPinned << " "
1060
+ << eMemoryResource::Device << " "
1061
+ << eMemoryResource::UnifiedMemory << " \n " ;
1062
+
1063
+ UniqueArray<Int32> a1;
1064
+ ASSERT_EQ (a1.hostDeviceMemoryLocation (), eHostDeviceMemoryLocation::Unknown);
1065
+ a1._internalSetHostDeviceMemoryLocation (eHostDeviceMemoryLocation::Host);
1066
+ ASSERT_EQ (a1.hostDeviceMemoryLocation (), eHostDeviceMemoryLocation::Host);
1067
+ }
1068
+
1069
+ /* ---------------------------------------------------------------------------*/
1070
+ /* ---------------------------------------------------------------------------*/
1071
+
1037
1072
namespace Arccore
1038
1073
{
1039
1074
// Instancie explicitement les classes tableaux pour garantir
0 commit comments