Skip to content

Commit 2620f08

Browse files
author
Kent Knox
committed
Merge branch 'develop' into 'master'
Release: v0.8.0.0 Conflicts: CMakeLists.txt src/CMakeLists.txt
2 parents a69553e + ee24b26 commit 2620f08

142 files changed

Lines changed: 14475 additions & 3740 deletions

File tree

Some content is hidden

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

.travis.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sudo: required # false
1919
# os: expands the build matrix to include multiple os's
2020
# disable linux, as we get sporadic failures on building boost, needs investigation
2121
os:
22-
# - linux
22+
- linux
2323
- osx
2424

2525
# compiler: expands the build matrix to include multiple compilers (per os)
@@ -116,10 +116,24 @@ install:
116116
before_script:
117117
- mkdir -p ${CLSPARSE_ROOT}
118118
- pushd ${CLSPARSE_ROOT}
119-
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_Boost=${BUILD_BOOST} -DBUILD_gMock=ON -DBUILD_clSPARSE=ON -DBUILD_SAMPLES=ON ${TRAVIS_BUILD_DIR}
119+
- cmake -DCMAKE_BUILD_TYPE=Release -DclSPARSE_BUILD64=ON -DBUILD_Boost=${BUILD_BOOST} -DBUILD_gMock=ON -DBUILD_clSPARSE=ON -DBUILD_SAMPLES=ON ${TRAVIS_BUILD_DIR}
120120

121121
# use script: to execute build steps
122122
script:
123-
- make
123+
- make clSPARSE-samples
124124
- cd clSPARSE-build
125125
- make package
126+
127+
deploy:
128+
provider: releases
129+
prerelease: true
130+
draft: true
131+
skip_cleanup: true
132+
# This uses a personal OAuth token generated by kknox
133+
api_key:
134+
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
136+
file_glob: true
137+
on:
138+
all_branches: true
139+
tags: true

CMakeLists.txt

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,27 @@
1818
# We require 2.8.10 because of the added support to download from https URL's
1919
cmake_minimum_required( VERSION 2.8.10 )
2020

21-
# uncomment these to debug nmake and borland makefiles
22-
#SET(CMAKE_START_TEMP_FILE "")
23-
#SET(CMAKE_END_TEMP_FILE "")
24-
#SET(CMAKE_VERBOSE_MAKEFILE 1)
21+
if( CMAKE_GENERATOR MATCHES "NMake" )
22+
option( NMAKE_COMPILE_VERBOSE "Print VERBOSE compile/link msgs to the console" OFF )
23+
if( NMAKE_COMPILE_VERBOSE )
24+
set( CMAKE_START_TEMP_FILE "" )
25+
set( CMAKE_END_TEMP_FILE "" )
26+
set( CMAKE_VERBOSE_MAKEFILE 1 )
27+
endif( )
28+
endif( )
29+
30+
# This has to be initialized before the project() command appears
31+
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE
32+
if( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE )
33+
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." )
34+
endif()
2535

2636
# Check if cmake supports the new VERSION tag for project() commands
2737
# SuperBuild.clSPARSE becomes the name of the project with a particular version
2838
if( POLICY CMP0048 )
2939
cmake_policy( SET CMP0048 NEW )
3040

31-
project( SuperBuild.clSPARSE VERSION 0.6.2.0 )
41+
project( SuperBuild.clSPARSE VERSION 0.8.0.0 )
3242
else( )
3343
project( SuperBuild.clSPARSE )
3444

@@ -38,11 +48,11 @@ else( )
3848
endif( )
3949

4050
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_MINOR )
41-
set( SuperBuild.clSPARSE_VERSION_MINOR 6 )
51+
set( SuperBuild.clSPARSE_VERSION_MINOR 8 )
4252
endif( )
4353

4454
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_PATCH )
45-
set( SuperBuild.clSPARSE_VERSION_PATCH 2 )
55+
set( SuperBuild.clSPARSE_VERSION_PATCH 0 )
4656
endif( )
4757

4858
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_TWEAK )
@@ -54,11 +64,6 @@ set( SuperBuild.clSPARSE_VERSION "${SuperBuild.clSPARSE_VERSION_MAJOR}.${SuperBu
5464

5565
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
5666

57-
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE
58-
if( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE )
59-
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE )
60-
endif()
61-
6267
if( MSVC_IDE )
6368
set( BUILD64 ${CMAKE_CL_64} )
6469
set_property( GLOBAL PROPERTY USE_FOLDERS TRUE )
@@ -135,6 +140,10 @@ if( DEFINED OPENCL_ROOT )
135140
list( APPEND clSPARSE.Samples.Cmake.Args -DOPENCL_ROOT=${OPENCL_ROOT} )
136141
endif( )
137142

