Skip to content
This repository was archived by the owner on Dec 17, 2020. It is now read-only.

Commit 70d1138

Browse files
authored
Pinned memory (#28)
Pinned memory
2 parents 285c0fc + 7e33528 commit 70d1138

13 files changed

+712
-2
lines changed

core/unit_test/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1)
272272
OBJ_HIP += TestHIP_Reducers_a.o TestHIP_Reducers_b.o TestHIP_Reducers_c.o TestHIP_Reducers_d.o
273273
OBJ_HIP += TestHIP_Reductions.o
274274
OBJ_HIP += TestHIP_MDRange_a.o TestHIP_MDRange_b.o TestHIP_MDRange_c.o TestHIP_MDRange_d.o TestHIP_MDRange_e.o
275+
OBJ_HIP += TestHIP_Spaces.o
276+
OBJ_HIP += TestHIPHostPinned_ViewCopy.o TestHIPHostPinned_ViewAPI_a.o TestHIPHostPinned_ViewAPI_b.o TestHIPHostPinned_ViewAPI_c.o TestHIPHostPinned_ViewAPI_d.o TestHIPHostPinned_ViewAPI_e.o
277+
OBJ_HIP += TestHIPHostPinned_ViewMapping_a.o TestHIPHostPinned_ViewMapping_b.o TestHIPHostPinned_ViewMapping_subview.o
275278

276279
TARGETS += KokkosCore_UnitTest_HIP
277280

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#ifndef KOKKOS_TEST_HIPHOSTPINNED_HPP
45+
#define KOKKOS_TEST_HIPHOSTPINNED_HPP
46+
47+
#include <gtest/gtest.h>
48+
49+
namespace Test {
50+
51+
class hip_hostpinned : public ::testing::Test {
52+
protected:
53+
static void SetUpTestCase() {}
54+
55+
static void TearDownTestCase() {}
56+
};
57+
58+
} // namespace Test
59+
60+
#define TEST_CATEGORY hip_hostpinned
61+
#define TEST_EXECSPACE Kokkos::Experimental::HIPHostPinnedSpace
62+
63+
#endif
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#include <hip/TestHIPHostPinned_Category.hpp>
45+
#include <TestSharedAlloc.hpp>
46+
47+
namespace Test {
48+
49+
TEST_F(TEST_CATEGORY, impl_shared_alloc) {
50+
test_shared_alloc<TEST_EXECSPACE, Kokkos::DefaultHostExecutionSpace>();
51+
}
52+
53+
} // namespace Test

core/unit_test/hip/TestHIP_ViewAPI_a.cpp renamed to core/unit_test/hip/TestHIPHostPinned_ViewAPI_a.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@
4141
//@HEADER
4242
*/
4343

44-
#include <hip/TestHIP_Category.hpp>
45-
44+
#include <hip/TestHIPHostPinned_Category.hpp>
4645
#include <TestViewAPI_a.hpp>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#include <hip/TestHIPHostPinned_Category.hpp>
45+
#include <TestViewAPI_b.hpp>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#include <hip/TestHIPHostPinned_Category.hpp>
45+
#include <TestViewAPI_c.hpp>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#include <hip/TestHIPHostPinned_Category.hpp>
45+
#include <TestViewAPI_d.hpp>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#include <hip/TestHIPHostPinned_Category.hpp>
45+
#include <TestViewAPI_e.hpp>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
//@HEADER
3+
// ************************************************************************
4+
//
5+
// Kokkos v. 2.0
6+
// Copyright (2014) Sandia Corporation
7+
//
8+
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9+
// the U.S. Government retains certain rights in this software.
10+
//
11+
// Redistribution and use in source and binary forms, with or without
12+
// modification, are permitted provided that the following conditions are
13+
// met:
14+
//
15+
// 1. Redistributions of source code must retain the above copyright
16+
// notice, this list of conditions and the following disclaimer.
17+
//
18+
// 2. Redistributions in binary form must reproduce the above copyright
19+
// notice, this list of conditions and the following disclaimer in the
20+
// documentation and/or other materials provided with the distribution.
21+
//
22+
// 3. Neither the name of the Corporation nor the names of the
23+
// contributors may be used to endorse or promote products derived from
24+
// this software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27+
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29+
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30+
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31+
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32+
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34+
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35+
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36+
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact Christian R. Trott ([email protected])
39+
//
40+
// ************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#include <hip/TestHIPHostPinned_Category.hpp>
45+
#include <TestViewCopy.hpp>

0 commit comments

Comments
 (0)