Skip to content

Commit a2b9f45

Browse files
author
Kent Knox
committed
Merge branch 'develop'
2 parents 03e1e55 + 95f3a4d commit a2b9f45

File tree

96 files changed

+2050
-1415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2050
-1415
lines changed

.travis.yml

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
# Ubuntu 15.10 (Wily Werewolf)
1010
# Ubuntu 16.04 LTS (Xenial Xantus)
1111

12-
# language: instructs travis what compilers && environment to set up in build matrix
13-
language: cpp
14-
15-
# sudo: false instructs travis to build our project in a docker VM (faster)
16-
# Can not yet install fglrx packages with 'false'
17-
sudo: required # false
18-
1912
# os: expands the build matrix to include multiple os's
20-
# disable linux, as we get sporadic failures on building boost, needs investigation
2113
os:
2214
- linux
2315
- osx
2416

17+
# sudo: false instructs travis to build our project in a docker VM (faster),
18+
# but we cannot yet install fglrx packages with 'false'
19+
sudo: required # false
20+
dist: trusty
21+
22+
# language: instructs travis what compilers && environment to set up in build matrix
23+
language: cpp
24+
2525
# compiler: expands the build matrix to include multiple compilers (per os)
2626
compiler:
2727
- gcc
@@ -35,37 +35,20 @@ addons:
3535
apt:
3636
sources:
3737
# ubuntu-toolchain-r-test contains newer versions of gcc to install
38-
- ubuntu-toolchain-r-test
38+
# - ubuntu-toolchain-r-test
39+
3940
# llvm-toolchain-precise-3.6 contains newer versions of clang to install
4041
# - llvm-toolchain-precise-3.6
41-
# kubuntu-backports contains newer versions of cmake to install
42-
- kubuntu-backports
43-
# boost-latest contains boost v1.55
44-
# - boost-latest
4542
packages:
46-
# g++-4.8 is minimum version considered to be the first good c++11 gnu compiler
47-
- g++-4.8
48-
# - clang-3.6
49-
# We require v2.8.12 minimum
50-
- cmake
51-
# I'm finding problems between pre-compiled versions of boost ublas, with gtest
52-
# stl_algobase.h: error: no matching function for call to swap()
53-
# - libboost-program-options1.55-dev
54-
# - libboost-serialization1.55-dev
55-
# - libboost-filesystem1.55-dev
56-
# - libboost-system1.55-dev
57-
# - libboost-regex1.55-dev
5843
# The package opencl-headers on 'precise' only installs v1.1 cl headers; uncomment for 'trusty' or greater
59-
# - opencl-headers
60-
# Uncomment one of the following when fglrx modules are added to the apt whitelist
61-
# - fglrx
62-
# - fglrx=2:8.960-0ubuntu1
63-
# - fglrx=2:13.350.1-0ubuntu0.0.1
44+
- opencl-headers
6445

6546
# env: specifies additional global variables to define per row in build matrix
6647
env:
6748
global:
6849
- CLSPARSE_ROOT=${TRAVIS_BUILD_DIR}/bin/make/release
50+
- OPENCL_REGISTRY=https://www.khronos.org/registry/cl
51+
- OPENCL_ROOT=${TRAVIS_BUILD_DIR}/bin/opencl
6952

