Skip to content

Commit cb1be0f

Browse files
committed
# This is a combination of 18 commits.
# This is the 1st commit message: Issue #303: framework for reference_dense added This commit comes from a split of the original commit whose details are as follows: SHA1 ID: a7c1db0 Author: Albert-Jan Yzelman <yzelman@linux.fritz.box> 2022-01-14 15:52:26 Committer: Albert-Jan Yzelman <yzelman@linux.fritz.box> 2022-01-30 13:48:35 The reason for splitting is to separate the changes irrelevant to the branch 303 into a separate branch. The split produced 3 separate commits. This commit is number 1. This commit in particular is relevant to 303 and will remain in it. # This is the commit message #2: Issue #303: unify script argument similar to --no-reference # This is the commit message #3: Issue #303: complete implementation of Vector< reference_dense >, modulo output iteration. # This is the commit message #4: Issue #303: modified vector implementation according to option 3 in handling dense container construction. # This is the commit message #5: Issue #303: vectors now have an iterator for the user to extract data from. # This is the commit message #6: Issue #303, fixed silly oops: the difference between two iterators should be an integer # This is the commit message #7: Issue #303: containers are now uninitialized on construction. Iteration over uninitialized containers returns nothing. # This is the commit message #8: Issue #303: configure and cmake now properly do make install with reference_dense # This is the commit message #9: Issue #303: cmake infra has updated-- make dense_reference additions compatible to it # This is the commit message #10: Drafting structured matrix interface using reference_dense backend # This is the commit message #11: Issue #303: Copy test mxm.cpp to dense_mxm.cpp as a starting point # This is the commit message #12: Issue #303: Add partial first version of Matrix interface for denseref # This is the commit message #13: Issue #303: WIP: dense mxm test # This is the commit message #14: Issue #303: Add dense mxm test to CMakeLists # This is the commit message #15: Issue #303: Separate reference and reference_dense includes # This is the commit message #16: Issue #303: Fix grb include name mismatch # This is the commit message #17: Issue #303: Add src files for reference dense backend # This is the commit message #18: Issue #303: Add project related option for dense backend
1 parent 354a85f commit cb1be0f

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ endif()
5050
### CONFIGURATION OPTIONS
5151
# to choose backends and dependencies
5252
option( WITH_REFERENCE_BACKEND "With Reference backend" ON )
53+
option( WITH_DENSE_BACKEND "With Dense backend" ON )
5354
option( WITH_OMP_BACKEND "With OMP backend" ON )
5455
option( WITH_HYPERDAGS_BACKEND "With Hyperdags backend" ON )
5556
if( WITH_HYPERDAGS_BACKEND )

src/graphblas/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ if( WITH_NONBLOCKING_BACKEND )
9393
add_subdirectory( nonblocking )
9494
endif()
9595

96+
if( WITH_DENSE_BACKEND )
97+
add_subdirectory( denseref )
98+
endif()
99+
96100
if( WITH_BSP1D_BACKEND OR WITH_HYBRID_BACKEND )
97101
add_subdirectory( bsp1d )
98102
endif()
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#
2+
# Copyright 2021 Huawei Technologies Co., Ltd.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
assert_valid_variables( BACKEND_LIBRARY_OUTPUT_NAME VERSION
18+
SHMEM_BACKEND_INSTALL_DIR INCLUDE_INSTALL_DIR
19+
DENSE_BACKEND_DEFAULT_NAME
20+
DENSE_SELECTION_DEFS backend_reference_srcs
21+
)
22+
23+
# sources for bsp1d backend
24+
set( backend_reference_dense_srcs
25+
${CMAKE_CURRENT_SOURCE_DIR}/init.cpp
26+
)
27+
28+
add_library( backend_reference_dense_static STATIC "${backend_reference_dense_srcs}" )
29+
30+
target_link_libraries( backend_reference_dense_static PUBLIC backend_reference_dense_headers )
31+
target_link_libraries( backend_reference_dense_static PRIVATE backend_common_utils )
32+
33+
set_target_properties( backend_reference_dense_static PROPERTIES
34+
POSITION_INDEPENDENT_CODE true
35+
INTERFACE_POSITION_INDEPENDENT_CODE true
36+
OUTPUT_NAME "${BACKEND_LIBRARY_OUTPUT_NAME}"
37+
)
38+
39+
set_target_properties( backend_reference_dense_static PROPERTIES
40+
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/reference_dense"
41+
)
42+
43+
target_compile_options( backend_reference_dense_static PRIVATE "${BACKEND_COMPILE_OPTIONS}" )
44+
target_compile_definitions( backend_reference_dense_static PRIVATE "${BACKEND_COMPILE_DEFINITIONS}" )
45+
target_compile_definitions( backend_reference_dense_static INTERFACE "${REFERENCE_DENSE_SELECTION_DEFS}" )
46+
47+
add_dependencies( libs backend_reference_dense_static )
48+
49+
install( TARGETS backend_reference_dense_static
50+
EXPORT GraphBLASTargets
51+
ARCHIVE DESTINATION "${REFERENCE_DENSE_BACKEND_INSTALL_DIR}"
52+
)
53+
54+
# this is an alias for add_grb_executables() to select the backend to link against
55+
# DO NOT CHANGE THE ALIAS NAME!
56+
add_library( "${DENSE_BACKEND_DEFAULT_NAME}" ALIAS backend_reference_dense_static )

src/graphblas/denseref/init.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
/*
3+
* Copyright 2021 Huawei Technologies Co., Ltd.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* @author A. N. Yzelman
20+
* @date 2nd of February, 2017
21+
*/
22+
23+
#include <graphblas/denseref/init.hpp>
24+
25+
template<>
26+
grb::RC grb::init< grb::reference_dense >( const size_t s, const size_t P, void * const data ) {
27+
// we don't use any implementation-specific init data
28+
(void)data;
29+
// print output
30+
std::cerr << "Info: grb::init (reference_dense) called.\n";
31+
// sanity checks
32+
if( P > 1 ) {
33+
return grb::UNSUPPORTED;
34+
}
35+
if( s > 0 ) {
36+
return grb::PANIC;
37+
}
38+
// done
39+
return grb::SUCCESS;
40+
}
41+
42+
43+
template<>
44+
grb::RC grb::finalize< grb::reference_dense >() {
45+
return grb::SUCCESS;
46+
}

0 commit comments

Comments
 (0)