Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Release: v0.8.0.0

Conflicts:
	CMakeLists.txt
	src/CMakeLists.txt
  • Loading branch information
Kent Knox committed Oct 16, 2015
2 parents a69553e + ee24b26 commit 2620f08
Show file tree
Hide file tree
Showing 142 changed files with 14,475 additions and 3,740 deletions.
20 changes: 17 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sudo: required # false
# os: expands the build matrix to include multiple os's
# disable linux, as we get sporadic failures on building boost, needs investigation
os:
# - linux
- linux
- osx

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

# use script: to execute build steps
script:
- make
- make clSPARSE-samples
- cd clSPARSE-build
- make package

deploy:
provider: releases
prerelease: true
draft: true
skip_cleanup: true
# This uses a personal OAuth token generated by kknox
api_key:
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=
file: ${CLSPARSE_ROOT}/clSPARSE-build/*.tar.gz
file_glob: true
on:
all_branches: true
tags: true
33 changes: 21 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,27 @@
# We require 2.8.10 because of the added support to download from https URL's
cmake_minimum_required( VERSION 2.8.10 )

# uncomment these to debug nmake and borland makefiles
#SET(CMAKE_START_TEMP_FILE "")
#SET(CMAKE_END_TEMP_FILE "")
#SET(CMAKE_VERBOSE_MAKEFILE 1)
if( CMAKE_GENERATOR MATCHES "NMake" )
option( NMAKE_COMPILE_VERBOSE "Print VERBOSE compile/link msgs to the console" OFF )
if( NMAKE_COMPILE_VERBOSE )
set( CMAKE_START_TEMP_FILE "" )
set( CMAKE_END_TEMP_FILE "" )
set( CMAKE_VERBOSE_MAKEFILE 1 )
endif( )
endif( )

# This has to be initialized before the project() command appears
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE
if( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." )
endif()

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

project( SuperBuild.clSPARSE VERSION 0.6.2.0 )
project( SuperBuild.clSPARSE VERSION 0.8.0.0 )
else( )
project( SuperBuild.clSPARSE )

Expand All @@ -38,11 +48,11 @@ else( )
endif( )

if( NOT DEFINED SuperBuild.clSPARSE_VERSION_MINOR )
set( SuperBuild.clSPARSE_VERSION_MINOR 6 )
set( SuperBuild.clSPARSE_VERSION_MINOR 8 )
endif( )

if( NOT DEFINED SuperBuild.clSPARSE_VERSION_PATCH )
set( SuperBuild.clSPARSE_VERSION_PATCH 2 )
set( SuperBuild.clSPARSE_VERSION_PATCH 0 )
endif( )

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

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )

# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE
if( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE )
endif()

if( MSVC_IDE )
set( BUILD64 ${CMAKE_CL_64} )
set_property( GLOBAL PROPERTY USE_FOLDERS TRUE )
Expand Down Expand Up @@ -135,6 +140,10 @@ if( DEFINED OPENCL_ROOT )
list( APPEND clSPARSE.Samples.Cmake.Args -DOPENCL_ROOT=${OPENCL_ROOT} )
endif( )

if( DEFINED NMAKE_COMPILE_VERBOSE )
list( APPEND clSPARSE.Cmake.Args -DNMAKE_COMPILE_VERBOSE=${NMAKE_COMPILE_VERBOSE} )
endif( )

# If the user selects, download, uncompress, and setup clBLAS
#if( BUILD_clBLAS )
# message( STATUS "Setting up clBLAS external..." )
Expand Down
4 changes: 4 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ clSPARSE

This product includes software developed at
Vratis, Ltd. (http://www.vratis.com).

This product includes software under the MIT license developed by
Weifeng Liu. (https://github.com/bhSPARSE/Benchmark_SpGEMM_using_CSR).

30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ Pre-built binaries are available on our [releases page](https://github.com/clMat

| Build branch | master | develop |
|-----|-----|-----|
| 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) |
| 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) |
| 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) |

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

## Introduction to clSPARSE
At this time, clSPARSE provides these fundamental sparse operations for OpenCL:
### What's new in clSPARSE **v0.8**
- New single precision SpM-SpM (SpGEMM) function
- Optimizations to the sparse matrix conversion routines
- [API documentation](http://clmathlibraries.github.io/clSPARSE/) available
- SpM-dV routines now provide [higher precision accuracy] (https://github.com/clMathLibraries/clSPARSE/wiki/Precision)
- Various bug fixes integrated


## clSPARSE features
- Sparse Matrix - dense Vector multiply (SpM-dV)
- Sparse Matrix - dense Matrix multiply (SpM-dM)
- Sparse Matrix - Sparse Matrix multiply Sparse Matrix Multiply(SpGEMM) - Single Precision
- Iterative conjugate gradient solver (CG)
- Iterative biconjugate gradient stabilized solver (BiCGStab)
- Dense to CSR conversions (& converse)
Expand All @@ -25,11 +34,7 @@ projects to build wrappers around clSPARSE in any language they need. A great d
of thought and effort went into designing the API’s to make them less ‘cluttered’
compared to the older clMath libraries. OpenCL state is not explicitly passed
through the API, which enables the library to be forward compatible when users are
ready to switch from OpenCL 1.2 to OpenCL 2.0 _(OpenCL 2.0 support not completely finished)_

The API’s are designed such that users are in control of where input and output
buffers live, and they maintain control of when data transfers to/from device
memory happen, so that there are no performance surprises.
ready to switch from OpenCL 1.2 to OpenCL 2.0 <sup>[1](#opencl-2)</sup>

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

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

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

## Build
clSPARSE is primarily written with C++ using C++11 core features. It does export
Expand Down Expand Up @@ -101,3 +106,6 @@ files
### Bench & Test infrastructure dependencies
- Googletest v1.7
- Boost v1.58

## Clarifications
<a name="opencl-2">[1]</a>: OpenCL 2.0 support is not yet fully implemented; only the interfaces have been designed
108 changes: 108 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Appveyor OS list
# Windows Server 2012 R2 (x64) <== Appveyor default image
# Visual Studio 2015

# os: expands the build matrix to include multiple os's
os:
- Windows Server 2012

# compiler: expands the build matrix to include multiple compilers (per os)
platform:
- x64

configuration:
- Release

# Only clone the top level commit; don't bother with history
shallow_clone: true

# environment: specifies additional global variables to define per row in build matrix
environment:
global:
CLSPARSE_ROOT: "%APPVEYOR_BUILD_FOLDER%\\bin\\nmake\\release"
OPENCL_ROOT: "%APPVEYOR_BUILD_FOLDER%\\bin\\opencl"
# BOOST_ROOT: "C:/Libraries/boost" # boost 1.56, 32-bit only
BOOST_ROOT: "C:\\Libraries\\boost_1_58_0"
OPENCL_REGISTRY: "https://www.khronos.org/registry/cl"

init:
- echo init step
- cmake --version
- C:\"Program Files (x86)"\"Microsoft Visual Studio 12.0"\VC\vcvarsall.bat %PLATFORM%
# Uncomment the following to display Remote Desktop connection details
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

# We need to create an opencl import library that clsparse can link against
# Vendor based OpenCL packages are hard to use because of download size, registration requirements
# and unattended installs not well supported
install:
- echo install step
- ps: mkdir $env:OPENCL_ROOT
- ps: pushd $env:OPENCL_ROOT
- ps: $opencl_registry = $env:OPENCL_REGISTRY
# This downloads the source to the example/demo icd library
- ps: wget $opencl_registry/specs/opencl-icd-1.2.11.0.tgz -OutFile opencl-icd-1.2.11.0.tgz
- ps: 7z x opencl-icd-1.2.11.0.tgz
- ps: 7z x opencl-icd-1.2.11.0.tar
- ps: mv .\icd\* .
# This downloads all the opencl header files
# The cmake build files expect a directory called inc
- ps: mkdir inc/CL
- 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/$_ }
# - ps: dir; if( $lastexitcode -eq 0 ){ dir include/CL } else { Write-Output boom }
# Create the static import lib in a directory called lib, so findopencl() will find it
- ps: mkdir lib
- ps: pushd lib
- cmake -G "NMake Makefiles" ..
- nmake
- ps: popd
# Rename the inc directory to include, so FindOpencl() will find it
- ps: ren inc include
- ps: popd
- ps: popd

# before_build is used to run configure steps
before_build:
- echo before_build step
# Boost 1.58 is not installed in typical fashion, help FindBoost() find binary libs with BOOST_LIBRARYDIR
- ps: $env:BOOST_LIBRARYDIR = "$env:BOOST_ROOT/lib64-msvc-12.0"
- ps: mkdir $env:CLSPARSE_ROOT
- ps: pushd $env:CLSPARSE_ROOT
- 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%

# build_script invokes the compiler
build_script:
- echo build_script step
- nmake clSPARSE-samples
- cd clSPARSE-build
- nmake package

after_build:
- echo after_build step
- ps: ls $env:CLSPARSE_ROOT\clSPARSE-build
- ps: mv $env:CLSPARSE_ROOT\clSPARSE-build\*.zip $env:APPVEYOR_BUILD_FOLDER

# Appyeyor will save a copy of the package in it's personal storage
artifacts:
- path: '*.zip'
name: binary_zip
type: zip

# on_finish always executes regardless of passed or failed builds
on_finish:
- echo on_finish step

# Appveyor will push the artifacts it has saved to GitHub 'releases' tab
deploy:
provider: GitHub
# This uses an personal OAuth token generated by kknox
auth_token:
secure: dRXIWJKpU7h2RsHX7RqmyYCtCw+Q9O3X5MArloY6p34GZC1w7bp+jQYTZqbdO7bw
artifact: binary_zip
draft: true
prerelease: true
on:
appveyor_repo_tag: true

# Uncomment the following to pause the VM and wait for RDP connetion to debug
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
12 changes: 10 additions & 2 deletions cmake/ExternalBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,22 @@ endif( )

include( ProcessorCount )
ProcessorCount( Cores )
message( STATUS "ExternalBoost detected ( " ${Cores} " ) cores to build Boost with" )
if( NOT Cores EQUAL 0 )
# Travis can fail to build Boost sporadically; uses 32 cores, reduce stress on VM
if( DEFINED ENV{TRAVIS} )
if( Cores GREATER 8 )
set( Cores 8 )
endif( )
endif( )

# Add build thread in addition to the number of cores that we have
math( EXPR Cores "${Cores} + 1 " )
else( )
# If we could not detect # of cores, assume 1 core and add an additional build thread
set( Cores "2" )
endif( )

message( STATUS "ExternalBoost using ( " ${Cores} " ) cores to build with" )
list( APPEND Boost.Command -j ${Cores} --with-program_options --with-serialization --with-filesystem --with-system --with-regex )

if( BUILD64 )
Expand Down Expand Up @@ -133,7 +141,7 @@ mark_as_advanced( ext.Boost_URL )
set( Boost.Bootstrap "" )
set( ext.MD5_HASH "" )
if( WIN32 )
set( Boost.Bootstrap "./bootstrap.bat" )
set( Boost.Bootstrap ".\\bootstrap.bat" )

if( CMAKE_VERSION VERSION_LESS "3.1.0" )
# .zip file
Expand Down
37 changes: 26 additions & 11 deletions cmake/ExternalGmock.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# ########################################################################
# Copyright 2015 Advanced Micro Devices, Inc.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -50,8 +50,11 @@ if( CMAKE_COMPILER_IS_GNUCC )
list( APPEND ext.gMock.cmake_args -DCMAKE_C_FLAGS=${EXTRA_FLAGS} -DCMAKE_CXX_FLAGS=${EXTRA_FLAGS} )
endif( )

if( MSVC_IDE OR XCODE_VERSION )
if( MSVC )
list( APPEND ext.gMock.cmake_args -Dgtest_force_shared_crt=ON )
endif( )

if( MSVC_IDE OR XCODE_VERSION )
set( ext.gMock.Make
COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Release
COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config Debug
Expand All @@ -60,18 +63,30 @@ else( )
# Add build thread in addition to the number of cores that we have
include( ProcessorCount )
ProcessorCount( Cores )
message( STATUS "ExternalclBLAS detected ( " ${Cores} " ) cores to build clBLAS with" )

set( ext.gMock.Make "make" )
if( NOT Cores EQUAL 0 )
math( EXPR Cores "${Cores} + 1 " )
list( APPEND ext.gMock.Make -j ${Cores} )
# If we are not using an IDE, assume nmake with visual studio
if( MSVC )
set( ext.gMock.Make "nmake" )
else( )
# If we could not detect # of cores, assume 1 core and add an additional build thread
list( APPEND ext.gMock.Make -j 2 )
set( ext.gMock.Make "make" )

# The -j paramter does not work with nmake
if( NOT Cores EQUAL 0 )
math( EXPR Cores "${Cores} + 1 " )
list( APPEND ext.gMock.Make -j ${Cores} )
else( )
# If we could not detect # of cores, assume 1 core and add an additional build thread
list( APPEND ext.gMock.Make -j 2 )
endif( )
endif( )

list( APPEND ext.gMock.cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} )
message( STATUS "ExternalGmock using ( " ${Cores} " ) cores to build with" )
endif( )

# message( STATUS "ext.gMock.Make ( " ${ext.gMock.Make} " ) " )
# message( STATUS "ext.gMock.cmake_args ( " ${ext.gMock.cmake_args} " ) " )

# Add external project for googleMock
ExternalProject_Add(
gMock
Expand Down
Loading

0 comments on commit 2620f08

Please sign in to comment.