7053
# The following filters our build matrix; we are interested in linux-gcc & osx-clang
7154
matrix:
@@ -79,39 +62,52 @@ before_install:
7962
# Remove the following linux clause when fglrx can be installed with sudo: false
8063
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
8164
sudo apt-get update -qq &&
82-
sudo apt-get install -qq fglrx=2:13.350.1-0ubuntu0.0.1;
83-
fi
84-
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
85-
export OPENCL_ROOT="${TRAVIS_BUILD_DIR}/opencl-headers";
86-
export BUILD_BOOST="ON";
65+
sudo apt-get install -qq libboost-all-dev;
66+
export BUILD_BOOST="OFF";
8767
fi
8868
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
8969
brew update;
9070
brew outdated boost || brew upgrade boost;
9171
brew outdated cmake || brew upgrade cmake;
9272
export BUILD_BOOST="OFF";
9373
fi
94-
- if [ ${CXX} = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
74+
# - if [ ${CXX} = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
9575
- cmake --version;
9676
- ${CC} --version;
9777
- ${CXX} --version;
9878

9979
install:
100-
# 'Precise' only distributes v1.1 opencl headers; download 1.2 headers from khronos website
101-
# Remove when the travis VM upgrades to 'trusty' or beyond
102-
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
103-
mkdir -p ${OPENCL_ROOT}/include/CL;
104-
pushd ${OPENCL_ROOT}/include/CL;
105-
wget -w 1 -r -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/;
106-
popd;
107-
fi
10880
# osx image does not contain cl.hpp file; download from Khronos
10981
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
11082
pushd /System/Library/Frameworks/OpenCL.framework/Versions/A/Headers/;
111-
sudo wget -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/cl.hpp;
83+
sudo wget -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/2.1/cl.hpp;
84+
popd;
85+
fi
86+
# The following linux logic is necessary because of Travis's move to the GCE platform, which does not
87+
# currently contain packages for fglrx: https://github.com/travis-ci/travis-ci/issues/5221
88+
# We build our own linkable .so file
89+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
90+
mkdir -p ${OPENCL_ROOT};
91+
pushd ${OPENCL_ROOT};
92+
wget ${OPENCL_REGISTRY}/specs/opencl-icd-1.2.11.0.tgz;
93+
tar -xf opencl-icd-1.2.11.0.tgz;
94+
mv ./icd/* .;
95+
mkdir -p inc/CL;
96+
pushd inc/CL;
97+
wget -r -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/;
98+
wget -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/2.1/cl.hpp;
99+
popd;
100+
mkdir -p lib;
101+
pushd lib;
102+
cmake -G "Unix Makefiles" ..;
103+
make;
104+
cp ../bin/libOpenCL.so .;
105+
popd;
106+
mv inc/ include/;
112107
popd;
113108
fi
114109

110+
115111
# Use before_script: to run configure steps
116112
before_script:
117113
- mkdir -p ${CLSPARSE_ROOT}
@@ -123,6 +119,7 @@ script:
123119
- make clSPARSE-samples
124120
- cd clSPARSE-build
125121
- make package
122+
- popd
126123

127124
deploy:
128125
provider: releases
@@ -132,8 +129,8 @@ deploy:
132129
# This uses a personal OAuth token generated by kknox
133130
api_key:
134131
secure: MBkxtcfSk+4UvGRO+WRhmS86vIVzAs0LIF2sAtr/S+Ed+OdUAuhZypUsDXGWtK3mL55v9c8BZXefFfHfJqElcNmyHKwCptbCR/JiM8YBtjoy2/RW1NcJUZp+QuRlk23xPADj7QkPjv7dfrQUMitkLUXAD+uTmMe2l8gmlbhMrQqPBKhb+31FNv6Lmo6oa6GjbiGi7qjsrJc7uQjhppLam+M7BZbBALGbIqMIrb2BMDMMhBoDbb4zSKrSg3+krd3kKiCClJlK7xjIlyFXZ527ETQ+PMtIeQb0eJ3aQwa4caBRCm5BDzt8GnJ48S88EkynbQioCEE87ebcyOM7M+wfslW/Fm1Y86X5odIljkOmTNKoDvgLxc9vUCBtMyVHNIgZcToPdsrMsGxcHV+JtU3yVQVm6dnA5P/zG5bA+aBjsd7p7BdOE4fdhvZV5XRAk/wmiyWalF7hKJxHIiWAKknL+tpPDDUF+fHmDDsdf7yRDJBegNcKfw4+m19MIvLn9fbiNVCtwCAL1T4yWkIEpi4MRMDPtftmkZPbi6UwluOJUTeCeHe4en99Yu2haemNPqXs6rR0LlXGk31GQwzlrNfb+94F5tT2a4Ka4PsruA2NMW/IYCYEE5Gu7PihVDR031Fn9cdCU9kefUgyB07rJD6q/W+ljsU0osyg7VxyfMg8rkw=
135-
file: ${CLSPARSE_ROOT}/clSPARSE-build/*.tar.gz
136132
file_glob: true
133+
file: ${CLSPARSE_ROOT}/clSPARSE-build/*.tar.gz
137134
on:
138135
all_branches: true
139136
tags: true

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ endif()
3838
if( POLICY CMP0048 )
3939
cmake_policy( SET CMP0048 NEW )
4040

41-
project( SuperBuild.clSPARSE VERSION 0.8.1.0 )
41+
project( SuperBuild.clSPARSE VERSION 0.10.0.0 )
4242
else( )
4343
project( SuperBuild.clSPARSE )
4444

@@ -48,11 +48,11 @@ else( )
4848
endif( )
4949

5050
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_MINOR )
51-
set( SuperBuild.clSPARSE_VERSION_MINOR 8 )
51+
set( SuperBuild.clSPARSE_VERSION_MINOR 10 )
5252
endif( )
5353

5454
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_PATCH )
55-
set( SuperBuild.clSPARSE_VERSION_PATCH 1 )
55+
set( SuperBuild.clSPARSE_VERSION_PATCH 0 )
5656
endif( )
5757

5858
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_TWEAK )

README.md

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,26 @@ an OpenCL™ library implementing Sparse linear algebra routines. This proj
1111
a collaboration between [AMD Inc.](http://www.amd.com/) and
1212
[Vratis Ltd.](http://www.vratis.com/).
1313

14-
### What's new in clSPARSE **v0.8**
15-
- New single precision SpM-SpM (SpGEMM) function
16-
- Optimizations to the sparse matrix conversion routines
17-
- [API documentation](http://clmathlibraries.github.io/clSPARSE/) available
18-
- SpM-dV routines now provide [higher precision accuracy] (https://github.com/clMathLibraries/clSPARSE/wiki/Precision)
19-
- Various bug fixes integrated
14+
### What's new in clSPARSE **v0.10**
15+
**This release introduces breaking API changes from the prior version**. clSPARSE is still in a beta phase, and we may need to change the API at times to increase maintainability or fix design issues. A few changes are introduced to more closely follow the recently published [Cpp Core Guidelines](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html), a strong candidate to be the coding guidelines to be used in clSPARSE. Changes are noted below.
16+
- The API to create meta data for a csr encoded sparse matrix has changed. This is an attempt to hide the implementation details of how meta data is stored from the user. This allows the library freedom to change and iterate meta data without breaking clients.
17+
- `clsparseCsrMetaCompute()` renamed to `clsparseCsrMetaCreate()`, to more intuitively pair with the
18+
- New API `clsparseCsrMetaDelete()`
19+
- A few routines changed pure 'out' parameters to be returned on the stack as structs<sup>[1](#return-tuple)</sup>
20+
- `clsparseCreateControl()`
21+
- `clsparseGetEvent()`
22+
- `clsparseCreateSolverControl()`
23+
- `clsparseCsrMetaSize()`
24+
- A new index type has been introduced `clsparseIdx_t` to abstract the size of an index from the library interface; the only choice currently is 4 bytes. If users use this datatype for indices in their code, changing to 8-byte indices in the future should only be a recompile.
25+
- The names of member variables in our public structs have been renamed for consistency. Before, our member variables was not consistent with camel case and underscore naming. Member variables are now standardized to use underscores, but we keep camel casing for function and struct names<sup>[2](#consistent-naming)</sup>
26+
- `colIndices` to `col_indices`
27+
- `rowIndices` to `row_indices`
28+
- `rowOffsets` to `row_pointer` (renamed to pointer to remove confusion with buffer offsets for cl1.2)
29+
- `offValues` to `off_values`
30+
- `offColInd` to `off_col_indices`
31+
- `offRowOff` to `off_row_pointer`
32+
- `offValues` to `off_values`
33+
- All samples have been changed to compile with the above changes.
2034

2135

2236
## clSPARSE features
@@ -34,7 +48,7 @@ projects to build wrappers around clSPARSE in any language they need. A great d
3448
of thought and effort went into designing the API’s to make them less ‘cluttered’
3549
compared to the older clMath libraries. OpenCL state is not explicitly passed
3650
through the API, which enables the library to be forward compatible when users are
37-
ready to switch from OpenCL 1.2 to OpenCL 2.0 <sup>[1](#opencl-2)</sup>
51+
ready to switch from OpenCL 1.2 to OpenCL 2.0 <sup>[3](#opencl-2)</sup>
3852

3953
### Google Groups
4054
Two mailing lists have been created for the clMath projects:
@@ -46,23 +60,27 @@ Two mailing lists have been created for the clMath projects:
4660
developers interested in contributing to the library code itself
4761

4862
### API semantic versioning
49-
Good software is typically the result of the loop of feedback and iteration;
50-
software interfaces no less so. clSPARSE follows the
63+
Good software is typically the result of iteration and feedback. clSPARSE follows the
5164
[semantic versioning](http://semver.org/) guidelines, and while the major version
5265
number remains '0', the public API should not be considered stable. We release
5366
clSPARSE as beta software (0.y.z) early to the community to elicit feedback and
5467
comment. This comes with the expectation that with feedback, we may incorporate
5568
breaking changes to the API that might require early users to recompile, or rewrite
5669
portions of their code as we iterate on the design.
5770

71+
## clSPARSE Wiki
72+
The [project wiki](https://github.com/clMathLibraries/clSPARSE/wiki) contains helpful documentation.
73+
A [build primer](https://github.com/clMathLibraries/clSPARSE/wiki/Build) is available,
74+
which describes how to use cmake to generate platforms specific build files
75+
5876
## Samples
5977
clSPARSE contains a directory of simple [OpenCL samples](./samples) that demonstrate the use
6078
of the API in both C and C++. The [superbuild](http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html)
6179
script for clSPARSE also builds the samples as an external project, to demonstrate
6280
how an application would find and link to clSPARSE with cmake.
6381

6482
### clSPARSE library documentation
65-
**API documentation** is now available http://clmathlibraries.github.io/clSPARSE/ . The included samples will give an excellent
83+
**API documentation** is available at http://clmathlibraries.github.io/clSPARSE/. The samples give an excellent
6684
starting point to basic library operations.
6785

6886
### Contributing code
@@ -72,14 +90,8 @@ how to contribute code to this open source project. Code in the
7290
when commits are merged into /master. Active development and pull-requests should
7391
be made to the **develop** branch.
7492

75-
## Build
76-
clSPARSE is primarily written with C++ using C++11 core features. It does export
77-
a 'C' interface for compatibility with other languages.
78-
79-
### How to build clSPARSE for your platform
80-
A [Build primer](https://github.com/clMathLibraries/clSPARSE/wiki/Build) is available on
81-
the wiki, which describes how to use cmake to generate platforms specific build
82-
files
93+
## License
94+
clSPARSE is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
8395

8496
### Compiling for Windows
8597
- Windows&reg; 7/8
@@ -107,5 +119,9 @@ files
107119
- Googletest v1.7
108120
- Boost v1.58
109121

110-
## Clarifications
111-
<a name="opencl-2">[1]</a>: OpenCL 2.0 support is not yet fully implemented; only the interfaces have been designed
122+
## Footnotes
123+
<a name="return-tuple">[1]</a>: Changed to reflect CppCoreGuidelines: [F.21](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#a-namerf-out-multia-f21-to-return-multiple-out-values-prefer-returning-a-tuple-or-struct)
124+
125+
<a name="consistent-naming">[2]</a>: Changed to reflect CppCoreGuidelines: [NL.8](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#a-namerl-namea-nl8-use-a-consistent-naming-style)
126+
127+
<a name="opencl-2">[3]</a>: OpenCL 2.0 support is not yet fully implemented; only the interfaces have been designed

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ install:
4949
# The cmake build files expect a directory called inc
5050
- ps: mkdir inc/CL
5151
- ps: wget $opencl_registry/api/1.2/ | select -ExpandProperty links | where {$_.href -like "*.h*"} | select -ExpandProperty outerText | foreach{ wget $opencl_registry/api/1.2/$_ -OutFile inc/CL/$_ }
52+
- ps: wget $opencl_registry/api/2.1/cl.hpp -OutFile inc/CL/cl.hpp
5253
# - ps: dir; if( $lastexitcode -eq 0 ){ dir include/CL } else { Write-Output boom }
5354
# Create the static import lib in a directory called lib, so findopencl() will find it
5455
- ps: mkdir lib
@@ -59,7 +60,6 @@ install:
5960
# Rename the inc directory to include, so FindOpencl() will find it
6061
- ps: ren inc include
6162
- ps: popd
62-
- ps: popd
6363

6464
# before_build is used to run configure steps
6565
before_build:
@@ -81,6 +81,7 @@ after_build:
8181
- echo after_build step
8282
- ps: ls $env:CLSPARSE_ROOT\clSPARSE-build
8383
- ps: mv $env:CLSPARSE_ROOT\clSPARSE-build\*.zip $env:APPVEYOR_BUILD_FOLDER
84+
- ps: popd
8485

8586
# Appyeyor will save a copy of the package in it's personal storage
8687
artifacts:

beta2graphs/CSR2COO.png

36.9 KB
Loading

beta2graphs/CSR2Dense.png

20.7 KB
Loading

beta2graphs/Coo2Csr.png

28.6 KB
Loading

beta2graphs/Dense2Csr.png

36.4 KB
Loading

beta2graphs/SpGemm.png

40.5 KB
Loading

beta2graphs/SpMdV_Double.png

39.1 KB
Loading

0 commit comments

Comments
 (0)