143+
if( DEFINED NMAKE_COMPILE_VERBOSE )
144+
list( APPEND clSPARSE.Cmake.Args -DNMAKE_COMPILE_VERBOSE=${NMAKE_COMPILE_VERBOSE} )
145+
endif( )
146+
138147
# If the user selects, download, uncompress, and setup clBLAS
139148
#if( BUILD_clBLAS )
140149
# message( STATUS "Setting up clBLAS external..." )

NOTICE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ clSPARSE
77

88
This product includes software developed at
99
Vratis, Ltd. (http://www.vratis.com).
10+
11+
This product includes software under the MIT license developed by
12+
Weifeng Liu. (https://github.com/bhSPARSE/Benchmark_SpGEMM_using_CSR).
13+

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@ Pre-built binaries are available on our [releases page](https://github.com/clMat
33

44
| Build branch | master | develop |
55
|-----|-----|-----|
6-
| Linux/OSX x64 | [![Build Status](https://travis-ci.org/clMathLibraries/clSPARSE.svg?branch=master)](https://travis-ci.org/clMathLibraries/clSPARSE) |[![Build Status](https://travis-ci.org/clMathLibraries/clSPARSE.svg?branch=develop)](https://travis-ci.org/clMathLibraries/clSPARSE) |
6+
| GCC/Clang x64 | [![Build Status](https://travis-ci.org/clMathLibraries/clSPARSE.svg?branch=master)](https://travis-ci.org/clMathLibraries/clSPARSE/branches) | [![Build Status](https://travis-ci.org/clMathLibraries/clSPARSE.svg?branch=develop)](https://travis-ci.org/clMathLibraries/clSPARSE/branches) |
7+
| Visual Studio x64 |[![Build status](https://ci.appveyor.com/api/projects/status/93518qe0efy6n7fy/branch/master?svg=true)](https://ci.appveyor.com/project/kknox/clsparse-otonj/branch/master) |[![Build status](https://ci.appveyor.com/api/projects/status/93518qe0efy6n7fy/branch/develop?svg=true)](https://ci.appveyor.com/project/kknox/clsparse-otonj/branch/develop) |
78

89
# clSPARSE
9-
an OpenCL© library implementing Sparse linear algebra. This project is a result of
10+
an OpenCL™ library implementing Sparse linear algebra routines. This project is a result of
1011
a collaboration between [AMD Inc.](http://www.amd.com/) and
1112
[Vratis Ltd.](http://www.vratis.com/).
1213

13-
## Introduction to clSPARSE
14-
At this time, clSPARSE provides these fundamental sparse operations for OpenCL:
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
20+
21+
22+
## clSPARSE features
1523
- Sparse Matrix - dense Vector multiply (SpM-dV)
1624
- Sparse Matrix - dense Matrix multiply (SpM-dM)
25+
- Sparse Matrix - Sparse Matrix multiply Sparse Matrix Multiply(SpGEMM) - Single Precision
1726
- Iterative conjugate gradient solver (CG)
1827
- Iterative biconjugate gradient stabilized solver (BiCGStab)
1928
- Dense to CSR conversions (& converse)
@@ -25,11 +34,7 @@ projects to build wrappers around clSPARSE in any language they need. A great d
2534
of thought and effort went into designing the API’s to make them less ‘cluttered’
2635
compared to the older clMath libraries. OpenCL state is not explicitly passed
2736
through the API, which enables the library to be forward compatible when users are
28-
ready to switch from OpenCL 1.2 to OpenCL 2.0 _(OpenCL 2.0 support not completely finished)_
29-
30-
The API’s are designed such that users are in control of where input and output
31-
buffers live, and they maintain control of when data transfers to/from device
32-
memory happen, so that there are no performance surprises.
37+
ready to switch from OpenCL 1.2 to OpenCL 2.0 <sup>[1](#opencl-2)</sup>
3338

3439
### Google Groups
3540
Two mailing lists have been created for the clMath projects:
@@ -57,15 +62,15 @@ script for clSPARSE also builds the samples as an external project, to demonstra
5762
how an application would find and link to clSPARSE with cmake.
5863

5964
### clSPARSE library documentation
60-
**API documentation** is not yet available, but the samples above give an excellent
65+
**API documentation** is now available http://clmathlibraries.github.io/clSPARSE/ . The included samples will give an excellent
6166
starting point to basic library operations.
6267

6368
### Contributing code
6469
Please refer to and read the [Contributing](CONTRIBUTING.md) document for guidelines on
6570
how to contribute code to this open source project. Code in the
6671
/master branch is considered to be stable and new library releases are made
6772
when commits are merged into /master. Active development and pull-requests should
68-
be made to the **/develop** branch.
73+
be made to the **develop** branch.
6974

7075
## Build
7176
clSPARSE is primarily written with C++ using C++11 core features. It does export
@@ -101,3 +106,6 @@ files
101106
### Bench & Test infrastructure dependencies
102107
- Googletest v1.7
103108
- Boost v1.58
109+
110+
## Clarifications
111+
<a name="opencl-2">[1]</a>: OpenCL 2.0 support is not yet fully implemented; only the interfaces have been designed

appveyor.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Appveyor OS list
2+
# Windows Server 2012 R2 (x64) <== Appveyor default image
3+
# Visual Studio 2015
4+
5+
# os: expands the build matrix to include multiple os's
6+
os:
7+
- Windows Server 2012
8+
9+
# compiler: expands the build matrix to include multiple compilers (per os)
10+
platform:
11+
- x64
12+
13+
configuration:
14+
- Release
15+
16+
# Only clone the top level commit; don't bother with history
17+
shallow_clone: true
18+
19+
# environment: specifies additional global variables to define per row in build matrix
20+
environment:
21+
global:
22+
CLSPARSE_ROOT: "%APPVEYOR_BUILD_FOLDER%\\bin\\nmake\\release"
23+
OPENCL_ROOT: "%APPVEYOR_BUILD_FOLDER%\\bin\\opencl"
24+
# BOOST_ROOT: "C:/Libraries/boost" # boost 1.56, 32-bit only
25+
BOOST_ROOT: "C:\\Libraries\\boost_1_58_0"
26+
OPENCL_REGISTRY: "https://www.khronos.org/registry/cl"
27+
28+
init:
29+
- echo init step
30+
- cmake --version
31+
- C:\"Program Files (x86)"\"Microsoft Visual Studio 12.0"\VC\vcvarsall.bat %PLATFORM%
32+
# Uncomment the following to display Remote Desktop connection details
33+
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
34+
35+
# We need to create an opencl import library that clsparse can link against
36+
# Vendor based OpenCL packages are hard to use because of download size, registration requirements
37+
# and unattended installs not well supported
38+
install:
39+
- echo install step
40+
- ps: mkdir $env:OPENCL_ROOT
41+
- ps: pushd $env:OPENCL_ROOT
42+
- ps: $opencl_registry = $env:OPENCL_REGISTRY
43+
# This downloads the source to the example/demo icd library
44+
- ps: wget $opencl_registry/specs/opencl-icd-1.2.11.0.tgz -OutFile opencl-icd-1.2.11.0.tgz
45+
- ps: 7z x opencl-icd-1.2.11.0.tgz
46+
- ps: 7z x opencl-icd-1.2.11.0.tar
47+
- ps: mv .\icd\* .
48+
# This downloads all the opencl header files
49+
# The cmake build files expect a directory called inc
50+
- ps: mkdir inc/CL
51+
- 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: dir; if( $lastexitcode -eq 0 ){ dir include/CL } else { Write-Output boom }
53+
# Create the static import lib in a directory called lib, so findopencl() will find it
54+
- ps: mkdir lib
55+
- ps: pushd lib
56+
- cmake -G "NMake Makefiles" ..
57+
- nmake
58+
- ps: popd
59+
# Rename the inc directory to include, so FindOpencl() will find it
60+
- ps: ren inc include
61+
- ps: popd
62+
- ps: popd
63+
64+
# before_build is used to run configure steps
65+
before_build:
66+
- echo before_build step
67+
# Boost 1.58 is not installed in typical fashion, help FindBoost() find binary libs with BOOST_LIBRARYDIR
68+
- ps: $env:BOOST_LIBRARYDIR = "$env:BOOST_ROOT/lib64-msvc-12.0"
69+
- ps: mkdir $env:CLSPARSE_ROOT
70+
- ps: pushd $env:CLSPARSE_ROOT
71+
- cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DclSPARSE_BUILD64=ON -DBUILD_Boost=OFF -DBUILD_gMock=ON -DBUILD_clSPARSE=ON -DBUILD_SAMPLES=ON %APPVEYOR_BUILD_FOLDER%
72+
73+
# build_script invokes the compiler
74+
build_script:
75+
- echo build_script step
76+
- nmake clSPARSE-samples
77+
- cd clSPARSE-build
78+
- nmake package
79+
80+
after_build:
81+
- echo after_build step
82+
- ps: ls $env:CLSPARSE_ROOT\clSPARSE-build
83+
- ps: mv $env:CLSPARSE_ROOT\clSPARSE-build\*.zip $env:APPVEYOR_BUILD_FOLDER
84+
85+
# Appyeyor will save a copy of the package in it's personal storage
86+
artifacts:
87+
- path: '*.zip'
88+
name: binary_zip
89+
type: zip
90+
91+
# on_finish always executes regardless of passed or failed builds
92+
on_finish:
93+
- echo on_finish step
94+
95+
# Appveyor will push the artifacts it has saved to GitHub 'releases' tab
96+
deploy:
97+
provider: GitHub
98+
# This uses an personal OAuth token generated by kknox
99+
auth_token:
100+
secure: dRXIWJKpU7h2RsHX7RqmyYCtCw+Q9O3X5MArloY6p34GZC1w7bp+jQYTZqbdO7bw
101+
artifact: binary_zip
102+
draft: true
103+
prerelease: true
104+
on:
105+
appveyor_repo_tag: true
106+
107+
# Uncomment the following to pause the VM and wait for RDP connetion to debug
108+
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

cmake/ExternalBoost.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,22 @@ endif( )
5151

5252
include( ProcessorCount )
5353
ProcessorCount( Cores )
54-
message( STATUS "ExternalBoost detected ( " ${Cores} " ) cores to build Boost with" )
5554
if( NOT Cores EQUAL 0 )
55+
# Travis can fail to build Boost sporadically; uses 32 cores, reduce stress on VM
56+
if( DEFINED ENV{TRAVIS} )
57+
if( Cores GREATER 8 )
58+
set( Cores 8 )
59+
endif( )
60+
endif( )
61+
5662
# Add build thread in addition to the number of cores that we have
5763
math( EXPR Cores "${Cores} + 1 " )
5864
else( )
5965
# If we could not detect # of cores, assume 1 core and add an additional build thread
6066
set( Cores "2" )
6167
endif( )
68+
69+
message( STATUS "ExternalBoost using ( " ${Cores} " ) cores to build with" )
6270
list( APPEND Boost.Command -j ${Cores} --with-program_options --with-serialization --with-filesystem --with-system --with-regex )
6371

6472
if( BUILD64 )
@@ -133,7 +141,7 @@ mark_as_advanced( ext.Boost_URL )
133141
set( Boost.Bootstrap "" )
134142
set( ext.MD5_HASH "" )
135143
if( WIN32 )
136-
set( Boost.Bootstrap "./bootstrap.bat" )
144+
set( Boost.Bootstrap ".\\bootstrap.bat" )
137145

138146
if( CMAKE_VERSION VERSION_LESS "3.1.0" )
139147
# .zip file

cmake/ExternalGmock.cmake

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# ########################################################################
22
# Copyright 2015 Advanced Micro Devices, Inc.
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -50,8 +50,11 @@ if( CMAKE_COMPILER_IS_GNUCC )
5050
list( APPEND ext.gMock.cmake_args -DCMAKE_C_FLAGS=${EXTRA_FLAGS} -DCMAKE_CXX_FLAGS=${EXTRA_FLAGS} )
5151
endif( )
5252

53-
if( MSVC_IDE OR XCODE_VERSION )
53+
if( MSVC )
5454
list( APPEND ext.gMock.cmake_args -Dgtest_force_shared_crt=ON )
55+
endif( )
56+
57+
if( MSVC_IDE OR XCODE_VERSION )
5558
set( ext.gMock.Make
5659
COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Release
5760
COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Debug
@@ -60,18 +63,30 @@ else( )
6063
# Add build thread in addition to the number of cores that we have
6164
include( ProcessorCount )
6265
ProcessorCount( Cores )
63-
message( STATUS "ExternalclBLAS detected ( " ${Cores} " ) cores to build clBLAS with" )
6466

65-
set( ext.gMock.Make "make" )
66-
if( NOT Cores EQUAL 0 )
67-
math( EXPR Cores "${Cores} + 1 " )
68-
list( APPEND ext.gMock.Make -j ${Cores} )
67+
# If we are not using an IDE, assume nmake with visual studio
68+
if( MSVC )
69+
set( ext.gMock.Make "nmake" )
6970
else( )
70-
# If we could not detect # of cores, assume 1 core and add an additional build thread
71-
list( APPEND ext.gMock.Make -j 2 )
71+
set( ext.gMock.Make "make" )
72+
73+
# The -j paramter does not work with nmake
74+
if( NOT Cores EQUAL 0 )
75+
math( EXPR Cores "${Cores} + 1 " )
76+
list( APPEND ext.gMock.Make -j ${Cores} )
77+
else( )
78+
# If we could not detect # of cores, assume 1 core and add an additional build thread
79+
list( APPEND ext.gMock.Make -j 2 )
80+
endif( )
7281
endif( )
82+
83+
list( APPEND ext.gMock.cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} )
84+
message( STATUS "ExternalGmock using ( " ${Cores} " ) cores to build with" )
7385
endif( )
7486

87+
# message( STATUS "ext.gMock.Make ( " ${ext.gMock.Make} " ) " )
88+
# message( STATUS "ext.gMock.cmake_args ( " ${ext.gMock.cmake_args} " ) " )
89+
7590
# Add external project for googleMock
7691
ExternalProject_Add(
7792
gMock

0 commit comments

Comments
 (0)